Fixed: Quality Profile group order no longer used when ordering results

pull/2/head
Qstick 4 years ago
parent ab7bb610a6
commit 0800029713

@ -52,7 +52,6 @@ namespace NzbDrone.Core.Test.Qualities
}
[Test]
[Ignore("Doesn't work")]
public void init_should_remove_old_definitions()
{
Mocker.GetMock<IQualityDefinitionRepository>()

@ -38,12 +38,12 @@ namespace NzbDrone.Core.Profiles
return lastAllowed.Items.Last().Quality;
}
public QualityIndex GetIndex(Quality quality)
public QualityIndex GetIndex(Quality quality, bool respectGroupOrder = false)
{
return GetIndex(quality.Id);
return GetIndex(quality.Id, respectGroupOrder);
}
public QualityIndex GetIndex(int id)
public QualityIndex GetIndex(int id, bool respectGroupOrder = false)
{
for (var i = 0; i < Items.Count; i++)
{
@ -68,7 +68,7 @@ namespace NzbDrone.Core.Profiles
if (groupItem.Quality.Id == id)
{
return new QualityIndex(i, g);
return respectGroupOrder ? new QualityIndex(i, g) : new QualityIndex(i);
}
}
}

@ -31,8 +31,8 @@ namespace NzbDrone.Core.Qualities
public int Compare(Quality left, Quality right, bool respectGroupOrder)
{
var leftIndex = _profile.GetIndex(left);
var rightIndex = _profile.GetIndex(right);
var leftIndex = _profile.GetIndex(left, respectGroupOrder);
var rightIndex = _profile.GetIndex(right, respectGroupOrder);
return leftIndex.CompareTo(rightIndex, respectGroupOrder);
}

Loading…
Cancel
Save