From 7b422fe02b3c4db008b17a84cbdc75683c93aa4d Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Tue, 14 Jan 2025 10:12:20 -0600 Subject: [PATCH] wow that's a big change --- components/Global/components/track.tsx | 2 +- components/Player/screens/queue.tsx | 4 ++-- helpers/mappings.ts | 7 +------ types/JellifyTrack.ts | 8 ++------ 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/components/Global/components/track.tsx b/components/Global/components/track.tsx index 8b44b5ae..92706276 100644 --- a/components/Global/components/track.tsx +++ b/components/Global/components/track.tsx @@ -39,7 +39,7 @@ export default function Track({ const { apiClient } = useApiClientContext(); const { nowPlaying, usePlayNewQueue } = usePlayerContext(); - const isPlaying = nowPlaying?.ItemId === track.Id + const isPlaying = nowPlaying?.item.Id === track.Id; return ( diff --git a/components/Player/screens/queue.tsx b/components/Player/screens/queue.tsx index f36c4edc..dbf5b312 100644 --- a/components/Player/screens/queue.tsx +++ b/components/Player/screens/queue.tsx @@ -15,8 +15,8 @@ export default function Queue(): React.JSX.Element { renderItem={({ item: queueItem, index }) => { return ( track.item)} index={index} showArtwork onPress={() => { diff --git a/helpers/mappings.ts b/helpers/mappings.ts index cedb9fac..61875b15 100644 --- a/helpers/mappings.ts +++ b/helpers/mappings.ts @@ -36,12 +36,7 @@ export function mapDtoToTrack(api: Api, sessionId: string, item: BaseItemDto, qu duration: item.RunTimeTicks, artwork: getImageApi(api).getItemImageUrlById(item.Id!), - ItemId: item.Id!, - ArtistId: item.AlbumArtists![0].Id!, - AlbumId: item.AlbumId!, - Name: item.Name, - RunTimeTicks: item.RunTimeTicks, - IndexNumber: item.IndexNumber, + item, QueuingType: queuingType ?? QueuingType.DirectlyQueued } as JellifyTrack } \ No newline at end of file diff --git a/types/JellifyTrack.ts b/types/JellifyTrack.ts index bee2de7c..9c0bbeae 100644 --- a/types/JellifyTrack.ts +++ b/types/JellifyTrack.ts @@ -1,5 +1,6 @@ import { PitchAlgorithm, RatingType, Track, TrackType } from "react-native-track-player" import { QueuingType } from "../enums/queuing-type"; +import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; export interface JellifyTrack extends Track { url: string; @@ -20,12 +21,7 @@ export interface JellifyTrack extends Track { rating?: RatingType | undefined; isLiveStream?: boolean | undefined; - ItemId: string; - ArtistId: string; - AlbumId: string; - Year?: number | null | undefined; - IndexNumber?: number | null | undefined; - ParentIndexNumber?: number | null | undefined; + item: BaseItemDto; /** * Represents the type of queuing for this song, be it that it was