Fixed some nullable types

This commit is contained in:
glax 2023-05-22 21:44:52 +02:00
parent a71d65e666
commit eddf50483f
3 changed files with 8 additions and 3 deletions

View File

@ -20,6 +20,10 @@ public abstract class Connector
{ {
this.downloadLocation = downloadLocation; this.downloadLocation = downloadLocation;
this.logger = logger; this.logger = logger;
this.downloadClient = new DownloadClient(new Dictionary<byte, int>()
{
//RequestTypes for RateLimits
}, logger);
} }
public abstract string name { get; } //Name of the Connector (e.g. Website) public abstract string name { get; } //Name of the Connector (e.g. Website)
@ -219,6 +223,7 @@ public abstract class Connector
} }
catch (HttpRequestException e) catch (HttpRequestException e)
{ {
logger?.WriteLine(this.GetType().ToString(), e.Message);
Thread.Sleep(_rateLimit[requestType] * 2); Thread.Sleep(_rateLimit[requestType] * 2);
} }
} }

View File

@ -276,7 +276,7 @@ public class MangaDex : Connector
return; return;
} }
if (publication.posterUrl is null || !(bool)publication.posterUrl?.Contains("http")) if (publication.posterUrl is null || publication.posterUrl!.Contains("http"))
{ {
logger?.WriteLine(this.GetType().ToString(), $"No Poster-URL in publication"); logger?.WriteLine(this.GetType().ToString(), $"No Poster-URL in publication");
return; return;

View File

@ -25,7 +25,7 @@ public class TaskManager
/// <param name="komgaUsername">The Komga username</param> /// <param name="komgaUsername">The Komga username</param>
/// <param name="komgaPassword">The Komga password</param> /// <param name="komgaPassword">The Komga password</param>
/// <param name="logger"></param> /// <param name="logger"></param>
public TaskManager(string downloadFolderPath, string? workingDirectory = null, string? komgaBaseUrl = null, string? komgaUsername = null, string? komgaPassword = null, Logger? logger = null) public TaskManager(string downloadFolderPath, string workingDirectory, string? komgaBaseUrl = null, string? komgaUsername = null, string? komgaPassword = null, Logger? logger = null)
{ {
this.logger = logger; this.logger = logger;
_allTasks = new HashSet<TrangaTask>(); _allTasks = new HashSet<TrangaTask>();
@ -170,7 +170,7 @@ public class TaskManager
_allTasks.Add(newTask); _allTasks.Add(newTask);
} }
else else
logger.WriteLine(this.GetType().ToString(), $"Publication already exists {publication?.internalId}"); logger?.WriteLine(this.GetType().ToString(), $"Publication already exists {publication?.internalId}");
} }
logger?.WriteLine(this.GetType().ToString(), $"Added new Task {newTask.ToString()}"); logger?.WriteLine(this.GetType().ToString(), $"Added new Task {newTask.ToString()}");
ExportData(); ExportData();