Refactor update table logging and processing; enhance clarity in output messages.

This commit is contained in:
2026-01-22 14:50:30 -05:00
parent f6254ee42e
commit 968a3a2949
+9 -9
View File
@@ -252,18 +252,11 @@ def main() -> int:
"select seriesid, timestamp from updates.tvupdates order by seriesid",
lprint
)
print(f"Saving previous update to file.")
print(f"Saving previous updates to file.")
with open(f"{previous_updates_file}", 'w') as pjf:
for pl in previouslisting:
pjf.write(f"{pl[0]}: {pl[1]}\n")
pjf.close()
print(f"Updating update table.")
dbExec.update_tvupdates(
dbengine["engine"],
downloaded_updates_dict,
"updates.tvupdates"
)
print("update complete.")
# convert previouslisting (list of tuples) into a dict: row_id -> country_name
try:
_previouslisting_list = previouslisting
@@ -289,7 +282,14 @@ def main() -> int:
for line in skipfile:
field = line.split(';')
skip_ids[field[0]] = field[1]
print(f"Processing {len(downloaded_updates_dict)} downloaded updates against {len(previous_listing_dict)} previous listings for files needed.")
print(f"Updating update table.")
dbExec.update_tvupdates(
dbengine["engine"],
downloaded_updates_dict,
"updates.tvupdates"
)
print("update complete.")
print(f"Processing {len(downloaded_updates_dict)} downloaded updates against {len(previous_listing_dict)} previous updates for files needed.")
for seriesid, ts in downloaded_updates_dict.items():
if seriesid in previous_listing_dict:
prev_ts = previous_listing_dict[seriesid]