From a99ced6b26ac1260701bd37df04992c9c752daca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Tue, 19 Oct 2021 15:38:22 +0200 Subject: [PATCH] Update: Enable folder display view only for music --- dist/plex-meets-homeassistant.js | 5 ++++- src/editor.ts | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index fb141d9..52d9307 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -20848,7 +20848,10 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { typeItems.appendChild(addDropdownItem('', '')); let typeAvailable = false; lodash.forEach(types, (sectionType) => { - if (sectionType.type !== 'track' && sectionType.type !== 'episode') { + if (sectionType.type !== 'track' && + sectionType.type !== 'episode' && + (sectionType.type !== 'folder' || + (sectionType.type === 'folder' && lodash.isEqual(lodash.get(libraryData, '[0].viewGroup'), 'artist')))) { let key = sectionType.key.split('type=')[1]; if (sectionType.type === 'folder') { key = 'folder'; diff --git a/src/editor.ts b/src/editor.ts index ba5abfa..8d5fb66 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -797,7 +797,12 @@ class PlexMeetsHomeAssistantEditor extends HTMLElement { typeItems.appendChild(addDropdownItem('', '')); let typeAvailable = false; _.forEach(types, (sectionType: Record) => { - if (sectionType.type !== 'track' && sectionType.type !== 'episode') { + if ( + sectionType.type !== 'track' && + sectionType.type !== 'episode' && + (sectionType.type !== 'folder' || + (sectionType.type === 'folder' && _.isEqual(_.get(libraryData, '[0].viewGroup'), 'artist'))) + ) { let key = sectionType.key.split('type=')[1]; if (sectionType.type === 'folder') { key = 'folder';