mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-24 06:50:43 +00:00
Order for track/album import aggregators
(cherry picked from commit 69f99373e56a2fca49a2be645e6640624cf12339) Closes #4495 Closes #4496
This commit is contained in:
parent
2cf2ebcbb2
commit
ea9b46e922
5 changed files with 10 additions and 2 deletions
|
@ -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 @@ public AugmentingService(IEnumerable<IAggregate<LocalTrack>> trackAugmenters,
|
|||
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…
Reference in a new issue