Add: Support for folders in getSectionDataWithoutProcessing

pull/52/head
Juraj Nyíri 3 years ago
parent 6152c3b359
commit 8a888ac0fd

@ -18863,11 +18863,21 @@ class Plex {
}; };
this.getSectionDataWithoutProcessing = async (sectionID, type = false) => { this.getSectionDataWithoutProcessing = async (sectionID, type = false) => {
const bulkItems = 50; const bulkItems = 50;
let url = this.authorizeURL(`${this.getBasicURL()}/library/sections/${sectionID}/all`); let url = `${this.getBasicURL()}/library/sections/${sectionID}`;
url += `&sort=${this.sort}`;
if (type) { if (type) {
url += `&type=${type}`; if (lodash.isEqual(type, 'folder')) {
url += `/folder`;
}
else {
url += `/all`;
url += `?type=${type}`;
}
} }
else {
url += `/all`;
}
url = this.authorizeURL(url);
url += `&sort=${this.sort}`;
url += `&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1`; url += `&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1`;
let result = {}; let result = {};
try { try {

@ -259,11 +259,19 @@ class Plex {
private getSectionDataWithoutProcessing = async (sectionID: string, type: string | false = false): Promise<any> => { private getSectionDataWithoutProcessing = async (sectionID: string, type: string | false = false): Promise<any> => {
const bulkItems = 50; const bulkItems = 50;
let url = this.authorizeURL(`${this.getBasicURL()}/library/sections/${sectionID}/all`); let url = `${this.getBasicURL()}/library/sections/${sectionID}`;
url += `&sort=${this.sort}`;
if (type) { if (type) {
url += `&type=${type}`; if (_.isEqual(type, 'folder')) {
url += `/folder`;
} else {
url += `/all`;
url += `?type=${type}`;
}
} else {
url += `/all`;
} }
url = this.authorizeURL(url);
url += `&sort=${this.sort}`;
url += `&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1`; url += `&includeCollections=1&includeExternalMedia=1&includeAdvanced=1&includeMeta=1`;
let result: Record<string, any> = {}; let result: Record<string, any> = {};
try { try {

Loading…
Cancel
Save