mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Fix the edit plugin displaying bogus data or even crashing on re-imports
This commit is contained in:
parent
51961bbba2
commit
df479d686d
1 changed files with 8 additions and 4 deletions
|
|
@ -365,9 +365,12 @@ class EditPlugin(plugins.BeetsPlugin):
|
|||
"""Callback for invoking the functionality during an interactive
|
||||
import session on the *original* item tags.
|
||||
"""
|
||||
# Assign temporary ids to the Items.
|
||||
for i, obj in enumerate(task.items):
|
||||
obj.id = i + 1
|
||||
# Assign negative temporary ids to Items that are not in the database
|
||||
# yet. By using negative values, no clash with items in the database
|
||||
# can occur.
|
||||
for i, obj in enumerate(task.items, start=1):
|
||||
if not obj._db:
|
||||
obj.id = -i
|
||||
|
||||
# Present the YAML to the user and let her change it.
|
||||
fields = self._get_fields(album=False, extra=[])
|
||||
|
|
@ -375,7 +378,8 @@ class EditPlugin(plugins.BeetsPlugin):
|
|||
|
||||
# Remove temporary ids.
|
||||
for obj in task.items:
|
||||
obj.id = None
|
||||
if not obj._db:
|
||||
obj.id = None
|
||||
|
||||
# Save the new data.
|
||||
if success:
|
||||
|
|
|
|||
Loading…
Reference in a new issue