From ba82ecec5c994e79d7c9b658372041522b58a120 Mon Sep 17 00:00:00 2001 From: Fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Fri, 16 Dec 2022 16:23:32 +0500 Subject: [PATCH 1/2] feat(api): adds support for Mixed Libraries Adds support for mixed libraries with movies and show types fix #95 --- server/api/jellyfin.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/api/jellyfin.ts b/server/api/jellyfin.ts index 8718f2296..8c97da8b4 100644 --- a/server/api/jellyfin.ts +++ b/server/api/jellyfin.ts @@ -177,11 +177,7 @@ class JellyfinAPI { const response: JellyfinLibrary[] = account.data.Items.filter( (Item: any) => { - return ( - Item.Type === 'CollectionFolder' && - (Item.CollectionType === 'tvshows' || - Item.CollectionType === 'movies') - ); + return Item.Type === 'CollectionFolder'; } ).map((Item: any) => { return { @@ -205,7 +201,7 @@ class JellyfinAPI { public async getLibraryContents(id: string): Promise { try { const contents = await this.axios.get( - `/Users/${this.userId}/Items?SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series,Movie&Recursive=true&StartIndex=0&ParentId=${id}` + `/Users/${this.userId}/Items?SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series,Movie,Others&Recursive=true&StartIndex=0&ParentId=${id}` ); return contents.data.Items.filter( From d9ca3c6e52c118698ca71021217f6ca409e71974 Mon Sep 17 00:00:00 2001 From: Fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Date: Fri, 16 Dec 2022 20:19:03 +0500 Subject: [PATCH 2/2] fix(api): ignore Music,Books,Photos,MusicVideo libraries Ignores libraries other than tvshows,movies,others --- server/api/jellyfin.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/api/jellyfin.ts b/server/api/jellyfin.ts index 8c97da8b4..b126b55f1 100644 --- a/server/api/jellyfin.ts +++ b/server/api/jellyfin.ts @@ -177,7 +177,13 @@ class JellyfinAPI { const response: JellyfinLibrary[] = account.data.Items.filter( (Item: any) => { - return Item.Type === 'CollectionFolder'; + return ( + Item.Type === 'CollectionFolder' && + Item.CollectionType !== 'music' && + Item.CollectionType !== 'books' && + Item.CollectionType !== 'musicvideos' && + Item.CollectionType !== 'homevideos' + ); } ).map((Item: any) => { return {