Refactor update logic in Dbexec class; adjust logging level in settings; enhance JSON downloader function call in update_mongo.py for improved error handling.

This commit is contained in:
2025-12-12 07:46:45 -05:00
parent 097225c942
commit 4f0267ecf2
4 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -199,7 +199,7 @@ def main() -> int:
# TVMAZE_URLS is a dict of urls; use the updatesurl if available
updates_url = TVMAZE_URLS.get('updatesurl') if isinstance(TVMAZE_URLS, dict) else None
if updates_url:
json_downloader.download_json_to_file(updates_url, tempdir, out_file)
json_downloader.download_json_to_file(updates_url, tempdir, out_file, lprint)
# load and convert saved JSON into a dict (id -> timestamp)
try:
downloaded_updates_dict = {}
@@ -257,8 +257,8 @@ def main() -> int:
downloaded_updates_list = []
except Exception:
# non-fatal; continue
pass
del downloaded_updates_list
lprint.logprint("warning", "Failed to save or load downloaded updates JSON.")
#del downloaded_updates_list
previouslisting = dbExec.rawsql_select(
dbengine["engine"],
"select seriesid, timestamp from updates.tvupdates order by seriesid",