commit
074b137b5c
2
.github/workflows/docker-image.yml
vendored
2
.github/workflows/docker-image.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
||||
- name: Build and push API
|
||||
uses: docker/build-push-action@v4.1.1
|
||||
with:
|
||||
context: ./
|
||||
context: ./API
|
||||
file: ./API/Dockerfile
|
||||
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
|
@ -3,6 +3,7 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 as build-env
|
||||
WORKDIR /src
|
||||
COPY . /src/
|
||||
RUN ls -l /src
|
||||
RUN dotnet restore /src/API/API.csproj
|
||||
RUN dotnet publish -c Release -o /publish
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class RequestHandler
|
||||
new(HttpMethod.Get, "/Tasks/Types", Array.Empty<string>()),
|
||||
new(HttpMethod.Post, "/Tasks/CreateMonitorTask",
|
||||
new[] { "connectorName", "internalId", "reoccurrenceTime", "language?" }),
|
||||
new(HttpMethod.Post, "/Tasks/CreateUpdateLibraryTask", new[] { "reoccurrenceTime" }),
|
||||
//DEPRECATED new(HttpMethod.Post, "/Tasks/CreateUpdateLibraryTask", new[] { "reoccurrenceTime" }),
|
||||
new(HttpMethod.Post, "/Tasks/CreateDownloadChaptersTask",
|
||||
new[] { "connectorName", "internalId", "chapters", "language?" }),
|
||||
new(HttpMethod.Get, "/Tasks", new[] { "taskType", "connectorName?", "publicationId?" }),
|
||||
@ -162,11 +162,11 @@ public class RequestHandler
|
||||
return;
|
||||
_taskManager.AddTask(new MonitorPublicationTask(connectorName1, (Publication)publication1, TimeSpan.Parse(reoccurrenceTime1), language1 ?? "en"));
|
||||
break;
|
||||
case "/Tasks/CreateUpdateLibraryTask":
|
||||
variables.TryGetValue("reoccurrenceTime", out string? reoccurrenceTime2);
|
||||
case "/Tasks/CreateUpdateLibraryTask": // DEPRECATED
|
||||
/*variables.TryGetValue("reoccurrenceTime", out string? reoccurrenceTime2);
|
||||
if (reoccurrenceTime2 is null)
|
||||
return;
|
||||
_taskManager.AddTask(new UpdateLibrariesTask(TimeSpan.Parse(reoccurrenceTime2)));
|
||||
_taskManager.AddTask(new UpdateLibrariesTask(TimeSpan.Parse(reoccurrenceTime2)));*/
|
||||
break;
|
||||
case "/Tasks/CreateDownloadChaptersTask":
|
||||
variables.TryGetValue("connectorName", out string? connectorName2);
|
||||
|
27
Tranga/Migrate.cs
Normal file
27
Tranga/Migrate.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Tranga;
|
||||
|
||||
public static class Migrate
|
||||
{
|
||||
private static readonly ushort CurrentVersion = 16;
|
||||
public static void Files(TrangaSettings settings)
|
||||
{
|
||||
settings.version ??= 15;
|
||||
switch (settings.version)
|
||||
{
|
||||
case 15:
|
||||
RemoveUpdateLibraryTask(settings);
|
||||
break;
|
||||
}
|
||||
|
||||
settings.version = CurrentVersion;
|
||||
settings.ExportSettings();
|
||||
}
|
||||
|
||||
private static void RemoveUpdateLibraryTask(TrangaSettings settings)
|
||||
{
|
||||
List<TrangaTask> tasks = JsonConvert.DeserializeObject<List<TrangaTask>>(settings.tasksFilePath)!;
|
||||
tasks.RemoveAll(t => t.task == TrangaTask.Task.UpdateLibraries);
|
||||
}
|
||||
}
|
@ -37,6 +37,7 @@ public class TaskManager
|
||||
};
|
||||
|
||||
this.settings = settings;
|
||||
Migrate.Files(settings);
|
||||
ImportData();
|
||||
ExportDataAndSettings();
|
||||
Thread taskChecker = new(TaskCheckerThread);
|
||||
|
@ -15,6 +15,7 @@ public class TrangaSettings
|
||||
[JsonIgnore] public string coverImageCache => Path.Join(workingDirectory, "imageCache");
|
||||
public HashSet<LibraryManager> libraryManagers { get; }
|
||||
public HashSet<NotificationManager> notificationManagers { get; }
|
||||
public ushort? version { get; set; }
|
||||
|
||||
public TrangaSettings(string downloadLocation, string workingDirectory, HashSet<LibraryManager>? libraryManagers,
|
||||
HashSet<NotificationManager>? notificationManagers)
|
||||
|
@ -3,6 +3,9 @@ using Logging;
|
||||
|
||||
namespace Tranga.TrangaTasks;
|
||||
|
||||
/// <summary>
|
||||
/// LEGACY DEPRECATED
|
||||
/// </summary>
|
||||
public class UpdateLibrariesTask : TrangaTask
|
||||
{
|
||||
public UpdateLibrariesTask(TimeSpan reoccurrence) : base(Task.UpdateLibraries, reoccurrence)
|
||||
|
Loading…
Reference in New Issue
Block a user