From 83e529a77939f3c86c1e73931724b1704ef8e44f Mon Sep 17 00:00:00 2001 From: miigotu Date: Sat, 3 Feb 2024 01:34:15 -0500 Subject: [PATCH 01/29] refactor: lowercase and typo function, parameter, and variable names in tv.py Signed-off-by: miigotu --- SickChill.py | 11 +- .../gui/slick/views/config_providers.mako | 68 +- sickchill/oldbeard/classes.py | 2 +- sickchill/oldbeard/dailysearcher.py | 2 +- sickchill/oldbeard/failedProcessor.py | 2 +- sickchill/oldbeard/helpers.py | 2 +- sickchill/oldbeard/nzbSplitter.py | 4 +- sickchill/oldbeard/postProcessor.py | 4 +- sickchill/oldbeard/properFinder.py | 2 +- sickchill/oldbeard/providers/bjshare.py | 4 +- sickchill/oldbeard/scene_numbering.py | 2 +- sickchill/oldbeard/search.py | 8 +- sickchill/oldbeard/searchBacklog.py | 2 +- sickchill/oldbeard/show_queue.py | 42 +- sickchill/oldbeard/subtitles.py | 2 +- sickchill/oldbeard/traktChecker.py | 4 +- sickchill/oldbeard/tvcache.py | 6 +- sickchill/providers/GenericProvider.py | 9 +- sickchill/providers/metadata/generic.py | 12 +- .../providers/torrent/TorrentProvider.py | 2 +- sickchill/show/ComingEpisodes.py | 2 +- sickchill/show/History.py | 4 +- sickchill/show/Show.py | 2 +- sickchill/show_updater.py | 2 +- sickchill/start.py | 125 ++-- sickchill/tv.py | 698 +++++++++--------- sickchill/views/api/webapi.py | 18 +- sickchill/views/home.py | 22 +- sickchill/views/manage/index.py | 4 +- tests/conftest.py | 8 +- tests/sickchill_tests/show/test_show.py | 2 +- tests/test_notifier.py | 4 +- tests/test_pp.py | 4 +- tests/test_search.py | 4 +- tests/test_snatch.py | 4 +- tests/test_tv.py | 26 +- 36 files changed, 560 insertions(+), 559 deletions(-) diff --git a/SickChill.py b/SickChill.py index d11749a6c0..70d0ecfc23 100755 --- a/SickChill.py +++ b/SickChill.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import datetime +import mimetypes import os import platform import shutil @@ -28,14 +29,12 @@ setup_gettext() -import mimetypes - mimetypes.add_type("text/css", ".css") mimetypes.add_type("application/sfont", ".otf") mimetypes.add_type("application/sfont", ".ttf") mimetypes.add_type("application/javascript", ".js") mimetypes.add_type("application/font-woff", ".woff") -# Not sure about this one, but we also have halflings in .woff so I think it wont matter +# Not sure about this one, but we also have halflings in .woff, so I think it won't matter # mimetypes.add_type("application/font-woff2", ".woff2") from configobj import ConfigObj @@ -67,6 +66,8 @@ def __init__(self): self.run_as_daemon = False # web server constants + self.flask_server = None + self.web_server = None self.forced_port = None self.no_launch = False @@ -253,7 +254,7 @@ def load_shows_from_db(): for sql_show in sql_results: try: cur_show = TVShow(sql_show["indexer"], sql_show["indexer_id"]) - cur_show.nextEpisode() + cur_show.next_episode() settings.showList.append(cur_show) except Exception as error: logger.exception("There was an error creating the show in {}: Error {}".format(sql_show["location"], error)) @@ -301,7 +302,7 @@ def shutdown(self, event): """ if settings.started: sickchill.start.halt() # stop all tasks - sickchill.start.saveAll() # save all shows to DB + sickchill.start.save_all() # save all shows to DB # shutdown web server if self.web_server: diff --git a/sickchill/gui/slick/views/config_providers.mako b/sickchill/gui/slick/views/config_providers.mako index 3a7cedb406..1eac64b38b 100644 --- a/sickchill/gui/slick/views/config_providers.mako +++ b/sickchill/gui/slick/views/config_providers.mako @@ -75,7 +75,7 @@