Fixes a bug with indexing

This commit is contained in:
2025-08-12 08:46:00 -06:00
parent f695b71dce
commit b204ae5508
2 changed files with 24 additions and 7 deletions

View File

@@ -329,7 +329,9 @@ class Comic(ImageRepo, ABC):
:param strip: The comic strip to index
"""
with self._index_lock:
self.strip_index[strip.identifier] = strip.get_filename()
if not self.identifier in self.strip_index:
self.strip_index[self.identifier] = {}
self.strip_index[self.identifier][strip.identifier] = strip.get_filename()
def is_strip_present(self, base_path: Path, suffix: str, identifier) -> bool:
"""
@@ -340,9 +342,11 @@ class Comic(ImageRepo, ABC):
:param identifier: The identifier to check.
:returns: True if the strip file has been saved.
"""
if not identifier in self.strip_index:
if not self.identifier in self.strip_index:
return False
path = Path(base_path, self.strip_index[identifier] + suffix)
if not identifier in self.strip_index[self.identifier]:
return False
path = Path(base_path, self.strip_index[self.identifier][identifier] + suffix)
return path.exists()