mirror of https://github.com/lidarr/Lidarr
29 lines
855 B
C#
29 lines
855 B
C#
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Core.Download;
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
namespace NzbDrone.Core.MediaFiles.TrackImport.Aggregation.Aggregators
|
|
{
|
|
public class AggregateReleaseGroup : IAggregate<LocalTrack>
|
|
{
|
|
public LocalTrack Aggregate(LocalTrack localTrack, DownloadClientItem downloadClientItem, 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;
|
|
}
|
|
}
|
|
}
|