Compare commits

..

No commits in common. "b0642d12511105aa51cc6c5337a0f5db8198db7f" and "c436389426aa9c68c8ee9fd613f7072dc2c73c36" have entirely different histories.

4 changed files with 5 additions and 15 deletions

View File

@ -6,9 +6,9 @@ COPY . /src/
RUN dotnet restore Tranga-API/Tranga-API.csproj RUN dotnet restore Tranga-API/Tranga-API.csproj
RUN dotnet publish -c Release -o /publish RUN dotnet publish -c Release -o /publish
#FROM mcr.microsoft.com/dotnet/aspnet:7.0 as runtime FROM mcr.microsoft.com/dotnet/aspnet:7.0 as runtime
FROM glax/tranga-base:latest as runtime
WORKDIR /publish WORKDIR /publish
COPY --from=build-env /publish . COPY --from=build-env /publish .
EXPOSE 80 EXPOSE 80
RUN apt-get update && apt-get install -y libx11-6 libx11-xcb1 libatk1.0-0 libgtk-3-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 libxshmfence1 libnss3
ENTRYPOINT ["dotnet", "/publish/Tranga-API.dll"] ENTRYPOINT ["dotnet", "/publish/Tranga-API.dll"]

View File

@ -1,4 +0,0 @@
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/aspnet:7.0 as runtime
WORKDIR /publish
RUN apt-get update && apt-get install -y libx11-6 libx11-xcb1 libatk1.0-0 libgtk-3-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 libxshmfence1 libnss3

View File

@ -74,7 +74,7 @@ app.MapGet("/Tasks/GetTaskTypes", () => Enum.GetNames(typeof(TrangaTask.Task)));
app.MapPost("/Tasks/Create", (string taskType, string? connectorName, string? internalId, string reoccurrenceTime, string? language) => app.MapPost("/Tasks/Create", (string taskType, string? connectorName, string? internalId, string reoccurrenceTime, string? language) =>
{ {
TrangaTask.Task task = Enum.Parse<TrangaTask.Task>(taskType); TrangaTask.Task task = Enum.Parse<TrangaTask.Task>(taskType);
taskManager.AddTask(task, connectorName, internalId, TimeSpan.Parse(reoccurrenceTime), language); taskManager.AddTask(task, connectorName, internalId, TimeSpan.Parse(reoccurrenceTime), language??"");
}); });
app.MapDelete("/Tasks/Delete", (string taskType, string? connectorName, string? publicationId) => app.MapDelete("/Tasks/Delete", (string taskType, string? connectorName, string? publicationId) =>

View File

@ -190,14 +190,8 @@ public class TaskManager
newTask = new UpdateLibrariesTask(taskType, reoccurrenceTime); newTask = new UpdateLibrariesTask(taskType, reoccurrenceTime);
break; break;
case TrangaTask.Task.DownloadNewChapters: case TrangaTask.Task.DownloadNewChapters:
if (connectorName is null)
logger?.WriteLine(this.GetType().ToString(), $"Value connectorName can not be null.");
if(internalId is null)
logger?.WriteLine(this.GetType().ToString(), $"Value internalId can not be null.");
if(language is null)
logger?.WriteLine(this.GetType().ToString(), $"Value language can not be null.");
if(connectorName is null || internalId is null || language is null) if(connectorName is null || internalId is null || language is null)
return null; logger?.WriteLine(this.GetType().ToString(), $"Values connectorName, publicationName and language can not be null.");
GetConnector(connectorName); //Check if connectorName is valid GetConnector(connectorName); //Check if connectorName is valid
Publication publication = GetAllPublications().First(pub => pub.internalId == internalId); Publication publication = GetAllPublications().First(pub => pub.internalId == internalId);
newTask = new DownloadNewChaptersTask(taskType, connectorName!, publication, reoccurrenceTime, language!); newTask = new DownloadNewChaptersTask(taskType, connectorName!, publication, reoccurrenceTime, language!);