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:
+3
-3
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user