return if no download thumb path
This commit is contained in:
parent
6f4e7df94d
commit
07b5b28215
2 changed files with 4 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ class Entry(EntryVariables, BaseEntry):
|
||||||
"""Returns the entry's thumbnail's file path to where it was downloaded"""
|
"""Returns the entry's thumbnail's file path to where it was downloaded"""
|
||||||
return str(Path(self.working_directory()) / self.get_download_thumbnail_name())
|
return str(Path(self.working_directory()) / self.get_download_thumbnail_name())
|
||||||
|
|
||||||
def get_ytdlp_download_thumbnail_path(self) -> Optional[str]:
|
def try_get_ytdlp_download_thumbnail_path(self) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
The source `thumbnail` value and the actual downloaded thumbnail extension sometimes do
|
The source `thumbnail` value and the actual downloaded thumbnail extension sometimes do
|
||||||
not match. Return the actual downloaded thumbnail path.
|
not match. Return the actual downloaded thumbnail path.
|
||||||
|
|
@ -90,7 +90,7 @@ class Entry(EntryVariables, BaseEntry):
|
||||||
-------
|
-------
|
||||||
True if ANY thumbnail file exist locally. False otherwise.
|
True if ANY thumbnail file exist locally. False otherwise.
|
||||||
"""
|
"""
|
||||||
return self.get_ytdlp_download_thumbnail_path() is not None
|
return self.try_get_ytdlp_download_thumbnail_path() is not None
|
||||||
|
|
||||||
@final
|
@final
|
||||||
def is_thumbnail_downloaded(self) -> bool:
|
def is_thumbnail_downloaded(self) -> bool:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ def try_convert_download_thumbnail(entry: Entry) -> None:
|
||||||
entry
|
entry
|
||||||
Entry with the thumbnail
|
Entry with the thumbnail
|
||||||
"""
|
"""
|
||||||
download_thumbnail_path = entry.get_ytdlp_download_thumbnail_path()
|
download_thumbnail_path: Optional[str] = entry.try_get_ytdlp_download_thumbnail_path()
|
||||||
download_thumbnail_path_as_jpg = entry.get_download_thumbnail_path()
|
download_thumbnail_path_as_jpg = entry.get_download_thumbnail_path()
|
||||||
|
|
||||||
# If it was already converted, do not convert again
|
# If it was already converted, do not convert again
|
||||||
|
|
@ -38,6 +38,7 @@ def try_convert_download_thumbnail(entry: Entry) -> None:
|
||||||
|
|
||||||
if not download_thumbnail_path:
|
if not download_thumbnail_path:
|
||||||
logger.warning("Thumbnail for '%s' was not downloaded", entry.title)
|
logger.warning("Thumbnail for '%s' was not downloaded", entry.title)
|
||||||
|
return
|
||||||
|
|
||||||
if not download_thumbnail_path == download_thumbnail_path_as_jpg:
|
if not download_thumbnail_path == download_thumbnail_path_as_jpg:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue