Skip to content

Commit

Permalink
Merge branch 'release-0.2.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Otiel committed Mar 8, 2019
2 parents faefaa0 + aec0036 commit e35e0e3
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 34 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 10 additions & 7 deletions src/BandcampDownloader/BandcampDownloader.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Costura.Fody.3.2.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.2.0\build\Costura.Fody.props')" />
<Import Project="..\packages\Costura.Fody.3.3.2\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.3.2\build\Costura.Fody.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down Expand Up @@ -82,10 +82,13 @@
<HintPath>..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="Config.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=d836a57afd299520, processorArchitecture=MSIL">
<HintPath>..\packages\Config.Net.4.11.0\lib\net452\Config.Net.dll</HintPath>
<HintPath>..\packages\Config.Net.4.13.2\lib\net452\Config.Net.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.8.11.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.8.11\lib\Net45\HtmlAgilityPack.dll</HintPath>
<Reference Include="Costura, Version=3.3.2.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.3.3.2\lib\net40\Costura.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.9.1.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.9.1\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="ImageResizer, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ImageResizer.4.2.5\lib\net45\ImageResizer.dll</HintPath>
Expand Down Expand Up @@ -286,10 +289,10 @@
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Costura.Fody.3.2.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.2.0\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Fody.3.3.2\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.3.3.2\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.4.0.2\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.4.0.2\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.3.3.2\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.3.3.2\build\Costura.Fody.props'))" />
</Target>
<Import Project="..\packages\Fody.3.3.2\build\Fody.targets" Condition="Exists('..\packages\Fody.3.3.2\build\Fody.targets')" />
<Import Project="..\packages\Fody.4.0.2\build\Fody.targets" Condition="Exists('..\packages\Fody.4.0.2\build\Fody.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
11 changes: 8 additions & 3 deletions src/BandcampDownloader/FodyWeavers.xsd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuild. -->
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
Expand Down Expand Up @@ -93,12 +93,17 @@
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification on the target assembly after all weavers have been finished.</xs:documentation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
Expand Down
4 changes: 2 additions & 2 deletions src/BandcampDownloader/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
24 changes: 12 additions & 12 deletions src/BandcampDownloader/UI/Dialogs/WindowMain.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,25 +306,25 @@ private Boolean DownloadAndTagTrack(String albumDirectoryPath, Album album, Trac
/// <param name="album">The album to download.</param>
/// <param name="downloadsFolder">The path where to save the cover art.</param>
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;
Expand Down Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/BandcampDownloader/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="4.3.1" targetFramework="net452" />
<package id="Config.Net" version="4.11.0" targetFramework="net452" />
<package id="Costura.Fody" version="3.2.0" targetFramework="net452" />
<package id="Fody" version="3.3.2" targetFramework="net452" developmentDependency="true" />
<package id="HtmlAgilityPack" version="1.8.11" targetFramework="net452" />
<package id="Config.Net" version="4.13.2" targetFramework="net452" />
<package id="Costura.Fody" version="3.3.2" targetFramework="net452" />
<package id="Fody" version="4.0.2" targetFramework="net452" developmentDependency="true" />
<package id="HtmlAgilityPack" version="1.9.1" targetFramework="net452" />
<package id="ImageResizer" version="4.2.5" targetFramework="net452" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net452" />
<package id="NLog" version="4.5.11" targetFramework="net452" />
Expand Down

0 comments on commit e35e0e3

Please sign in to comment.