update playlist file when file is not downloaded

This commit is contained in:
Rafael Moraes
2024-09-21 22:16:27 -03:00
parent df6843bd82
commit a468454a04
2 changed files with 12 additions and 9 deletions
+6 -4
View File
@@ -114,6 +114,7 @@ class DownloaderEpisode:
)
cover_path = self.get_cover_path(final_path)
cover_url = self.downloader.get_cover_url(show_metadata)
decrypted_path = None
if final_path.exists() and not self.downloader.overwrite:
logger.warning(f'Track already exists at "{final_path}", skipping')
return
@@ -142,10 +143,11 @@ class DownloaderEpisode:
logger.debug(f'Saving cover to "{cover_path}"')
self.downloader.save_cover_file(cover_path, cover_url)
return
logger.debug("Applying tags")
self.downloader.apply_tags(decrypted_path, tags, cover_url)
logger.debug(f'Moving to "{final_path}"')
self.downloader.move_to_final_path(decrypted_path, final_path)
if decrypted_path:
logger.debug("Applying tags")
self.downloader.apply_tags(decrypted_path, tags, cover_url)
logger.debug(f'Moving to "{final_path}"')
self.downloader.move_to_final_path(decrypted_path, final_path)
if self.downloader.save_playlist and playlist_metadata:
playlist_file_path = self.downloader.get_playlist_file_path(tags)
logger.debug(f'Updating M3U8 playlist from "{playlist_file_path}"')
+6 -5
View File
@@ -201,11 +201,11 @@ class DownloaderSong:
lrc_path = self.downloader.get_lrc_path(final_path)
cover_path = self.get_cover_path(final_path)
cover_url = self.downloader.get_cover_url(album_metadata)
decrypted_path = None
if self.lrc_only:
pass
elif final_path.exists() and not self.downloader.overwrite:
logger.warning(f'Track already exists at "{final_path}", skipping')
return
else:
if not decryption_key:
logger.debug("Getting decryption key")
@@ -238,10 +238,11 @@ class DownloaderSong:
logger.debug(f'Saving cover to "{cover_path}"')
self.downloader.save_cover_file(cover_path, cover_url)
return
logger.debug("Applying tags")
self.downloader.apply_tags(decrypted_path, tags, cover_url)
logger.debug(f'Moving to "{final_path}"')
self.downloader.move_to_final_path(decrypted_path, final_path)
if decrypted_path:
logger.debug("Applying tags")
self.downloader.apply_tags(decrypted_path, tags, cover_url)
logger.debug(f'Moving to "{final_path}"')
self.downloader.move_to_final_path(decrypted_path, final_path)
if not self.lrc_only and self.downloader.save_playlist and playlist_metadata:
playlist_file_path = self.downloader.get_playlist_file_path(tags)
logger.debug(f'Updating M3U8 playlist from "{playlist_file_path}"')