Vorbereitung Release 0.2.0 #83

Merged
tpeetz merged 178 commits from develop/0.2.0 into main 2026-01-29 22:50:42 +00:00
Showing only changes of commit 55a09d32b3 - Show all commits
+6 -2
View File
@@ -34,7 +34,7 @@ def download_file(url: str, file_info: dict, download_dir: str = "/data/media",
output = re.sub(' +', ' ', output)
lines_list = output.splitlines()
file_name = __parse_output__(lines_list)
if file_name is None:
if file_name is None or not file_name.strip():
file_info['review'] = True
file_info['should_download'] = True
file_info['file_name'] = None
@@ -58,6 +58,8 @@ def __parse_output__(lines_list: list[str]) -> str | None:
start_len = len('[download] Destination: ')
file_len = line_len - start_len
file_name = line[-file_len:]
else:
file_name = None
return file_name
@@ -91,8 +93,10 @@ def update_status(item_id: UUID, file_info: dict):
def rename_file(file_info: dict):
item_id = file_info['id']
file_name = file_info['file_name']
if file_name is None:
if file_name is None or not file_name.strip():
log.info("file_name is not set, rename is not executed")
file_info['review'] = True
file_info['should_download'] = True
return
file = Path(args.dir, file_name)
new_file_path = file.with_name(f"{item_id}{file.suffix}")