ReShaper cleanup,
Remove unnecessary using directives
This commit is contained in:
parent
a809b7c285
commit
3b542c04f6
@ -1,5 +1,4 @@
|
|||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Net;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
@ -20,7 +19,7 @@ public abstract class Connector
|
|||||||
|
|
||||||
protected readonly Logger? logger;
|
protected readonly Logger? logger;
|
||||||
|
|
||||||
protected readonly string imageCachePath;
|
private readonly string _imageCachePath;
|
||||||
|
|
||||||
protected Connector(string downloadLocation, string imageCachePath, Logger? logger)
|
protected Connector(string downloadLocation, string imageCachePath, Logger? logger)
|
||||||
{
|
{
|
||||||
@ -30,9 +29,9 @@ public abstract class Connector
|
|||||||
{
|
{
|
||||||
//RequestTypes for RateLimits
|
//RequestTypes for RateLimits
|
||||||
}, logger);
|
}, logger);
|
||||||
this.imageCachePath = imageCachePath;
|
this._imageCachePath = imageCachePath;
|
||||||
if (!Directory.Exists(imageCachePath))
|
if (!Directory.Exists(imageCachePath))
|
||||||
Directory.CreateDirectory(this.imageCachePath);
|
Directory.CreateDirectory(this._imageCachePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract string name { get; } //Name of the Connector (e.g. Website)
|
public abstract string name { get; } //Name of the Connector (e.g. Website)
|
||||||
@ -233,6 +232,7 @@ public abstract class Connector
|
|||||||
/// <param name="comicInfoPath">Path of the generate Chapter ComicInfo.xml, if it was generated</param>
|
/// <param name="comicInfoPath">Path of the generate Chapter ComicInfo.xml, if it was generated</param>
|
||||||
/// <param name="requestType">RequestType for RateLimits</param>
|
/// <param name="requestType">RequestType for RateLimits</param>
|
||||||
/// <param name="referrer">Used in http request header</param>
|
/// <param name="referrer">Used in http request header</param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
protected bool DownloadChapterImages(string[] imageUrls, string saveArchiveFilePath, byte requestType, DownloadChapterTask parentTask, string? comicInfoPath = null, string? referrer = null, CancellationToken? cancellationToken = null)
|
protected bool DownloadChapterImages(string[] imageUrls, string saveArchiveFilePath, byte requestType, DownloadChapterTask parentTask, string? comicInfoPath = null, string? referrer = null, CancellationToken? cancellationToken = null)
|
||||||
{
|
{
|
||||||
if (cancellationToken?.IsCancellationRequested??false)
|
if (cancellationToken?.IsCancellationRequested??false)
|
||||||
@ -279,7 +279,7 @@ public abstract class Connector
|
|||||||
{
|
{
|
||||||
string[] split = url.Split('/');
|
string[] split = url.Split('/');
|
||||||
string filename = split[^1];
|
string filename = split[^1];
|
||||||
string saveImagePath = Path.Join(imageCachePath, filename);
|
string saveImagePath = Path.Join(_imageCachePath, filename);
|
||||||
|
|
||||||
if (File.Exists(saveImagePath))
|
if (File.Exists(saveImagePath))
|
||||||
return filename;
|
return filename;
|
||||||
@ -301,7 +301,8 @@ public abstract class Connector
|
|||||||
|
|
||||||
private readonly Dictionary<byte, DateTime> _lastExecutedRateLimit;
|
private readonly Dictionary<byte, DateTime> _lastExecutedRateLimit;
|
||||||
private readonly Dictionary<byte, TimeSpan> _rateLimit;
|
private readonly Dictionary<byte, TimeSpan> _rateLimit;
|
||||||
private Logger? logger;
|
// ReSharper disable once InconsistentNaming
|
||||||
|
private readonly Logger? logger;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a httpClient
|
/// Creates a httpClient
|
||||||
|
@ -23,6 +23,7 @@ public abstract class LibraryManager
|
|||||||
/// <param name="baseUrl">Base-URL of Komga instance, no trailing slashes(/)</param>
|
/// <param name="baseUrl">Base-URL of Komga instance, no trailing slashes(/)</param>
|
||||||
/// <param name="auth">Base64 string of username and password (username):(password)</param>
|
/// <param name="auth">Base64 string of username and password (username):(password)</param>
|
||||||
/// <param name="logger"></param>
|
/// <param name="logger"></param>
|
||||||
|
/// <param name="libraryType"></param>
|
||||||
protected LibraryManager(string baseUrl, string auth, Logger? logger, LibraryType libraryType)
|
protected LibraryManager(string baseUrl, string auth, Logger? logger, LibraryType libraryType)
|
||||||
{
|
{
|
||||||
this.baseUrl = baseUrl;
|
this.baseUrl = baseUrl;
|
||||||
|
@ -7,8 +7,8 @@ namespace Tranga;
|
|||||||
|
|
||||||
public abstract class NotificationManager
|
public abstract class NotificationManager
|
||||||
{
|
{
|
||||||
protected Logger? logger;
|
protected readonly Logger? logger;
|
||||||
public NotificationManagerType notificationManagerType { get; }
|
public NotificationManagerType notificationManagerType;
|
||||||
|
|
||||||
protected NotificationManager(NotificationManagerType notificationManagerType, Logger? logger = null)
|
protected NotificationManager(NotificationManagerType notificationManagerType, Logger? logger = null)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.Globalization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
using Logging;
|
using Logging;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using Logging;
|
using Logging;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Tranga.TrangaTasks;
|
namespace Tranga.TrangaTasks;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user