Compare commits
No commits in common. "7f88e57e47bc22078451a3369cbab0306bba01de" and "4bae223d958cbc1123d545902b48186c3958da69" have entirely different histories.
7f88e57e47
...
4bae223d95
@ -1,8 +1,8 @@
|
||||
|
||||
using Logging;
|
||||
using Tranga;
|
||||
|
||||
string applicationFolderPath =
|
||||
Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Tranga-API");
|
||||
string applicationFolderPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Tranga-API");
|
||||
string logsFolderPath = Path.Join(applicationFolderPath, "logs");
|
||||
string logFilePath = Path.Join(logsFolderPath, $"log-{DateTime.Now:dd-M-yyyy-HH-mm-ss}.txt");
|
||||
string settingsFilePath = Path.Join(applicationFolderPath, "settings.json");
|
||||
@ -20,7 +20,7 @@ TrangaSettings settings;
|
||||
if (File.Exists(settingsFilePath))
|
||||
settings = TrangaSettings.LoadSettings(settingsFilePath);
|
||||
else
|
||||
settings = new TrangaSettings(Directory.GetCurrentDirectory(), applicationFolderPath, null);
|
||||
settings = new TrangaSettings(Directory.GetCurrentDirectory(), settingsFilePath, null);
|
||||
|
||||
TaskManager taskManager = new (settings, logger);
|
||||
|
||||
@ -103,8 +103,20 @@ app.MapDelete("/Queue/Dequeue", (string taskType, string? connectorName, string?
|
||||
taskManager.RemoveTaskFromQueue(task);
|
||||
});
|
||||
|
||||
app.MapGet("/Settings/Get", () => taskManager.settings);
|
||||
app.MapGet("/Settings/Get", () => new Settings(taskManager.settings));
|
||||
|
||||
app.MapPost("/Settings/Update", (string? downloadLocation, string? komgaUrl, string? komgaAuth) => taskManager.UpdateSettings(downloadLocation, komgaUrl, komgaAuth) );
|
||||
|
||||
app.Run();
|
||||
app.Run();
|
||||
|
||||
class Settings
|
||||
{
|
||||
public string downloadLocation { get; }
|
||||
public Komga? komga { get; }
|
||||
|
||||
public Settings(TrangaSettings settings)
|
||||
{
|
||||
this.downloadLocation = settings.downloadLocation;
|
||||
this.komga = settings.komga;
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ public static class Tranga_Cli
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string applicationFolderPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Tranga");
|
||||
string applicationFolderPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Tranga");
|
||||
string logsFolderPath = Path.Join(applicationFolderPath, "logs");
|
||||
string logFilePath = Path.Join(logsFolderPath, $"log-{DateTime.Now:dd-M-yyyy-HH-mm-ss}.txt");
|
||||
string settingsFilePath = Path.Join(applicationFolderPath, "settings.json");
|
||||
|
@ -213,10 +213,7 @@ public class MangaDex : Connector
|
||||
DirectoryInfo dirInfo = new (publicationFolder);
|
||||
foreach(FileInfo fileInfo in dirInfo.EnumerateFiles())
|
||||
if (fileInfo.Name.Contains("cover."))
|
||||
{
|
||||
logger?.WriteLine(this.GetType().ToString(), $"Cover exists {publication.sortName}");
|
||||
return;
|
||||
}
|
||||
|
||||
//Request information where to download Cover
|
||||
DownloadClient.RequestResult requestResult =
|
||||
|
Loading…
Reference in New Issue
Block a user