Importer race condition when removing recently-added duplicates
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
After running `beet import {apth to dir}` I get some "This album is already in the library!" prompts. Sometimes if I press `r`+`{Enter}` the follow stack trace is shown:
```
None (2 items)
Importing as-is.
This album is already in the library!
[S]kip new, Keep both, Remove old? r
Traceback (most recent call last):
File "C:\Python27\Scripts\beet-script.py", line 9, in
load_entry_point('beets==1.3.5', 'console_scripts', 'beet')()
File "c:\Python27\lib\site-packages\beets\ui\__init__.py", line 967, in main
_raw_main(args)
File "c:\Python27\lib\site-packages\beets\ui\__init__.py", line 958, in _raw_m
ain
subcommand.func(lib, suboptions, subargs)
File "c:\Python27\lib\site-packages\beets\ui\commands.py", line 816, in import
_func
import_files(lib, paths, query)
File "c:\Python27\lib\site-packages\beets\ui\commands.py", line 788, in import
_files
session.run()
File "c:\Python27\lib\site-packages\beets\importer.py", line 363, in run
pl.run_parallel(QUEUE_SIZE)
File "c:\Python27\lib\site-packages\beets\util\pipeline.py", line 254, in run
out = self.coro.send(msg)
File "c:\Python27\lib\site-packages\beets\importer.py", line 968, in plugin_st
age
item.load()
File "c:\Python27\lib\site-packages\beets\dbcore\db.py", line 304, in load
assert stored_obj is not None, "object {0} not in DB".format(self.id)
AssertionError: object 288 not in DB
```
On Windows 7 x64 with the following config:
```
directory: D:\Users\David Murdoch\Music
plugins: chroma info web inline fetchart lyrics lastgenre
import:
copy: yes
write: yes
timid: no
quiet_fallback: asis
none_rec_action: asis
default_action: apply
group_albums: yes
incremental: yes
resume: yes
paths:
default: $albumartist/$album/$disc_and_track $title
item_fields:
initial: albumartist[0].upper() + u'.'
disc_and_track: u'%02i.%02i' % (disc, track) if
disctotal > 1 else u'%02i' % (track)
```
Contributor guide
Assessment
This issue has not been assessed yet.