Skip to content

Commit

Permalink
Merge pull request shaked6540#240 from cristianst85/fix-index-issue-w…
Browse files Browse the repository at this point in the history
…ith-playlist-video-to-audio-conversion

Fixed incorrect index in filenames when converting videos to audio
  • Loading branch information
shaked6540 authored Mar 11, 2024
2 parents 46884b5 + 8e75a5c commit b9b2589
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions YoutubePlaylistDownloader/DownloadPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ await Dispatcher.InvokeAsync(() =>

if (TagAudioFile)
{
var afterTagName = await GlobalConsts.TagFile(video, indexes[video], outputFileLoc, Playlist);
var videoIndex = indexes[video];
var afterTagName = await GlobalConsts.TagFile(video, videoIndex, outputFileLoc, Playlist);
FileType = new string(copyFileLoc.Skip(copyFileLoc.LastIndexOf('.') + 1).ToArray());
if (afterTagName != outputFileLoc)
{
Expand All @@ -425,7 +426,7 @@ await Dispatcher.InvokeAsync(() =>
video = new PlaylistVideo(playlistId.Value, video.Id, afterTagName, video.Author, video.Duration, video.Thumbnails);
}

cleanFileName = GlobalConsts.CleanFileName(downloadSettings.GetFilenameByPattern(video, i, title, Playlist));
cleanFileName = GlobalConsts.CleanFileName(downloadSettings.GetFilenameByPattern(video, videoIndex - 1, title, Playlist));
copyFileLoc = $"{SavePath}\\{cleanFileName}.{FileType}";
}
}
Expand Down

0 comments on commit b9b2589

Please sign in to comment.