From abeb809d7d1b8255f93e9be1dff57be0da78f52d Mon Sep 17 00:00:00 2001 From: miigotu Date: Thu, 25 Jul 2024 18:43:21 -0400 Subject: [PATCH] (fix) error where logs did not have passwords and other items censored and UNDEFINED on first startup (#8777) * (fix) error where logs did not have passwords and other items censored (fix) error on first startup of UNDEFINED comparison if page loads before the error viewer has loaded (refactor) move ErrorViewer and WarningViewer into a sinlge class called WebErrorViewer and add utility functions, which cleaned up code and moved it to sickchill.logging.weblog (refactor) move sickchill.oldbeard.classes to sickchill.providers.result_classes Signed-off-by: miigotu * (refactor) add missed changes in mako Signed-off-by: miigotu * (fix) depends: explicitly include appdirs in dependencies and upgrade all yarn and poetry dependencies Signed-off-by: miigotu --------- Signed-off-by: miigotu --- pyproject.toml | 1 + sickchill/gui/slick/views/errorlogs.mako | 10 +- sickchill/gui/slick/views/layouts/main.mako | 5 + sickchill/logger.py | 16 +-- sickchill/logging/__init__.py | 0 sickchill/logging/weblog.py | 106 ++++++++++++++++++ .../oldbeard/clients/download_station.py | 2 +- sickchill/oldbeard/clients/qbittorrent.py | 2 +- sickchill/oldbeard/clients/transmission.py | 2 +- sickchill/oldbeard/notifiers/discord.py | 8 +- sickchill/oldbeard/notifiers/pushbullet.py | 7 +- sickchill/oldbeard/notifiers/pushover.py | 8 +- .../oldbeard/notifiers/synologynotifier.py | 7 +- sickchill/oldbeard/nzbSplitter.py | 5 +- sickchill/oldbeard/nzbget.py | 2 +- sickchill/oldbeard/providers/btn.py | 5 +- sickchill/oldbeard/providers/hdbits.py | 5 +- sickchill/oldbeard/sab.py | 2 +- sickchill/oldbeard/search.py | 2 +- sickchill/providers/GenericProvider.py | 2 +- sickchill/providers/nzb/NZBProvider.py | 2 +- .../result_classes.py} | 64 ----------- .../providers/torrent/TorrentProvider.py | 2 +- sickchill/show/History.py | 2 +- sickchill/views/api/webapi.py | 17 +-- sickchill/views/common.py | 7 +- sickchill/views/home.py | 9 +- sickchill/views/logs.py | 12 +- tests/test_snatch.py | 1 - yarn.lock | 31 +---- 30 files changed, 186 insertions(+), 158 deletions(-) create mode 100644 sickchill/logging/__init__.py create mode 100644 sickchill/logging/weblog.py rename sickchill/{oldbeard/classes.py => providers/result_classes.py} (79%) diff --git a/pyproject.toml b/pyproject.toml index 0698d6dc0a..9479c6cb3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -300,3 +300,4 @@ beekeeper-alt = ">=2022.9.3" stevedore = "^5.1.0" cachecontrol = ">=0.13.1,<0.15.0" cinemagoer = {version = "^2023.5.1", allow-prereleases = true} +appdirs = "^1.4.4" diff --git a/sickchill/gui/slick/views/errorlogs.mako b/sickchill/gui/slick/views/errorlogs.mako index 63166be70e..116896727d 100644 --- a/sickchill/gui/slick/views/errorlogs.mako +++ b/sickchill/gui/slick/views/errorlogs.mako @@ -1,15 +1,15 @@ <%inherit file="/layouts/main.mako" /> <%! - from sickchill.oldbeard import classes - import sickchill + from sickchill.logging.weblog import WebErrorViewer + import logging %> <%block name="content"> <% - if logLevel == sickchill.logger.WARNING: - errors = classes.WarningViewer.errors + if logLevel == logging.WARNING: + errors = WebErrorViewer.warnings title = _('WARNING logs') else: - errors = classes.ErrorViewer.errors + errors = WebErrorViewer.errors title = _('ERROR logs') %>
diff --git a/sickchill/gui/slick/views/layouts/main.mako b/sickchill/gui/slick/views/layouts/main.mako index 2ba7dc49b2..bc5c0eb466 100644 --- a/sickchill/gui/slick/views/layouts/main.mako +++ b/sickchill/gui/slick/views/layouts/main.mako @@ -120,6 +120,11 @@