2
0

Compare commits

..

No commits in common. "a94186455b44071a6c005548b02e1c2dd622db85" and "7ff9ac53ee43fa8c1ac896b8eebaacc650aa13be" have entirely different histories.

2 changed files with 21 additions and 15 deletions

View File

@ -58,9 +58,8 @@ public readonly struct Chapter : IComparable
public int CompareTo(object? obj)
{
if(obj is not Chapter otherChapter)
throw new ArgumentException($"{obj} can not be compared to {this}");
if (obj is Chapter otherChapter)
{
if (float.TryParse(volumeNumber, GlobalBase.numberFormatDecimalPoint, out float volumeNumberFloat) &&
float.TryParse(chapterNumber, GlobalBase.numberFormatDecimalPoint, out float chapterNumberFloat) &&
float.TryParse(otherChapter.volumeNumber, GlobalBase.numberFormatDecimalPoint,
@ -68,15 +67,21 @@ public readonly struct Chapter : IComparable
float.TryParse(otherChapter.chapterNumber, GlobalBase.numberFormatDecimalPoint,
out float otherChapterNumberFloat))
{
return volumeNumberFloat.CompareTo(otherVolumeNumberFloat) switch
switch (volumeNumberFloat.CompareTo(otherVolumeNumberFloat))
{
<0 => -1,
>0 => 1,
_ => chapterNumberFloat.CompareTo(otherChapterNumberFloat)
};
case < 0:
return -1;
case > 0:
return 1;
default:
return chapterNumberFloat.CompareTo(otherChapterNumberFloat);
}
}
else throw new FormatException($"Value could not be parsed");
}
throw new ArgumentException($"{obj} can not be compared to {this}");
}
/// <summary>
/// Checks if a chapter-archive is already present

View File

@ -9,6 +9,7 @@ namespace Tranga.MangaConnectors;
internal class ChromiumDownloadClient : DownloadClient
{
private IBrowser browser { get; set; }
private const string ChromiumVersion = "1154303";
private const int StartTimeoutMs = 30000;
private readonly HttpDownloadClient _httpDownloadClient;