mirror of
https://github.com/beetbox/beets.git
synced 2026-01-30 03:54:21 +01:00
Remove seen_idents set
This was used since time immemorial to keep track of recently-imported music that hasn't hit the database yet. I created it when the importer only added music to the database at the end of the pipeline, after doing all the work to manipulate the metadata. Now, for several reasons, we add the music immediately after the user sees it and then manipulate the records *in the database*. With the latest change, which gets rid of the last separation between UI and database-adding, we no longer need to do this.
This commit is contained in:
parent
079822b893
commit
4c6dbe6780
1 changed files with 4 additions and 10 deletions
|
|
@ -186,7 +186,6 @@ class ImportSession(object):
|
|||
self.logger = self._setup_logging(loghandler)
|
||||
self.paths = paths
|
||||
self.query = query
|
||||
self.seen_idents = set()
|
||||
self._is_resuming = dict()
|
||||
|
||||
# Normalize the paths.
|
||||
|
|
@ -1307,18 +1306,13 @@ def resolve_duplicates(session, task):
|
|||
and ask the session to resolve this.
|
||||
"""
|
||||
if task.choice_flag in (action.ASIS, action.APPLY):
|
||||
ident = task.chosen_ident()
|
||||
found_duplicates = task.find_duplicates(session.lib)
|
||||
if ident in session.seen_idents or found_duplicates:
|
||||
log.debug(
|
||||
'resolving duplicates; in database: {}, in queue: {}'.format(
|
||||
len(found_duplicates),
|
||||
ident in session.seen_idents,
|
||||
)
|
||||
)
|
||||
if found_duplicates:
|
||||
log.debug('found duplicates: {}'.format(
|
||||
[o.id for o in found_duplicates]
|
||||
))
|
||||
session.resolve_duplicate(task, found_duplicates)
|
||||
session.log_choice(task, True)
|
||||
session.seen_idents.add(ident)
|
||||
|
||||
|
||||
@pipeline.mutator_stage
|
||||
|
|
|
|||
Loading…
Reference in a new issue