Temp commit to record attempts. Stream APIs are implemented and working. Added some new test cases based on deployed Kavita server testing.

This commit is contained in:
Joseph Milazzo 2021-03-17 14:29:50 -05:00
parent 55cd0c5fe5
commit 0a85555f38
16 changed files with 247 additions and 90 deletions

View file

@ -2,15 +2,26 @@
namespace API.Comparators
{
public class ChapterSortComparer : IComparer<int>
public class ChapterSortComparer : IComparer<float>
{
public int Compare(int x, int y)
// public int Compare(int x, int y)
// {
// if (x == 0 && y == 0) return 0;
// // if x is 0, it comes second
// if (x == 0) return 1;
// // if y is 0, it comes second
// if (y == 0) return -1;
//
// return x.CompareTo(y);
// }
public int Compare(float x, float y)
{
if (x == 0 && y == 0) return 0;
if (x == 0.0 && y == 0.0) return 0;
// if x is 0, it comes second
if (x == 0) return 1;
if (x == 0.0) return 1;
// if y is 0, it comes second
if (y == 0) return -1;
if (y == 0.0) return -1;
return x.CompareTo(y);
}