mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 19:12:40 +01:00
Recreating importstate class to imitate previous code, otherwise
we have slightly different behavior.
This commit is contained in:
parent
6f2ee5c614
commit
c83f2e4e71
1 changed files with 3 additions and 5 deletions
|
|
@ -378,9 +378,8 @@ class ImportSession:
|
|||
"""Returns true if the files belonging to this task have already
|
||||
been imported in a previous session.
|
||||
"""
|
||||
state = ImportState()
|
||||
if self.is_resuming(toppath) and all(
|
||||
[state.progress_has_element(toppath, p) for p in paths]
|
||||
[ImportState().progress_has_element(toppath, p) for p in paths]
|
||||
):
|
||||
return True
|
||||
if self.config["incremental"] and tuple(paths) in self.history_dirs:
|
||||
|
|
@ -427,8 +426,7 @@ class ImportSession:
|
|||
|
||||
Determines the return value of `is_resuming(toppath)`.
|
||||
"""
|
||||
state = ImportState()
|
||||
if self.want_resume and state.progress_has(toppath):
|
||||
if self.want_resume and ImportState().progress_has(toppath):
|
||||
# Either accept immediately or prompt for input to decide.
|
||||
if self.want_resume is True or self.should_resume(toppath):
|
||||
log.warning(
|
||||
|
|
@ -438,7 +436,7 @@ class ImportSession:
|
|||
self._is_resuming[normpath(toppath)] = True
|
||||
else:
|
||||
# Clear progress; we're starting from the top.
|
||||
state.progress_reset(toppath)
|
||||
ImportState().progress_reset(toppath)
|
||||
|
||||
|
||||
# The importer task class.
|
||||
|
|
|
|||
Loading…
Reference in a new issue