Compare commits

..

2 Commits

Author SHA1 Message Date
c822c74f42 website fix taskSelectOutput overflow issue 2023-06-15 21:16:56 +02:00
dda4054d34 API: Fix nullable bug on Getchapters 2023-06-15 21:15:44 +02:00
2 changed files with 22 additions and 15 deletions

View File

@ -75,8 +75,13 @@ app.MapGet("/Publications/GetFromConnector", (string connectorName, string title
return taskManager.GetPublicationsFromConnector(connector, title);
});
app.MapGet("/Publications/GetChapters", (string connectorName, string internalId, bool onlyNew, bool onlyExisting, string? language) =>
app.MapGet("/Publications/GetChapters",
(string connectorName, string internalId, string? onlyNew, string? onlyExisting, string? language) =>
{
string[] yes = { "true", "yes", "1", "y" };
bool newOnly = onlyNew is not null && yes.Contains(onlyNew);
bool existingOnly = onlyExisting is not null && yes.Contains(onlyExisting);
Connector? connector = taskManager.GetAvailableConnectors().FirstOrDefault(con => con.Key == connectorName).Value;
if (connector is null)
return Array.Empty<Chapter>();
@ -84,9 +89,9 @@ app.MapGet("/Publications/GetChapters", (string connectorName, string internalId
if (publication is null)
return Array.Empty<Chapter>();
if(onlyNew)
if(newOnly)
return taskManager.GetNewChaptersList(connector, (Publication)publication, language??"en").ToArray();
else if (onlyExisting)
else if (existingOnly)
return taskManager.GetExistingChaptersList(connector, (Publication)publication, language ?? "en").ToArray();
else
return connector.GetChapters((Publication)publication, language??"en");

View File

@ -454,6 +454,8 @@ blur-background {
flex-wrap: wrap;
justify-content: start;
align-content: start;
max-height: 70vh;
overflow-y: scroll;
}
#publicationViewerPopup{