diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f9af1a..a9e987ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 0.2.4.2 + +## Bug fixes + +* Fixed issue [#75](https://github.com/Otiel/BandcampDownloader/issues/75) that would prevent downloading tracks with a name with less than 3 characters. +* Fixed exponential back-off mechanism that was inactive for artwork files. + +## Improvements + +* Updated dependencies to their latest version. + # 0.2.4.1 ## Bug fixes diff --git a/README.md b/README.md index 92df3622..01e29543 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,16 @@ BandcampDownloader is a Windows application that helps downloading albums from [ ## Features -* Downloads MP3 files from Bandcamp: +* Download MP3 files from Bandcamp: * From album pages: `https://[artist].bandcamp.com/album/[album]`, * From track pages: `https://[artist].bandcamp.com/track/[track]`, * From artist pages: `https://[artist].bandcamp.com`. -* Adds ID3 tags to tracks: Album, Artist, Album Artist, Title, Track number and Year. +* Add ID3 tags to tracks: Album, Artist, Album Artist, Title, Track number and Year. * Save lyrics (if available) to ID3 tags. -* Downloads cover art and: - * Converts it to jpg, - * Resizes it, - * Saves it in tracks tags and in folder. +* Download cover art and: + * Convert it to jpg, + * Resize it, + * Save it in tracks tags and in folder. ## Screenshot diff --git a/src/BandcampDownloader/BandcampDownloader.csproj b/src/BandcampDownloader/BandcampDownloader.csproj index 50372bda..8b520c32 100644 --- a/src/BandcampDownloader/BandcampDownloader.csproj +++ b/src/BandcampDownloader/BandcampDownloader.csproj @@ -1,6 +1,6 @@  - + Debug x86 @@ -82,10 +82,13 @@ ..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll - ..\packages\Config.Net.4.11.0\lib\net452\Config.Net.dll + ..\packages\Config.Net.4.13.2\lib\net452\Config.Net.dll - - ..\packages\HtmlAgilityPack.1.8.11\lib\Net45\HtmlAgilityPack.dll + + ..\packages\Costura.Fody.3.3.2\lib\net40\Costura.dll + + + ..\packages\HtmlAgilityPack.1.9.1\lib\Net45\HtmlAgilityPack.dll ..\packages\ImageResizer.4.2.5\lib\net45\ImageResizer.dll @@ -286,10 +289,10 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + - + + @@ -93,12 +93,17 @@ - 'true' to run assembly verification on the target assembly after all weavers have been finished. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma separated list of error codes that can be safely ignored in assembly verification. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. diff --git a/src/BandcampDownloader/Properties/AssemblyInfo.cs b/src/BandcampDownloader/Properties/AssemblyInfo.cs index 4fc440e7..a8fab0db 100644 --- a/src/BandcampDownloader/Properties/AssemblyInfo.cs +++ b/src/BandcampDownloader/Properties/AssemblyInfo.cs @@ -51,6 +51,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.4.1")] -[assembly: AssemblyFileVersion("0.2.4.1")] +[assembly: AssemblyVersion("0.2.4.2")] +[assembly: AssemblyFileVersion("0.2.4.2")] [assembly: GuidAttribute("8C171C7F-9BAC-4EC0-A287-59908B48953F")] diff --git a/src/BandcampDownloader/UI/Dialogs/WindowMain.xaml.cs b/src/BandcampDownloader/UI/Dialogs/WindowMain.xaml.cs index 21ec45e6..adf87c25 100644 --- a/src/BandcampDownloader/UI/Dialogs/WindowMain.xaml.cs +++ b/src/BandcampDownloader/UI/Dialogs/WindowMain.xaml.cs @@ -306,25 +306,25 @@ private Boolean DownloadAndTagTrack(String albumDirectoryPath, Album album, Trac /// The album to download. /// The path where to save the cover art. private TagLib.Picture DownloadCoverArt(Album album, String downloadsFolder) { + String artworkFileExt = Path.GetExtension(album.ArtworkUrl); + + // In order to prevent #54 (artworkTempPath used at the same time by another downloading thread), we'll add a random number to the name of the artwork file saved in Temp directory + String randomNumber = _random.Next(1, 1000).ToString("00#"); + // Compute paths where to save artwork - String artworkTempPath = Path.GetTempPath() + "\\" + album.Title.ToAllowedFileName() + Path.GetExtension(album.ArtworkUrl); - String artworkFolderPath = downloadsFolder + "\\" + album.Title.ToAllowedFileName() + Path.GetExtension(album.ArtworkUrl); + String artworkTempPath = Path.GetTempPath() + "\\" + album.Title.ToAllowedFileName() + randomNumber + artworkFileExt; + String artworkFolderPath = downloadsFolder + "\\" + album.Title.ToAllowedFileName() + artworkFileExt; if (artworkTempPath.Length >= 260 || artworkFolderPath.Length >= 260) { // Windows doesn't do well with path + filename >= 260 characters (and path >= 248 characters) // Path has been shorten to 247 characters before, so we have 12 characters max left for filename.ext // There may be only one path needed to shorten, but it's better to use the same file name in both places - int fileNameMaxLength = 12 - Path.GetExtension(album.ArtworkUrl).ToString().Length; - artworkTempPath = Path.GetTempPath() + "\\" + album.Title.ToAllowedFileName().Substring(0, fileNameMaxLength) + Path.GetExtension(album.ArtworkUrl); - artworkFolderPath = downloadsFolder + "\\" + album.Title.ToAllowedFileName().Substring(0, fileNameMaxLength) + Path.GetExtension(album.ArtworkUrl); + int fileNameInTempMaxLength = 12 - randomNumber.Length - artworkFileExt.Length; + int fileNameInFolderMaxLength = 12 - artworkFileExt.ToString().Length; + artworkTempPath = Path.GetTempPath() + "\\" + album.Title.ToAllowedFileName().Substring(0, fileNameInTempMaxLength) + randomNumber + artworkFileExt; + artworkFolderPath = downloadsFolder + "\\" + album.Title.ToAllowedFileName().Substring(0, fileNameInFolderMaxLength) + artworkFileExt; } - // In order to prevent #54 (artworkTempPath used at the same time by another downloading thread): - // Change the name of the artwork file: replace the last 3 characters with a random number between 1-999 - String artworkFileWithoutExt = Path.GetFileNameWithoutExtension(artworkTempPath); - artworkFileWithoutExt = artworkFileWithoutExt.Remove(artworkFileWithoutExt.Length - 3, 3) + _random.Next(1, 1000).ToString("00#"); - artworkTempPath = Path.GetDirectoryName(artworkTempPath) + "\\" + artworkFileWithoutExt + Path.GetExtension(artworkTempPath); - TagLib.Picture artworkInTags = null; int tries = 0; @@ -412,7 +412,7 @@ private TagLib.Picture DownloadCoverArt(Album album, String downloadsFolder) { tries++; if (!artworkDownloaded && tries < App.UserSettings.DownloadMaxTries) { - //WaitForCooldown(tries); + WaitForCooldown(tries); } doneEvent.Set(); diff --git a/src/BandcampDownloader/packages.config b/src/BandcampDownloader/packages.config index 49055997..8ff74868 100644 --- a/src/BandcampDownloader/packages.config +++ b/src/BandcampDownloader/packages.config @@ -1,10 +1,10 @@  - - - - + + + +