Added metadata logic to use Release Year.

This commit is contained in:
Steven Hildreth 2019-02-13 15:38:49 -06:00
parent 718ab4cdc9
commit f404a41cfe
3 changed files with 32 additions and 2 deletions

View file

@ -587,5 +587,31 @@ namespace Roadie.Library.Tests
}
}
[Fact]
public void ReadID3TagsFromFile6()
{
var file = new FileInfo(@"C:\roadie_dev_root\inbound\[2016] Invention Of Knowledge\01 Invention.mp3");
if (file.Exists)
{
var tagLib = this.TagsHelper.MetaDataForFile(file.FullName);
Assert.True(tagLib.IsSuccess);
var metaData = tagLib.Data;
Assert.NotNull(metaData.Artist);
Assert.NotNull(metaData.Release);
Assert.NotNull(metaData.Title);
Assert.True(metaData.Year > 0);
Assert.NotNull(metaData.TrackNumber);
Assert.Equal(1, metaData.TrackNumber.Value);
Assert.True(metaData.TotalSeconds > 0);
Assert.True(metaData.ValidWeight > 30);
Assert.True(metaData.IsValid);
}
else
{
Console.WriteLine($"skipping { file}");
Assert.True(true);
}
}
}
}

View file

@ -327,7 +327,11 @@ namespace Roadie.Library.FilePlugins
return null;
}
this._releaseId = release.Data.RoadieId;
release.Data.ReleaseDate = SafeParser.ToDateTime(metaData.Year);
release.Data.ReleaseDate = SafeParser.ToDateTime(release.Data.ReleaseYear ?? metaData.Year);
if(release.Data.ReleaseYear.HasValue && release.Data.ReleaseYear != metaData.Year)
{
this.Logger.LogWarning($"Found Release `{ release.Data }` has different Release Year than MetaData Year `{ metaData }`");
}
return release.Data.ReleaseFileFolder(artistFolder);
}
}

View file

@ -3,7 +3,7 @@
"Roadie.Api": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5123/"
}