From 5e722b4d1166b50317443f0eb8d4c400dbcb9cd1 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 9 Dec 2022 22:33:26 -0800 Subject: [PATCH] Fix plex widget error with 1 library --- src/widgets/plex/proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/plex/proxy.js b/src/widgets/plex/proxy.js index 36b7a268e..b91b35338 100644 --- a/src/widgets/plex/proxy.js +++ b/src/widgets/plex/proxy.js @@ -79,7 +79,7 @@ export default async function plexProxyHandler(req, res) { logger.debug("Getting libraries from Plex API"); [status, apiData] = await fetchFromPlexAPI("/library/sections", widget); if (apiData && apiData.MediaContainer) { - libraries = apiData.MediaContainer.Directory; + libraries = [].concat(apiData.MediaContainer.Directory); cache.put(librariesCacheKey, libraries, 1000 * 60 * 60 * 6); } }