Sort episodes by column beneath their parents

This commit is contained in:
Mbucari 2023-04-02 21:28:55 -06:00
parent 69918c2587
commit 2248d7b24e
2 changed files with 4 additions and 4 deletions

View File

@ -70,9 +70,9 @@ namespace LibationAvalonia.ViewModels
return InternalCompare(parentA, geB); return InternalCompare(parentA, geB);
} }
//both are children of the same series, always present in order of series index, ascending //both are children of the same series
if (parentA == parentB) if (parentA == parentB)
return geA.SeriesIndex.CompareTo(geB.SeriesIndex) * (sortDirection is ListSortDirection.Ascending ? 1 : -1); return InternalCompare(geA, geB);
//a and b are children of different series. //a and b are children of different series.
return InternalCompare(parentA, parentB); return InternalCompare(parentA, parentB);

View File

@ -201,8 +201,8 @@ namespace LibationWinForms.GridView
{ {
var pIndex = itemsList.IndexOf(parent); var pIndex = itemsList.IndexOf(parent);
//children should always be sorted by series index. //children are sorted beneath their series parent
foreach (var c in children.Where(c => c.Parent == parent).OrderBy(c => c.SeriesIndex)) foreach (var c in children.Where(c => c.Parent == parent).OrderBy(c => c, Comparer))
itemsList.Insert(++pIndex, c); itemsList.Insert(++pIndex, c);
} }
} }