1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

[WIP] Additions to custom formats, such as rescanning old files. (#2949)

This commit is contained in:
Leonardo Galli
2018-09-10 21:25:10 +02:00
committed by GitHub
parent 1059e145c3
commit b4f456d5f0
65 changed files with 1322 additions and 3766 deletions
@@ -41,9 +41,7 @@ namespace NzbDrone.Core.Qualities
public static List<int> GetIndicies(List<CustomFormat> formats, Profile profile)
{
return formats.Count > 0
? formats.Select(f => profile.FormatItems.FindIndex(v => Equals(v.Format, f))).ToList()
: new List<int> {profile.FormatItems.FindIndex(v => Equals(v.Format, CustomFormat.None))};
return formats.WithNone().Select(f => profile.FormatItems.FindIndex(v => Equals(v.Format, f))).ToList();
}
public int Compare(CustomFormat left, CustomFormat right)
@@ -56,10 +54,7 @@ namespace NzbDrone.Core.Qualities
public int Compare(List<CustomFormat> left, CustomFormat right)
{
if (left.Count == 0)
{
left.Add(CustomFormat.None);
}
left = left.WithNone();
var leftIndicies = GetIndicies(left, _profile);
var rightIndex = _profile.FormatItems.FindIndex(v => Equals(v.Format, right));