From 04ae651b15f508c52e6e73599d57faafa1583a5c Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Sat, 29 Nov 2025 21:06:00 +0000 Subject: [PATCH] fix(plex): Fix library filter when media has no library --- src/backend/sources/PlexApiSource.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/sources/PlexApiSource.ts b/src/backend/sources/PlexApiSource.ts index 775198cc..ba9d710b 100644 --- a/src/backend/sources/PlexApiSource.ts +++ b/src/backend/sources/PlexApiSource.ts @@ -270,14 +270,14 @@ export default class PlexApiSource extends MemoryPositionalSource { if(state.play !== undefined) { const allowedLibraries = this.getAllowedLibraries(); - if(allowedLibraries.length > 0 && !allowedLibraries.some(x => state.play.meta.library.toLocaleLowerCase() === x.name.toLocaleLowerCase())) { + if(allowedLibraries.length > 0 && !allowedLibraries.some(x => (state.play.meta.library ?? '').toLocaleLowerCase() === x.name.toLocaleLowerCase())) { return `media not included in librariesAllow`; } if(allowedLibraries.length === 0) { const blockedLibraries = this.getBlockedLibraries(); if(blockedLibraries.length > 0) { - const blockedLibrary = blockedLibraries.find(x => state.play.meta.library.toLocaleLowerCase() === x.name.toLocaleLowerCase()); + const blockedLibrary = blockedLibraries.find(x => (state.play.meta.library ?? '').toLocaleLowerCase() === x.name.toLocaleLowerCase()); if(blockedLibrary !== undefined) { return `media included in librariesBlock '${blockedLibrary.name}'`; } @@ -286,7 +286,7 @@ export default class PlexApiSource extends MemoryPositionalSource { // this is inside this block because we SHOULD allow non-music libraries if // user specified name in librariesAllow // -- so only check for this if nothing is specified - if(!this.getValidLibraries().some(x => state.play.meta.library === x.name)) { + if(!this.getValidLibraries().some(x => (state.play.meta.library ?? '') === x.name)) { return `media not included in a valid library`; } } -- 2.51.2