Improved library store & Partly working episode playback

This commit is contained in:
Aleksi Lassila
2023-08-03 22:00:03 +03:00
parent a50ea33f1b
commit 3092e1cc9d
8 changed files with 216 additions and 62 deletions

View File

@@ -59,7 +59,7 @@ export const getJellyfinItems = () =>
// }
// }).then((r) => r.data?.Items || []);
export const getJellyfinEpisodes = (seriesId: string) =>
export const getJellyfinEpisodes = () =>
JellyfinApi.get('/Users/{userId}/Items', {
params: {
path: {
@@ -73,7 +73,10 @@ export const getJellyfinEpisodes = (seriesId: string) =>
headers: {
'cache-control': 'max-age=10'
}
}).then((r) => r.data?.Items?.filter((i) => i.SeriesId === seriesId) || []);
}).then((r) => r.data?.Items || []);
export const getJellyfinEpisodesBySeries = (seriesId: string) =>
getJellyfinEpisodes().then((items) => items.filter((i) => i.SeriesId === seriesId) || []);
export const getJellyfinItemByTmdbId = (tmdbId: string) =>
getJellyfinItems().then((items) => items.find((i) => i.ProviderIds?.Tmdb == tmdbId));

View File

@@ -20,6 +20,7 @@ export interface TmdbMovieFull2 extends TmdbMovie2 {
videos: operations['movie-videos']['responses']['200']['content']['application/json'];
credits: operations['movie-credits']['responses']['200']['content']['application/json'];
external_ids: operations['movie-external-ids']['responses']['200']['content']['application/json'];
images: operations['movie-images']['responses']['200']['content']['application/json'];
}
export interface TmdbSeriesFull2 extends TmdbSeries2 {
@@ -43,7 +44,8 @@ export const getTmdbMovie = async (tmdbId: number) =>
movie_id: tmdbId
},
query: {
append_to_response: 'videos,credits,external_ids'
append_to_response: 'videos,credits,external_ids,images',
...({ include_image_language: get(settings).language + ',en,null' } as any)
}
}
}).then((res) => res.data as TmdbMovieFull2 | undefined);