setup kontor-schema
This commit is contained in:
+8
-8
@@ -61,19 +61,19 @@ def __parse_output__(lines_list: list[str]) -> str | None:
|
||||
return file_name
|
||||
|
||||
|
||||
def is_file_downloaded(item: dict, dir: Path) -> FileStatus:
|
||||
file_name_as_title = f"{item['file_name']}"
|
||||
file_title = Path(dir, file_name_as_title, ".mp4")
|
||||
def is_file_downloaded(media_file: dict, dir: Path) -> FileStatus:
|
||||
file_name_as_title = f"{media_file['file_name']}"
|
||||
file_title = Path(dir, f"{file_name_as_title}.mp4")
|
||||
if file_title.exists():
|
||||
log.info(f"{file_name_as_title} has been downloaded")
|
||||
item['should_download'] = 0
|
||||
media_file['should_download'] = False
|
||||
return FileStatus.DOWNLOADED
|
||||
file_name_as_id = f"{item['id']}"
|
||||
file_with_id_as_name = Path(dir, file_name_as_id, ".mp4")
|
||||
file_name_as_id = f"{media_file['id']}"
|
||||
file_with_id_as_name = Path(dir, f"{file_name_as_id}.mp4")
|
||||
if file_with_id_as_name.exists():
|
||||
log.info(f"{file_with_id_as_name} has been downloaded and renamed")
|
||||
item['cloud_link'] = file_with_id_as_name
|
||||
item['should_download'] = 0
|
||||
media_file['cloud_link'] = file_with_id_as_name
|
||||
media_file['should_download'] = False
|
||||
return FileStatus.RENAMED
|
||||
log.info("could not find file - start download")
|
||||
return FileStatus.UNKNOWN
|
||||
|
||||
Reference in New Issue
Block a user