mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
importsource: Catch importer crash when skipping
Catches a crash when "skip" is selected in the importer and
task.imported_items() runs into a condition branch that supposedly
should never be reached:
File "beets/beets/importer/tasks.py", line 254, in imported_items
assert False
This commit is contained in:
parent
2bd77b9895
commit
4f95a2f25a
1 changed files with 7 additions and 3 deletions
|
|
@ -39,9 +39,13 @@ class ImportSourcePlugin(BeetsPlugin):
|
||||||
)
|
)
|
||||||
|
|
||||||
def prevent_suggest_removal(self, session, task):
|
def prevent_suggest_removal(self, session, task):
|
||||||
|
try:
|
||||||
for item in task.imported_items():
|
for item in task.imported_items():
|
||||||
if "mb_albumid" in item:
|
if "mb_albumid" in item:
|
||||||
self.stop_suggestions_for_albums.add(item.mb_albumid)
|
self.stop_suggestions_for_albums.add(item.mb_albumid)
|
||||||
|
except AssertionError:
|
||||||
|
# No imported items - nothing to do
|
||||||
|
pass
|
||||||
|
|
||||||
def import_stage(self, _, task):
|
def import_stage(self, _, task):
|
||||||
"""Event handler for albums import finished."""
|
"""Event handler for albums import finished."""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue