Skip to content

Commit

Permalink
Merge pull request #126 from sambartik/fix-virtual-location
Browse files Browse the repository at this point in the history
 fix(jellyfin): ignore additional items with virtual location type
  • Loading branch information
Fallenbagel authored Jun 5, 2022
2 parents a1cd354 + c811548 commit 6458c05
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions server/api/jellyfin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ class JellyfinAPI {
`/Users/${this.userId}/Items?SortBy=SortName&SortOrder=Ascending&IncludeItemTypes=Series,Movie&Recursive=true&StartIndex=0&ParentId=${id}`
);

return contents.data.Items;
return contents.data.Items.filter(
(item: JellyfinLibraryItem) => item.LocationType !== 'Virtual'
);
} catch (e) {
logger.error(
`Something went wrong while getting library content from the Jellyfin server: ${e.message}`,
Expand All @@ -222,7 +224,9 @@ class JellyfinAPI {
`/Users/${this.userId}/Items/Latest?Limit=12&ParentId=${id}`
);

return contents.data;
return contents.data.filter(
(item: JellyfinLibraryItem) => item.LocationType !== 'Virtual'
);
} catch (e) {
logger.error(
`Something went wrong while getting library content from the Jellyfin server: ${e.message}`,
Expand All @@ -238,7 +242,9 @@ class JellyfinAPI {
`/Users/${this.userId}/Items/${id}`
);

return contents.data;
return contents.data.filter(
(item: JellyfinLibraryItem) => item.LocationType !== 'Virtual'
);
} catch (e) {
logger.error(
`Something went wrong while getting library content from the Jellyfin server: ${e.message}`,
Expand Down Expand Up @@ -273,7 +279,9 @@ class JellyfinAPI {
`/Shows/${seriesID}/Episodes?seasonId=${seasonID}`
);

return contents.data.Items;
return contents.data.Items.filter(
(item: JellyfinLibraryItem) => item.LocationType !== 'Virtual'
);
} catch (e) {
logger.error(
`Something went wrong while getting the list of episodes from the Jellyfin server: ${e.message}`,
Expand Down

0 comments on commit 6458c05

Please sign in to comment.