mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 06:27:09 +01:00
Add jellyfin album list normalization
This commit is contained in:
parent
da0625dc90
commit
3c38c11aeb
@ -19,6 +19,8 @@ import { controller } from '/@/api/controller';
|
||||
import { ndNormalize } from '/@/api/navidrome.api';
|
||||
import { AnimatedPage } from '/@/features/shared';
|
||||
import { AlbumListHeader } from '/@/features/albums/components/album-list-header';
|
||||
import { jfNormalize } from '/@/api/jellyfin.api';
|
||||
import type { JFAlbum } from '/@/api/jellyfin.types';
|
||||
|
||||
const AlbumListRoute = () => {
|
||||
const queryClient = useQueryClient();
|
||||
@ -58,6 +60,9 @@ const AlbumListRoute = () => {
|
||||
let items: Album[] = [];
|
||||
switch (server?.type) {
|
||||
case 'jellyfin':
|
||||
items = (albums?.items || []).map((a) => {
|
||||
return jfNormalize.album(a as JFAlbum, server);
|
||||
});
|
||||
break;
|
||||
case 'navidrome':
|
||||
items = (albums?.items || []).map((a) => {
|
||||
|
@ -11,6 +11,8 @@ import { ndNormalize } from '/@/api/navidrome.api';
|
||||
import type { NDSong } from '/@/api/navidrome.types';
|
||||
import { toast } from '/@/components';
|
||||
import { controller } from '/@/api/controller';
|
||||
import { jfNormalize } from '/@/api/jellyfin.api';
|
||||
import type { JFSong } from '/@/api/jellyfin.types';
|
||||
|
||||
export const handlePlayQueueAdd = async (options: PlayQueueAddOptions) => {
|
||||
const playerType = useSettingsStore.getState().player.type;
|
||||
@ -33,6 +35,9 @@ export const handlePlayQueueAdd = async (options: PlayQueueAddOptions) => {
|
||||
|
||||
switch (server?.type) {
|
||||
case 'jellyfin':
|
||||
songs = albumDetail.songs?.map((song) =>
|
||||
jfNormalize.song(song as JFSong, server, deviceId),
|
||||
);
|
||||
break;
|
||||
case 'navidrome':
|
||||
songs = albumDetail.songs?.map((song) =>
|
||||
|
Loading…
Reference in New Issue
Block a user