Compare commits
No commits in common. "c822c74f42202bcf9409f49d867cf5c9e643353a" and "5b2546fdbce07ee6441737991c9198f2d3adefa4" have entirely different histories.
c822c74f42
...
5b2546fdbc
@ -75,26 +75,21 @@ app.MapGet("/Publications/GetFromConnector", (string connectorName, string title
|
|||||||
return taskManager.GetPublicationsFromConnector(connector, title);
|
return taskManager.GetPublicationsFromConnector(connector, title);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.MapGet("/Publications/GetChapters",
|
app.MapGet("/Publications/GetChapters", (string connectorName, string internalId, bool onlyNew, bool onlyExisting, string? language) =>
|
||||||
(string connectorName, string internalId, string? onlyNew, string? onlyExisting, string? language) =>
|
{
|
||||||
{
|
Connector? connector = taskManager.GetAvailableConnectors().FirstOrDefault(con => con.Key == connectorName).Value;
|
||||||
string[] yes = { "true", "yes", "1", "y" };
|
if (connector is null)
|
||||||
bool newOnly = onlyNew is not null && yes.Contains(onlyNew);
|
return Array.Empty<Chapter>();
|
||||||
bool existingOnly = onlyExisting is not null && yes.Contains(onlyExisting);
|
Publication? publication = taskManager.GetAllPublications().FirstOrDefault(pub => pub.internalId == internalId);
|
||||||
|
if (publication is null)
|
||||||
Connector? connector = taskManager.GetAvailableConnectors().FirstOrDefault(con => con.Key == connectorName).Value;
|
return Array.Empty<Chapter>();
|
||||||
if (connector is null)
|
|
||||||
return Array.Empty<Chapter>();
|
if(onlyNew)
|
||||||
Publication? publication = taskManager.GetAllPublications().FirstOrDefault(pub => pub.internalId == internalId);
|
return taskManager.GetNewChaptersList(connector, (Publication)publication, language??"en").ToArray();
|
||||||
if (publication is null)
|
else if (onlyExisting)
|
||||||
return Array.Empty<Chapter>();
|
return taskManager.GetExistingChaptersList(connector, (Publication)publication, language ?? "en").ToArray();
|
||||||
|
else
|
||||||
if(newOnly)
|
return connector.GetChapters((Publication)publication, language??"en");
|
||||||
return taskManager.GetNewChaptersList(connector, (Publication)publication, language??"en").ToArray();
|
|
||||||
else if (existingOnly)
|
|
||||||
return taskManager.GetExistingChaptersList(connector, (Publication)publication, language ?? "en").ToArray();
|
|
||||||
else
|
|
||||||
return connector.GetChapters((Publication)publication, language??"en");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.MapGet("/Tasks/GetTypes", () => Enum.GetNames(typeof(TrangaTask.Task)));
|
app.MapGet("/Tasks/GetTypes", () => Enum.GetNames(typeof(TrangaTask.Task)));
|
||||||
|
@ -454,8 +454,6 @@ blur-background {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: start;
|
justify-content: start;
|
||||||
align-content: start;
|
align-content: start;
|
||||||
max-height: 70vh;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#publicationViewerPopup{
|
#publicationViewerPopup{
|
||||||
|
Loading…
Reference in New Issue
Block a user