Merge pull request #658 from benphelps/fix-656

Fix: plex widget error with 1 library
pull/657/head
shamoon 2 years ago committed by GitHub
commit 702dbd8a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -79,7 +79,7 @@ export default async function plexProxyHandler(req, res) {
logger.debug("Getting libraries from Plex API"); logger.debug("Getting libraries from Plex API");
[status, apiData] = await fetchFromPlexAPI("/library/sections", widget); [status, apiData] = await fetchFromPlexAPI("/library/sections", widget);
if (apiData && apiData.MediaContainer) { if (apiData && apiData.MediaContainer) {
libraries = apiData.MediaContainer.Directory; libraries = [].concat(apiData.MediaContainer.Directory);
cache.put(librariesCacheKey, libraries, 1000 * 60 * 60 * 6); cache.put(librariesCacheKey, libraries, 1000 * 60 * 60 * 6);
} }
} }

Loading…
Cancel
Save