Merge pull request #275 from Fallenbagel/support-mixed-libraries

feat(api): adds support for Mixed Libraries
This commit is contained in:
Fallenbagel
2022-12-17 04:27:46 +05:00
committed by GitHub

View File

@@ -179,8 +179,10 @@ class JellyfinAPI {
(Item: any) => { (Item: any) => {
return ( return (
Item.Type === 'CollectionFolder' && Item.Type === 'CollectionFolder' &&
(Item.CollectionType === 'tvshows' || Item.CollectionType !== 'music' &&
Item.CollectionType === 'movies') Item.CollectionType !== 'books' &&
Item.CollectionType !== 'musicvideos' &&
Item.CollectionType !== 'homevideos'
); );
} }
).map((Item: any) => { ).map((Item: any) => {
@@ -205,7 +207,7 @@ class JellyfinAPI {
public async getLibraryContents(id: string): Promise<JellyfinLibraryItem[]> { public async getLibraryContents(id: string): Promise<JellyfinLibraryItem[]> {
try { try {
const contents = await this.axios.get<any>( const contents = await this.axios.get<any>(
`/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( return contents.data.Items.filter(