Skip to content

Commit

Permalink
Fixed bug on cover art
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Otiel committed Feb 18, 2014
1 parent 9456ed4 commit 190f6a5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Sources/BandcampDownloader/Windows/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() :
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 190f6a5

Please sign in to comment.