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