This commit is contained in:
deathbybandaid 2023-01-06 19:26:36 -05:00
parent 034fcfa6f7
commit df50b9a03d

View File

@ -65,6 +65,12 @@ def do_file_search(arr_file_path):
return DBid
def do_reverse_recursive_directory_search(arr_file_path):
arr_dir_path = os.path.dirname(arr_file_path)
print(arr_dir_path)
return None
def main():
if "sonarr_eventtype" in os.environ:
@ -110,11 +116,19 @@ def main():
# loggit("Preparing payload to POST to tdarr API\n")
loggit("Searching tdarr API for item's library ID\n")
"""
DBid = do_file_search(arr_file_path)
if not DBid:
loggit("No exact match found, searching for library ID from Reverse Recursive Directory matching\n")
else:
print(DBid)
"""
DBid = do_reverse_recursive_directory_search(arr_file_path)
if not DBid:
loggit("No match found\n")
sys.exit(0)
else:
print(DBid)
if __name__ == "__main__":