mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 06:15:25 -04:00
You can now send emails if you don't use Authentication (#2718)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using API.Services.Tasks.Scanner.Parser;
|
||||
|
||||
namespace API.Comparators;
|
||||
|
||||
@@ -17,11 +18,11 @@ public class ChapterSortComparer : IComparer<double>
|
||||
/// <returns></returns>
|
||||
public int Compare(double x, double y)
|
||||
{
|
||||
if (x == 0.0 && y == 0.0) return 0;
|
||||
if (x == Parser.DefaultChapterNumber && y == Parser.DefaultChapterNumber) return 0;
|
||||
// if x is 0, it comes second
|
||||
if (x == 0.0) return 1;
|
||||
if (x == Parser.DefaultChapterNumber) return 1;
|
||||
// if y is 0, it comes second
|
||||
if (y == 0.0) return -1;
|
||||
if (y == Parser.DefaultChapterNumber) return -1;
|
||||
|
||||
return x.CompareTo(y);
|
||||
}
|
||||
@@ -40,11 +41,11 @@ public class ChapterSortComparerZeroFirst : IComparer<double>
|
||||
{
|
||||
public int Compare(double x, double y)
|
||||
{
|
||||
if (x == 0.0 && y == 0.0) return 0;
|
||||
if (x == Parser.DefaultChapterNumber && y == Parser.DefaultChapterNumber) return 0;
|
||||
// if x is 0, it comes first
|
||||
if (x == 0.0) return -1;
|
||||
if (x == Parser.DefaultChapterNumber) return -1;
|
||||
// if y is 0, it comes first
|
||||
if (y == 0.0) return 1;
|
||||
if (y == Parser.DefaultChapterNumber) return 1;
|
||||
|
||||
return x.CompareTo(y);
|
||||
}
|
||||
@@ -56,11 +57,11 @@ public class SortComparerZeroLast : IComparer<double>
|
||||
{
|
||||
public int Compare(double x, double y)
|
||||
{
|
||||
if (x == 0.0 && y == 0.0) return 0;
|
||||
if (x == Parser.DefaultChapterNumber && y == Parser.DefaultChapterNumber) return 0;
|
||||
// if x is 0, it comes last
|
||||
if (x == 0.0) return 1;
|
||||
if (x == Parser.DefaultChapterNumber) return 1;
|
||||
// if y is 0, it comes last
|
||||
if (y == 0.0) return -1;
|
||||
if (y == Parser.DefaultChapterNumber) return -1;
|
||||
|
||||
return x.CompareTo(y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user