Skip to content

Commit

Permalink
Add natural sorting to some utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Feb 20, 2017
1 parent 5e31762 commit 3a26bcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Shoko.Desktop/UserControls/FileRenameControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ void btnLoadFiles_Click(object sender, RoutedEventArgs e)

if (LoadTypeIsRandom)
{
rawVids = VM_ShokoServer.Instance.ShokoServices.RandomFileRenamePreview(udRandomFiles.Value.Value, VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList<VM_VideoLocal>();
rawVids = VM_ShokoServer.Instance.ShokoServices.RandomFileRenamePreview(udRandomFiles.Value.Value, VM_ShokoServer.Instance.CurrentUser.JMMUserID).OrderByNatural(a => a.Places.First().FilePath).CastList<VM_VideoLocal>();

/*List<int> testIDs = new List<int>();
Expand Down Expand Up @@ -644,17 +644,15 @@ void btnLoadFiles_Click(object sender, RoutedEventArgs e)
VM_AnimeGroup_User grp = frm.SelectedObject as VM_AnimeGroup_User;
foreach (VM_AnimeSeries_User ser in grp.AllAnimeSeries)
{


rawVids.AddRange(VM_ShokoServer.Instance.ShokoServices.GetVideoLocalsForAnime(ser.AniDB_ID,
VM_ShokoServer.Instance.CurrentUser.JMMUserID).Cast<VM_VideoLocal>());
VM_ShokoServer.Instance.CurrentUser.JMMUserID).OrderByNatural(a => a.Places.First().FilePath).Cast<VM_VideoLocal>());
}
}
if (frm.SelectedObject.GetType() == typeof(VM_AnimeSeries_User))
{
VM_AnimeSeries_User ser = frm.SelectedObject as VM_AnimeSeries_User;
rawVids.AddRange(VM_ShokoServer.Instance.ShokoServices.GetVideoLocalsForAnime(ser.AniDB_ID,
VM_ShokoServer.Instance.CurrentUser.JMMUserID).Cast<VM_VideoLocal>());
VM_ShokoServer.Instance.CurrentUser.JMMUserID).OrderByNatural(a => a.Places.First().FilePath).Cast<VM_VideoLocal>());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Shoko.Desktop/UserControls/FileSearchControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void btnSearch_Click(object sender, RoutedEventArgs e)
EnableDisableControls(false);

List<VM_VideoLocal> rawVids = VM_ShokoServer.Instance.ShokoServices.SearchForFiles(
(int)searchType, txtFileSearch.Text, VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList<VM_VideoLocal>();
(int)searchType, txtFileSearch.Text, VM_ShokoServer.Instance.CurrentUser.JMMUserID).OrderByNatural(a => a.Places.First().FilePath).CastList<VM_VideoLocal>();

foreach (VM_VideoLocal raw in rawVids)
FileResults.Add(raw);
Expand Down

0 comments on commit 3a26bcc

Please sign in to comment.