From c83f2e4e7127ae746b4f3d8107e10a4e9170f44b Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Sat, 1 Feb 2025 13:45:18 +0100 Subject: [PATCH] Recreating importstate class to imitate previous code, otherwise we have slightly different behavior. --- beets/importer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/beets/importer.py b/beets/importer.py index e72aac514..3586445fd 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -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.