renamed wrong variable names publicationId -> internalId
This commit is contained in:
parent
5099e25f3f
commit
c436389426
@ -71,10 +71,10 @@ app.MapGet("/Tranga/GetPublicationsFromConnector", (string connectorName, string
|
||||
app.MapGet("/Tasks/GetTaskTypes", () => Enum.GetNames(typeof(TrangaTask.Task)));
|
||||
|
||||
|
||||
app.MapPost("/Tasks/Create", (string taskType, string? connectorName, string? publicationId, 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);
|
||||
taskManager.AddTask(task, connectorName, publicationId, TimeSpan.Parse(reoccurrenceTime), language??"");
|
||||
taskManager.AddTask(task, connectorName, internalId, TimeSpan.Parse(reoccurrenceTime), language??"");
|
||||
});
|
||||
|
||||
app.MapDelete("/Tasks/Delete", (string taskType, string? connectorName, string? publicationId) =>
|
||||
|
@ -180,7 +180,7 @@ public class TaskManager
|
||||
_allTasks.Remove(removeTask);
|
||||
}
|
||||
|
||||
public TrangaTask? AddTask(TrangaTask.Task taskType, string? connectorName, string? publicationId,
|
||||
public TrangaTask? AddTask(TrangaTask.Task taskType, string? connectorName, string? internalId,
|
||||
TimeSpan reoccurrenceTime, string? language = "en")
|
||||
{
|
||||
TrangaTask? newTask = null;
|
||||
@ -190,10 +190,10 @@ public class TaskManager
|
||||
newTask = new UpdateLibrariesTask(taskType, reoccurrenceTime);
|
||||
break;
|
||||
case TrangaTask.Task.DownloadNewChapters:
|
||||
if(connectorName is null || publicationId is null || language is null)
|
||||
if(connectorName is null || internalId is null || language is null)
|
||||
logger?.WriteLine(this.GetType().ToString(), $"Values connectorName, publicationName and language can not be null.");
|
||||
GetConnector(connectorName); //Check if connectorName is valid
|
||||
Publication publication = GetAllPublications().First(pub => pub.internalId == publicationId);
|
||||
Publication publication = GetAllPublications().First(pub => pub.internalId == internalId);
|
||||
newTask = new DownloadNewChaptersTask(taskType, connectorName!, publication, reoccurrenceTime, language!);
|
||||
break;
|
||||
}
|
||||
|
@ -89,8 +89,8 @@ async function GetKomgaTask(){
|
||||
return json;
|
||||
}
|
||||
|
||||
function CreateTask(taskType, reoccurrence, connectorName, publicationId, language){
|
||||
var uri = apiUri + `/Tasks/Create?taskType=${taskType}&connectorName=${connectorName}&publicationId=${publicationId}&reoccurrenceTime=${reoccurrence}&language=${language}`;
|
||||
function CreateTask(taskType, reoccurrence, connectorName, internalId, language){
|
||||
var uri = apiUri + `/Tasks/Create?taskType=${taskType}&connectorName=${connectorName}&internalId=${internalId}&reoccurrenceTime=${reoccurrence}&language=${language}`;
|
||||
PostData(uri);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user