From 8ae50a4f97c6881994c51f65e1714f8383093e2d Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Wed, 5 Oct 2022 21:36:59 +0200 Subject: [PATCH] Low number of files in queue reminder --- locale/en.json | 3 ++- locale/uk.json | 3 ++- poster.py | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/locale/en.json b/locale/en.json index 23d3833..7e447ba 100644 --- a/locale/en.json +++ b/locale/en.json @@ -22,7 +22,8 @@ "document_too_large": "File you've sent is too large. Please submit files not bigger than {0} MB", "mime_not_allowed": "File type not allowed. Please, consider using one of these: {0}", "post_exception": "Could not send content due to `{exp}`\n\nTraceback:\n```{0}```", - "post_empty": "Could not send content: `Queue folder is empty or contains only unsupported or already sent files.`" + "post_empty": "Could not send content: `Queue folder is empty or contains only unsupported or already sent files.`", + "post_low": "Low amount of content: `There are only {0} files left in the queue.`" }, "button": { "sub_yes": "✅ Accept", diff --git a/locale/uk.json b/locale/uk.json index 1c9aa63..378eb93 100644 --- a/locale/uk.json +++ b/locale/uk.json @@ -22,7 +22,8 @@ "document_too_large": "Надісланий файл завеликий. Будь ласка, надсилайте файли не більше {0} Мб", "mime_not_allowed": "Тип файлу не дозволений. Розгляньте можливість використання одного з цих: {0}", "post_exception": "Не вдалося надіслати контент через `{exp}`\n\nTraceback:\n```{0}```", - "post_empty": "Не вдалося надіслати контент: «Папка черги порожня або містить лише непідтримувані або вже надіслані файли»." + "post_empty": "Не вдалося надіслати контент: `Папка черги порожня або містить лише непідтримувані або вже надіслані файли`.", + "post_low": "Мала кількість контенту: `Залишилось всього {0} файлів в черзі.`" }, "button": { "sub_yes": "✅ Прийняти", diff --git a/poster.py b/poster.py index b128c06..b341ab9 100644 --- a/poster.py +++ b/poster.py @@ -138,6 +138,9 @@ def send_content(): if len(list_queue) > 0: candidate_file = choice(list_queue) candidate = configGet("queue", "locations")+sep+candidate_file + if len(list_queue) <= 10: + if configGet("error", "reports"): + app.send_message(configGet("admin"), locale("post_low", "message", locale=configGet("locale"))) # type: ignore else: logWrite(locale("post_empty", "console", locale=configGet("locale_log"))) if configGet("error", "reports"):