Order for track/album import aggregators

(cherry picked from commit 69f99373e56a2fca49a2be645e6640624cf12339)

Closes #4495
Closes #4496
pull/4509/head
Jendrik Weise 10 months ago committed by Bogdan
parent 2cf2ebcbb2
commit ea9b46e922

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Core.MediaFiles.TrackImport.Aggregation.Aggregators;
@ -26,8 +27,8 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Aggregation
IDiskProvider diskProvider,
Logger logger)
{
_trackAugmenters = trackAugmenters;
_albumAugmenters = albumAugmenters;
_trackAugmenters = trackAugmenters.OrderBy(a => a.Order).ToList();
_albumAugmenters = albumAugmenters.OrderBy(a => a.Order).ToList();
_diskProvider = diskProvider;
_logger = logger;
}

@ -11,6 +11,8 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Aggregation.Aggregators
{
public class AggregateFilenameInfo : IAggregate<LocalAlbumRelease>
{
public int Order => 1;
private readonly Logger _logger;
private static readonly List<Tuple<string, string>> CharsAndSeps = new List<Tuple<string, string>>

@ -4,6 +4,8 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Aggregation.Aggregators
{
public class AggregateQuality : IAggregate<LocalTrack>
{
public int Order => 1;
public LocalTrack Aggregate(LocalTrack localTrack, bool otherFiles)
{
var quality = localTrack.FileTrackInfo?.Quality;

@ -5,6 +5,8 @@ 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;

@ -2,6 +2,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Aggregation.Aggregators
{
public interface IAggregate<T>
{
int Order { get; }
T Aggregate(T item, bool otherFiles);
}
}

Loading…
Cancel
Save