mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-22 15:20:12 +01:00
[postgres-Server-V2] feat: Convert DateTime.Now calls to UtcNow
This commit is contained in:
parent
bd9e79d026
commit
45ca2695eb
@ -24,9 +24,9 @@ internal abstract class DownloadClient
|
||||
: TrangaSettings.requestLimits[requestType];
|
||||
|
||||
TimeSpan timeBetweenRequests = TimeSpan.FromMinutes(1).Divide(rateLimit);
|
||||
_lastExecutedRateLimit.TryAdd(requestType, DateTime.Now.Subtract(timeBetweenRequests));
|
||||
_lastExecutedRateLimit.TryAdd(requestType, DateTime.UtcNow.Subtract(timeBetweenRequests));
|
||||
|
||||
TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(DateTime.Now.Subtract(_lastExecutedRateLimit[requestType]));
|
||||
TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(DateTime.UtcNow.Subtract(_lastExecutedRateLimit[requestType]));
|
||||
|
||||
if (rateLimitTimeout > TimeSpan.Zero)
|
||||
{
|
||||
@ -34,7 +34,7 @@ internal abstract class DownloadClient
|
||||
}
|
||||
|
||||
RequestResult result = MakeRequestInternal(url, referrer, clickButton);
|
||||
_lastExecutedRateLimit[requestType] = DateTime.Now;
|
||||
_lastExecutedRateLimit[requestType] = DateTime.UtcNow;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,6 @@ public class DownloadMangaCoverJob(string chapterId, string? parentJobId = null,
|
||||
{
|
||||
if (!TrangaSettings.bwImages && TrangaSettings.compression == 100)
|
||||
return;
|
||||
DateTime start = DateTime.Now;
|
||||
using Image image = Image.Load(imagePath);
|
||||
File.Delete(imagePath);
|
||||
if(TrangaSettings.bwImages)
|
||||
|
@ -81,7 +81,7 @@ public class DownloadSingleChapterJob(string chapterId, string? parentJobId = nu
|
||||
{
|
||||
if (!TrangaSettings.bwImages && TrangaSettings.compression == 100)
|
||||
return;
|
||||
DateTime start = DateTime.Now;
|
||||
DateTime start = DateTime.UtcNow;
|
||||
using Image image = Image.Load(imagePath);
|
||||
File.Delete(imagePath);
|
||||
if(TrangaSettings.bwImages)
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
@ -30,6 +30,7 @@ public class Manga
|
||||
public float IgnoreChapterBefore { get; internal set; }
|
||||
|
||||
public string MangaConnectorId { get; private set; }
|
||||
|
||||
public MangaConnector? MangaConnector { get; private set; }
|
||||
|
||||
public ICollection<Author>? Authors { get; internal set; }
|
||||
|
@ -97,7 +97,7 @@ public class Bato : MangaConnector
|
||||
if (!uint.TryParse(
|
||||
document.DocumentNode.SelectSingleNode("//span[text()='Original Publication:']/..").LastChild.InnerText.Split('-')[0],
|
||||
out uint year))
|
||||
year = (uint)DateTime.Now.Year;
|
||||
year = (uint)DateTime.UtcNow.Year;
|
||||
|
||||
string status = document.DocumentNode.SelectSingleNode("//span[text()='Original Publication:']/..")
|
||||
.ChildNodes[2].InnerText;
|
||||
|
@ -127,7 +127,7 @@ public class MangaKatana : MangaConnector
|
||||
while (description.StartsWith('\n'))
|
||||
description = description.Substring(1);
|
||||
|
||||
uint year = (uint)DateTime.Now.Year;
|
||||
uint year = (uint)DateTime.UtcNow.Year;
|
||||
string yearString = infoTable.Descendants("div").First(d => d.HasClass("updateAt"))
|
||||
.InnerText.Split('-')[^1];
|
||||
|
||||
|
@ -43,7 +43,7 @@ public static class Tranga
|
||||
if (notifications.Any())
|
||||
{
|
||||
DateTime max = notifications.MaxBy(n => n.Date)!.Date;
|
||||
if (DateTime.Now.Subtract(max) > TrangaSettings.NotificationUrgencyDelay(urgency))
|
||||
if (DateTime.UtcNow.Subtract(max) > TrangaSettings.NotificationUrgencyDelay(urgency))
|
||||
{
|
||||
foreach (NotificationConnector notificationConnector in context.NotificationConnectors)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user