Compare commits
4 Commits
7ff9ac53ee
...
a94186455b
Author | SHA1 | Date | |
---|---|---|---|
a94186455b | |||
7d3deee74c | |||
5980b64caa | |||
cbecb257ef |
@ -58,8 +58,9 @@ public readonly struct Chapter : IComparable
|
||||
|
||||
public int CompareTo(object? obj)
|
||||
{
|
||||
if (obj is Chapter otherChapter)
|
||||
{
|
||||
if(obj is not 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,
|
||||
@ -67,21 +68,15 @@ public readonly struct Chapter : IComparable
|
||||
float.TryParse(otherChapter.chapterNumber, GlobalBase.numberFormatDecimalPoint,
|
||||
out float otherChapterNumberFloat))
|
||||
{
|
||||
|
||||
switch (volumeNumberFloat.CompareTo(otherVolumeNumberFloat))
|
||||
return volumeNumberFloat.CompareTo(otherVolumeNumberFloat) switch
|
||||
{
|
||||
case < 0:
|
||||
return -1;
|
||||
case > 0:
|
||||
return 1;
|
||||
default:
|
||||
return chapterNumberFloat.CompareTo(otherChapterNumberFloat);
|
||||
}
|
||||
<0 => -1,
|
||||
>0 => 1,
|
||||
_ => 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
|
||||
|
@ -9,7 +9,6 @@ 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user