Add "Tipy dne" folder and fix stale genre folder cleanup

This commit is contained in:
2026-06-29 15:33:44 +02:00
parent a71b209539
commit ee99fc957d
7 changed files with 165 additions and 302 deletions
+11 -4
View File
@@ -957,12 +957,14 @@ class QtApp(QMainWindow):
QMessageBox.information(self, "Filmotéka", "Pool je prázdný.")
return
manager = HardlinkManager(out)
reserved = set(self.filehandler.copyasis_folders) | {"Tipy dne"}
created, create_fail, removed, remove_fail = manager.sync_structure(
files,
category_roots=self.filehandler.filmoteka_category_roots(),
category_transforms=self.filehandler.filmoteka_category_transforms(),
category_filename_templates=(
self.filehandler.filmoteka_category_filename_templates()),
reserved_subfolders=reserved,
)
# Copy-as-is folders (e.g. Seriály): mirror each 1:1 (hardlinked)
@@ -976,17 +978,22 @@ class QtApp(QMainWindow):
mirrored += m_created
mirror_fail += m_failed
# "Tipy dne": 10 random pool movies (copy-as-is folders excluded)
tips, tips_fail = manager.generate_random_tips(files, count=10)
msg = (
f"Filmy — vytvořeno: {created}, odebráno zastaralých: {removed}\n"
f"Copy-as-is — zrcadleno: {mirrored}"
f"Copy-as-is — zrcadleno: {mirrored}\n"
f"Tipy dne — náhodně: {tips}"
)
if create_fail or remove_fail or mirror_fail:
msg += f"\nSelhalo: {create_fail + remove_fail + mirror_fail}"
if create_fail or remove_fail or mirror_fail or tips_fail:
msg += f"\nSelhalo: {create_fail + remove_fail + mirror_fail + tips_fail}"
QMessageBox.warning(self, "Filmotéka dokončena s chybami", msg)
else:
QMessageBox.information(self, "Filmotéka vygenerována", msg)
self.status.showMessage(
f"Filmotéka: filmy +{created}/-{removed}, copy-as-is +{mirrored}", 5000
f"Filmotéka: filmy +{created}/-{removed}, copy-as-is +{mirrored}, "
f"tipy +{tips}", 5000
)
def edit_copyasis_folders(self) -> None: