test
This commit is contained in:
parent
b54e043686
commit
8d88c5e113
@ -59,9 +59,14 @@ def do_file_search(arr_file_path):
|
|||||||
response = requests.post("%s/api/v2/search-db" % script_settings["tdarr"]["url"], json=payload, headers=headers)
|
response = requests.post("%s/api/v2/search-db" % script_settings["tdarr"]["url"], json=payload, headers=headers)
|
||||||
loggit("Tdarr response: %s\n" % response)
|
loggit("Tdarr response: %s\n" % response)
|
||||||
try:
|
try:
|
||||||
DBid = response.json()[0]["DB"]
|
response_json = response.json()
|
||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
if not len(response_json):
|
||||||
|
return None
|
||||||
|
DBids = [x["DB"] for x in response_json if "DB" in list(response_json[x].keys())]
|
||||||
|
print(DBids)
|
||||||
|
DBid = DBids[0]
|
||||||
return DBid
|
return DBid
|
||||||
|
|
||||||
|
|
||||||
@ -73,7 +78,7 @@ def do_reverse_recursive_directory_search(arr_file_path):
|
|||||||
print(arr_dir_path)
|
print(arr_dir_path)
|
||||||
DBid = do_file_search(arr_dir_path)
|
DBid = do_file_search(arr_dir_path)
|
||||||
if DBid:
|
if DBid:
|
||||||
break
|
# break
|
||||||
print(DBid)
|
print(DBid)
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user