Bump version to 0.9.2; update method signatures and localization files
All checks were successful
Gitea/kapitanbooru-uploader/pipeline/head This commit looks good

This commit is contained in:
2025-06-26 17:45:52 +02:00
parent c90740cbed
commit cb26a0dc47
5 changed files with 183 additions and 182 deletions

View File

@@ -35,7 +35,7 @@ class Core:
"""
def __init__(self, settings: Settings, gui_mode: bool = True):
self.version = "0.9.1"
self.version = "0.9.2"
self.acknowledged_version = parse_version(self.version)
self.settings = settings
self.tags_repo = TagsRepo(settings)
@@ -226,7 +226,7 @@ class Core:
final_tags.add("meta:auto_upload")
return " ".join(sorted(final_tags)), rating
def get_tagger_results(self, file_path, callback) -> wdt.Result:
def get_tagger_results(self, file_path, callback: Callable|None = None) -> wdt.Result:
md5 = self.image_files_md5[file_path]
cached = self.tagger_cache[md5]
if cached:
@@ -237,7 +237,8 @@ class Core:
result = self.tagger.tag(img)
self.tagger_cache[md5] = result
self.tagger_processed.add(md5)
callback()
if callback:
callback()
print(_("Tagger przetworzył:"), f"{file_path}")
return result
except Exception as e:
@@ -357,7 +358,7 @@ class Core:
def process_tagger_for_image(self, file_path):
"""Przetwarza obrazek przy użyciu Taggera i zapisuje wynik do cache."""
result = self.get_tagger_results(file_path)
result = self.get_tagger_results(file_path, self.update_status_bar_callback)
if self.process_tagger_for_image_callback:
self.process_tagger_for_image_callback(file_path, result.rating)