add search_mongodb.py and change seriesid in update_mongodb.py from a string to an int.
This commit is contained in:
+3
-2
@@ -11,6 +11,7 @@ import logs.Logger
|
||||
from db.functions import settype, dbmongo
|
||||
from datetime import datetime
|
||||
import json
|
||||
import json_downloader
|
||||
|
||||
response = None
|
||||
|
||||
@@ -315,7 +316,7 @@ def main() -> int:
|
||||
lprint.logprint("debug", f"Series {seriesid} present in downloaded updates but missing in previous listing")
|
||||
|
||||
lprint.logprint("info", f"Downloadinng JSON for {len(files_needed)} series IDs.")
|
||||
print(f"Downloadinng JSON for {len(files_needed)} files.")
|
||||
print(f"Downloading JSON for {len(files_needed)} files.")
|
||||
for i in tqdm(range(len(files_needed)), desc="Downloading JSON files", unit="filename"):
|
||||
for directory, file in files_needed[i:i+1]:
|
||||
if 'credits' in directory:
|
||||
@@ -336,7 +337,7 @@ def main() -> int:
|
||||
url_template = TVMAZE_URLS["showurl"]
|
||||
seriesid = file.replace('.json', '')
|
||||
json_downloader.download_json_to_file(url_template.replace("<seriesid>", str(seriesid)), directory, f'{seriesid}.json', lprint)
|
||||
dbExec.update_tvupdates(dbengine["engine"], downloaded_updates_dict, updatetable)
|
||||
# dbExec.update_tvupdates(dbengine["engine"], downloaded_updates_dict, updatetable)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user