diff --git a/server/api/jellyfin.ts b/server/api/jellyfin.ts index b126b55f1..de4e6b7cf 100644 --- a/server/api/jellyfin.ts +++ b/server/api/jellyfin.ts @@ -171,28 +171,25 @@ class JellyfinAPI { public async getLibraries(): Promise { try { - const account = await this.axios.get( - `/Users/${this.userId ?? 'Me'}/Views` - ); + const libraries = await this.axios.get('/Library/VirtualFolders'); - const response: JellyfinLibrary[] = account.data.Items.filter( - (Item: any) => { + const response: JellyfinLibrary[] = libraries.data + .filter((Item: any) => { return ( - Item.Type === 'CollectionFolder' && Item.CollectionType !== 'music' && Item.CollectionType !== 'books' && Item.CollectionType !== 'musicvideos' && Item.CollectionType !== 'homevideos' ); - } - ).map((Item: any) => { - return { - key: Item.Id, - title: Item.Name, - type: Item.CollectionType === 'movies' ? 'movie' : 'show', - agent: 'jellyfin', - }; - }); + }) + .map((Item: any) => { + return { + key: Item.ItemId, + title: Item.Name, + type: Item.CollectionType === 'movies' ? 'movie' : 'show', + agent: 'jellyfin', + }; + }); return response; } catch (e) {