core: simplify code

This commit is contained in:
2025-04-15 14:41:06 +02:00
parent e27bfe74ea
commit 196ae57b2c
6 changed files with 61 additions and 43 deletions

View File

@ -19,14 +19,14 @@ def scan_pages(folders: list[Path]) -> list[Page]:
for folder in folders:
files: list[Path] = folder.get_files()
page: Page = Page(folder.get_absolute_path(), folder.get_name(), None, prev, None)
page: Page = Page(folder.get_absolute_path(), folder.get_name(), prev=prev)
raw: Path = Path(folder.get_absolute_path(), folder.get_name() + ".NEF")
images: list[Path] = [Picture(file, page=prev, raw=raw) for file in files if file.get_name().endswith(".png")]
for file in files:
if file.get_name().endswith(".png"):
page.add_picture(Picture(file, page=prev, raw=raw))
page.images = images
if len(images) == 0:
if len(page.get_picture()) == 0:
bar.next()
continue