Website: On Download Chapters only show chapters that have not yet been downloaded

API: Added new variables to /Publications/GetChapters: onlyNew and onlyExisting. API will return only new, only existing or all chapters depending on variables.
#19
This commit is contained in:
2023-06-15 17:14:20 +02:00
parent b571bfa43d
commit 8b58e7dd13
3 changed files with 11 additions and 5 deletions

View File

@ -66,8 +66,8 @@ async function GetPublication(internalId){
return json;
}
async function GetChapters(internalId, connectorName, language){
var uri = apiUri + `/Publications/GetChapters?internalId=${internalId}&connectorName=${connectorName}&language=${language}`;
async function GetChapters(internalId, connectorName, onlyNew, language){
var uri = apiUri + `/Publications/GetChapters?internalId=${internalId}&connectorName=${connectorName}&onlyNew=${onlyNew}&language=${language}`;
let json = await GetData(uri);
return json;
}

View File

@ -154,7 +154,7 @@ function OpenDownloadChapterTaskPopup(){
selectedChapters.value = "";
chapterOutput.replaceChildren();
createDownloadChaptersTask.style.display = "block";
GetChapters(toEditId, connectorSelect.value, "en").then((json) => {
GetChapters(toEditId, connectorSelect.value, true, "en").then((json) => {
var i = 0;
json.forEach(chapter => {
var chapterDom = document.createElement("div");