Moves the index outside of classes

It makes more sense to have a universal index, rather than one per comic.
This commit is contained in:
2025-08-12 13:38:00 -06:00
parent b15913b4ca
commit 4ede8bcaa8
3 changed files with 97 additions and 77 deletions

View File

@@ -105,7 +105,7 @@ def __main__():
comic_type = find_comic_class(url.netloc + url.path)
comic = comic_type.create_from_url(url)
comics.append(comic)
comic.read_index(base_path)
comic_download.read_index(base_path)
comic.await_load()
if args.latest:
r = [comic.get_latest_strip()]
@@ -118,19 +118,19 @@ def __main__():
try:
for index in reversed(r):
if not comic.is_strip_present(base_path, ".cbz", str(index)):
if not comic_download.is_strip_present(comic, base_path, ".cbz", str(index)):
t = threading.Thread(name=str(comic.get_identifier_string()) + "-" + str(index), target=load_strip, args=(base_path, comic, index, args.plain, thread_limit))
threads.append(t)
t.start()
finally:
comic.save_index(base_path)
comic_download.save_index(base_path)
try:
for t in threads:
t.join()
finally:
for comic in comics:
comic.save_index(base_path)
comic_download.save_index(base_path)
if __name__ == "__main__":
__main__()