Skip to content

Commit

Permalink
revert(jellyfinapi): reverts #450 as it broke library sync support fo…
Browse files Browse the repository at this point in the history
…r local accounts using LDAP

Reverted #450 which addressed the issue where the automatic grouping enabled libraries were not
functioning correctly. The previous fix inadvertently caused a bug for Jellyfin LDAP users,
preventing library syncing with a 401 error. Reverting this change temporarily until support for
automatic library grouping can be re-implemented

fix #489
  • Loading branch information
Fallenbagel committed Nov 6, 2023
1 parent 506ea92 commit b5acc09
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions server/api/jellyfin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,25 +171,31 @@ class JellyfinAPI {

public async getLibraries(): Promise<JellyfinLibrary[]> {
try {
const libraries = await this.axios.get<any>('/Library/VirtualFolders');
// TODO: Try to fix automatic grouping without fucking up LDAP users
// const libraries = await this.axios.get<any>('/Library/VirtualFolders');

const response: JellyfinLibrary[] = libraries.data
.filter((Item: any) => {
const account = await this.axios.get<any>(
`/Users/${this.userId ?? 'Me'}/Views`
);

const response: JellyfinLibrary[] = account.data.Items.filter(
(Item: any) => {
return (
Item.Type === 'CollectionFolder' &&
Item.CollectionType !== 'music' &&
Item.CollectionType !== 'books' &&
Item.CollectionType !== 'musicvideos' &&
Item.CollectionType !== 'homevideos'
);
})
.map((Item: any) => {
return <JellyfinLibrary>{
key: Item.ItemId,
title: Item.Name,
type: Item.CollectionType === 'movies' ? 'movie' : 'show',
agent: 'jellyfin',
};
});
}
).map((Item: any) => {
return <JellyfinLibrary>{
key: Item.Id,
title: Item.Name,
type: Item.CollectionType === 'movies' ? 'movie' : 'show',
agent: 'jellyfin',
};
});

return response;
} catch (e) {
Expand Down

0 comments on commit b5acc09

Please sign in to comment.