Skip to content

Commit

Permalink
fix(jellyfin): ignore additional items with virtual location type
Browse files Browse the repository at this point in the history
  • Loading branch information
sambartik authored Jun 5, 2022
1 parent a1cd354 commit c811548
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 c811548

Please sign in to comment.