Compare commits
No commits in common. "3b9d4a6735ac75a95e89a29c446f25703d9b44f1" and "190fa8cba76f8e55efa48e72837fe0f559b64d17" have entirely different histories.
3b9d4a6735
...
190fa8cba7
@ -58,24 +58,29 @@ public readonly struct Chapter : IComparable
|
|||||||
|
|
||||||
public int CompareTo(object? obj)
|
public int CompareTo(object? obj)
|
||||||
{
|
{
|
||||||
if(obj is not Chapter otherChapter)
|
if (obj is Chapter otherChapter)
|
||||||
throw new ArgumentException($"{obj} can not be compared to {this}");
|
|
||||||
|
|
||||||
if (float.TryParse(volumeNumber, GlobalBase.numberFormatDecimalPoint, out float volumeNumberFloat) &&
|
|
||||||
float.TryParse(chapterNumber, GlobalBase.numberFormatDecimalPoint, out float chapterNumberFloat) &&
|
|
||||||
float.TryParse(otherChapter.volumeNumber, GlobalBase.numberFormatDecimalPoint,
|
|
||||||
out float otherVolumeNumberFloat) &&
|
|
||||||
float.TryParse(otherChapter.chapterNumber, GlobalBase.numberFormatDecimalPoint,
|
|
||||||
out float otherChapterNumberFloat))
|
|
||||||
{
|
{
|
||||||
return volumeNumberFloat.CompareTo(otherVolumeNumberFloat) switch
|
if (float.TryParse(volumeNumber, GlobalBase.numberFormatDecimalPoint, out float volumeNumberFloat) &&
|
||||||
|
float.TryParse(chapterNumber, GlobalBase.numberFormatDecimalPoint, out float chapterNumberFloat) &&
|
||||||
|
float.TryParse(otherChapter.volumeNumber, GlobalBase.numberFormatDecimalPoint,
|
||||||
|
out float otherVolumeNumberFloat) &&
|
||||||
|
float.TryParse(otherChapter.chapterNumber, GlobalBase.numberFormatDecimalPoint,
|
||||||
|
out float otherChapterNumberFloat))
|
||||||
{
|
{
|
||||||
<0 => -1,
|
|
||||||
>0 => 1,
|
switch (volumeNumberFloat.CompareTo(otherVolumeNumberFloat))
|
||||||
_ => 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");
|
||||||
}
|
}
|
||||||
else throw new FormatException($"Value could not be parsed");
|
throw new ArgumentException($"{obj} can not be compared to {this}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -9,6 +9,7 @@ namespace Tranga.MangaConnectors;
|
|||||||
internal class ChromiumDownloadClient : DownloadClient
|
internal class ChromiumDownloadClient : DownloadClient
|
||||||
{
|
{
|
||||||
private IBrowser browser { get; set; }
|
private IBrowser browser { get; set; }
|
||||||
|
private const string ChromiumVersion = "1154303";
|
||||||
private const int StartTimeoutMs = 30000;
|
private const int StartTimeoutMs = 30000;
|
||||||
private readonly HttpDownloadClient _httpDownloadClient;
|
private readonly HttpDownloadClient _httpDownloadClient;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user