Add jellyfin album list normalization

This commit is contained in:
jeffvli 2022-12-14 20:08:59 -08:00
parent da0625dc90
commit 3c38c11aeb
2 changed files with 10 additions and 0 deletions

View File

@ -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) => {

View File

@ -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) =>