You can now send emails if you don't use Authentication (#2718)
This commit is contained in:
parent
2d81527bd1
commit
7b7609652c
42 changed files with 414 additions and 350 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue