Next Estimated Chapter (#2342)
This commit is contained in:
parent
ca5afe94d3
commit
de9b09c71f
32 changed files with 433 additions and 73 deletions
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using API.Entities;
|
||||
using API.Entities.Enums;
|
||||
using API.Services;
|
||||
|
@ -168,6 +170,11 @@ public class ComicInfo
|
|||
info.Isbn = info.GTIN;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(info.Number))
|
||||
{
|
||||
info.Number = info.Number.Replace(",", "."); // Corrective measure for non English OSes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -176,13 +183,21 @@ public class ComicInfo
|
|||
/// <returns></returns>
|
||||
public int CalculatedCount()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Number) && float.Parse(Number) > 0)
|
||||
try
|
||||
{
|
||||
return (int) Math.Floor(float.Parse(Number));
|
||||
if (float.TryParse(Number, out var chpCount) && chpCount > 0)
|
||||
{
|
||||
return (int) Math.Floor(chpCount);
|
||||
}
|
||||
|
||||
if (float.TryParse(Volume, out var volCount) && volCount > 0)
|
||||
{
|
||||
return (int) Math.Floor(volCount);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Volume) && float.Parse(Volume) > 0)
|
||||
catch (Exception)
|
||||
{
|
||||
return Math.Max(Count, (int) Math.Floor(float.Parse(Volume)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue