Skip to content

Commit

Permalink
fix remuxed_path error
Browse files Browse the repository at this point in the history
  • Loading branch information
glomatico committed Sep 25, 2024
1 parent 21133a8 commit 516b69d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion votify/downloader_episode.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def _download(
cover_path = self.get_cover_path(final_path)
cover_url = self.downloader.get_cover_url(episode_metadata)
decrypted_path = None
remuxed_path = None
if final_path.exists() and not self.downloader.overwrite:
logger.warning(f'Track already exists at "{final_path}", skipping')
else:
Expand Down Expand Up @@ -147,10 +148,15 @@ def _download(
decrypted_path,
remuxed_path,
)
media_temp_path = (
remuxed_path
if remuxed_path is not None and remuxed_path.exists()
else decrypted_path
)
self.downloader._final_processing(
cover_path,
cover_url,
remuxed_path if remuxed_path.exists() else decrypted_path,
media_temp_path,
final_path,
tags,
playlist_metadata,
Expand Down
8 changes: 7 additions & 1 deletion votify/downloader_song.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def _download(
cover_path = self.get_cover_path(final_path)
cover_url = self.downloader.get_cover_url(album_metadata)
decrypted_path = None
remuxed_path = None
if self.lrc_only:
pass
elif final_path.exists() and not self.downloader.overwrite:
Expand Down Expand Up @@ -243,10 +244,15 @@ def _download(
else:
logger.debug(f'Saving synced lyrics to "{lrc_path}"')
self.downloader.save_lrc(lrc_path, lyrics.synced)
media_temp_path = (
remuxed_path
if remuxed_path is not None and remuxed_path.exists()
else decrypted_path
)
self.downloader._final_processing(
cover_path,
cover_url,
remuxed_path if remuxed_path.exists() else decrypted_path,
media_temp_path,
final_path,
tags,
playlist_metadata,
Expand Down

0 comments on commit 516b69d

Please sign in to comment.