Skip to content

Commit

Permalink
Merge branch 'C9Glax:cuttingedge' into cuttingedge
Browse files Browse the repository at this point in the history
  • Loading branch information
db-2001 authored Apr 18, 2024
2 parents 006b71b + 8631cf6 commit 4ba44d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion Tranga/MangaConnectors/RequestType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ public enum RequestType : byte
MangaDexFeed = 1,
MangaImage = 2,
MangaCover = 3,
MangaDexAuthor = 4,
MangaDexImage = 5,
MangaInfo = 6
}
6 changes: 4 additions & 2 deletions Tranga/TrangaSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System.Runtime.InteropServices;
using System.Text.Json.Nodes;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Tranga.LibraryConnectors;
using Tranga.MangaConnectors;
Expand All @@ -19,7 +21,7 @@ public class TrangaSettings
[JsonIgnore] public string jobsFolderPath => Path.Join(workingDirectory, "jobs");
[JsonIgnore] public string coverImageCache => Path.Join(workingDirectory, "imageCache");
[JsonIgnore] internal static readonly string DefaultUserAgent = $"Tranga ({Enum.GetName(Environment.OSVersion.Platform)}; {(Environment.Is64BitOperatingSystem ? "x64" : "")}) / 1.0";
public ushort? version { get; } = 1;
public ushort? version { get; } = 2;
public bool aprilFoolsMode { get; private set; } = true;
[JsonIgnore]internal static readonly Dictionary<RequestType, int> DefaultRequestLimits = new ()
{
Expand All @@ -28,7 +30,6 @@ public class TrangaSettings
{RequestType.MangaDexImage, 40},
{RequestType.MangaImage, 60},
{RequestType.MangaCover, 250},
{RequestType.MangaDexAuthor, 250},
{RequestType.Default, 60}
};

Expand All @@ -44,6 +45,7 @@ public TrangaSettings(string? downloadLocation = null, string? workingDirectory
{//Load from settings file
FileStream lockFile = File.Create(lockFilePath,0, FileOptions.DeleteOnClose); //lock settingsfile
string settingsStr = File.ReadAllText(sfp);
settingsStr = Regex.Replace(settingsStr, @"""MangaDexAuthor"": [0-9]+,", "");//https://github.com/C9Glax/tranga/pull/161 Remove sometime in the future :3
TrangaSettings settings = JsonConvert.DeserializeObject<TrangaSettings>(settingsStr)!;
this.requestLimits = settings.requestLimits;
this.userAgent = settings.userAgent;
Expand Down

0 comments on commit 4ba44d3

Please sign in to comment.