From 190f6a55962c091317887970454d0b945a5a9a4c Mon Sep 17 00:00:00 2001 From: Otiel Date: Tue, 18 Feb 2014 16:53:06 +0100 Subject: [PATCH] Fixed bug on cover art Bug occured when "Save cover art in tags" was not selected and "Save cover art in folder" was selected. The directory was not created in time to save the cover art. --- .../Windows/MainWindow.xaml.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Sources/BandcampDownloader/Windows/MainWindow.xaml.cs b/Sources/BandcampDownloader/Windows/MainWindow.xaml.cs index 7508a6e8..69d9253a 100644 --- a/Sources/BandcampDownloader/Windows/MainWindow.xaml.cs +++ b/Sources/BandcampDownloader/Windows/MainWindow.xaml.cs @@ -88,6 +88,16 @@ private void DownloadAlbum(Album album, String downloadsFolder, Boolean tagTrack return; } + // Create directory to place track files + String directoryPath = downloadsFolder + "\\" + album.Title.ToAllowedFileName() + "\\"; + try { + Directory.CreateDirectory(directoryPath); + } catch { + Log("An error occured when creating the album folder. Make sure you have " + + "the rights to write files in the folder you chose", Brushes.Red); + return; + } + // Download artwork String artworkPath = ( saveCovertArtInFolder ? downloadsFolder + "\\" + album.Title.ToAllowedFileName() : @@ -122,16 +132,6 @@ private void DownloadAlbum(Album album, String downloadsFolder, Boolean tagTrack } // Wait for download to be finished doneEvent.WaitOne(); - - // Create directory to place track files - String directoryPath = downloadsFolder + "\\" + album.Title.ToAllowedFileName() + "\\"; - try { - Directory.CreateDirectory(directoryPath); - } catch { - Log("An error occured when creating the album folder. Make sure you have " + - "the rights to write files in the folder you chose", Brushes.Red); - return; - } var artwork = new TagLib.Picture(artworkPath); // Download & tag tracks