Fixed: Create album metadata on import

pull/1689/head
ta264 4 years ago committed by Qstick
parent bf0617f999
commit 9714186243

@ -104,12 +104,12 @@ namespace NzbDrone.Core.Extras.Metadata
files.AddIfNotNull(ProcessArtistMetadata(consumer, artist, consumerFiles));
files.AddRange(ProcessArtistImages(consumer, artist, consumerFiles));
var albumGroups = trackFiles.GroupBy(s => Path.GetDirectoryName(s.Path)).ToList();
var albumGroups = trackFiles.GroupBy(s => s.AlbumId).ToList();
foreach (var group in albumGroups)
{
var album = _albumService.GetAlbum(group.First().AlbumId);
var albumFolder = group.Key;
var album = _albumService.GetAlbum(group.Key);
var albumFolder = Path.GetDirectoryName(group.First().Path);
files.AddIfNotNull(ProcessAlbumMetadata(consumer, artist, album, albumFolder, consumerFiles));
files.AddRange(ProcessAlbumImages(consumer, artist, album, albumFolder, consumerFiles));
@ -159,6 +159,12 @@ namespace NzbDrone.Core.Extras.Metadata
files.AddIfNotNull(ProcessArtistMetadata(consumer, artist, consumerFiles));
files.AddRange(ProcessArtistImages(consumer, artist, consumerFiles));
}
if (albumFolder.IsNotNullOrWhiteSpace())
{
files.AddIfNotNull(ProcessAlbumMetadata(consumer, artist, album, albumFolder, consumerFiles));
files.AddRange(ProcessAlbumImages(consumer, artist, album, albumFolder, consumerFiles));
}
}
_metadataFileService.Upsert(files);

Loading…
Cancel
Save