You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
818 B
30 lines
818 B
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
namespace NzbDrone.Core.MediaFiles.TrackImport.Aggregation.Aggregators
|
|
{
|
|
public class AggregateReleaseGroup : IAggregate<LocalTrack>
|
|
{
|
|
public int Order => 1;
|
|
|
|
public LocalTrack Aggregate(LocalTrack localTrack, bool otherFiles)
|
|
{
|
|
var releaseGroup = localTrack.DownloadClientAlbumInfo?.ReleaseGroup;
|
|
|
|
if (releaseGroup.IsNullOrWhiteSpace())
|
|
{
|
|
releaseGroup = localTrack.FolderAlbumInfo?.ReleaseGroup;
|
|
}
|
|
|
|
if (releaseGroup.IsNullOrWhiteSpace())
|
|
{
|
|
releaseGroup = localTrack.FileTrackInfo?.ReleaseGroup;
|
|
}
|
|
|
|
localTrack.ReleaseGroup = releaseGroup;
|
|
|
|
return localTrack;
|
|
}
|
|
}
|
|
}
|