Actually fix uploaded count
All checks were successful
Gitea/kapitanbooru-uploader/pipeline/head This commit looks good

This commit is contained in:
Michał Leśniak 2025-03-09 13:05:47 +01:00
parent dc3efc5d3c
commit a257440973
4 changed files with 9 additions and 6 deletions

View File

@ -139,7 +139,7 @@ class ImageBrowser(tk.Tk):
super().__init__() super().__init__()
self.title("Kapitanbooru Uploader") self.title("Kapitanbooru Uploader")
self.geometry("900x600") self.geometry("900x600")
self.version = "0.4.2" self.version = "0.4.3"
self.settings = Settings() self.settings = Settings()
self.tags_repo = TagsRepo(self.settings) self.tags_repo = TagsRepo(self.settings)
@ -715,6 +715,8 @@ class ImageBrowser(tk.Tk):
self.tagger_processed.add(md5) self.tagger_processed.add(md5)
self.listbox.delete(0, tk.END) self.listbox.delete(0, tk.END)
self.uploaded.clear() self.uploaded.clear()
self.upload_verified = 0
self.uploaded_count = 0
for file in self.image_files: for file in self.image_files:
self.listbox.insert(tk.END, os.path.basename(file)) self.listbox.insert(tk.END, os.path.basename(file))
self.uploaded[file] = False self.uploaded[file] = False
@ -1622,12 +1624,13 @@ class ImageBrowser(tk.Tk):
cancel_event: threading.Event = None, cancel_event: threading.Event = None,
secondary_progress_queue: queue.Queue = None, secondary_progress_queue: queue.Queue = None,
): ):
files_count = len(self.image_files) files_to_upload = [x for x in self.image_files if not self.uploaded[x]]
files_count = len(files_to_upload)
if progress_queue: if progress_queue:
progress_queue.put(("mode", "determinate")) progress_queue.put(("mode", "determinate"))
progress_queue.put(("max", 100)) progress_queue.put(("max", 100))
file_idx = 0 file_idx = 0
for file_path in self.image_files: for file_path in files_to_upload:
if progress_queue: if progress_queue:
progress_queue.put(("progress", file_idx * 100 / files_count)) progress_queue.put(("progress", file_idx * 100 / files_count))
progress_queue.put( progress_queue.put(

View File

@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Kapitanbooru Uploader 0.4.2\n" "Project-Id-Version: Kapitanbooru Uploader 0.4.3\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-02 00:39+0100\n" "POT-Creation-Date: 2025-03-02 00:39+0100\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@ -1,6 +1,6 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Kapitanbooru Uploader 0.4.2\n" "Project-Id-Version: Kapitanbooru Uploader 0.4.3\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-03-02 00:39+0100\n" "POT-Creation-Date: 2025-03-02 00:39+0100\n"
"Language: pl\n" "Language: pl\n"

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "kapitanbooru-uploader" name = "kapitanbooru-uploader"
version = "0.4.2" version = "0.4.3"
description = "A GUI application for uploading images to KapitanBooru" description = "A GUI application for uploading images to KapitanBooru"
authors = [ authors = [
{name = "Michał Leśniak", email = "kapitan@mlesniak.pl"} {name = "Michał Leśniak", email = "kapitan@mlesniak.pl"}