diff --git a/components/Global/card.tsx b/components/Global/card.tsx index b216f879..03185ace 100644 --- a/components/Global/card.tsx +++ b/components/Global/card.tsx @@ -54,8 +54,6 @@ export function Card(props: CardProps) { {props.blurhash && !imageLoaded && ( )} @@ -69,7 +67,7 @@ export function Card(props: CardProps) { } imageStyle={{ ...dimensions, - borderRadius: 25 + borderRadius: props.cornered ? 2 : 25 }} onLoadEnd={() => setImageLoaded(true)} /> diff --git a/components/Player/mini-player.tsx b/components/Player/mini-player.tsx index c4bc295b..b7226825 100644 --- a/components/Player/mini-player.tsx +++ b/components/Player/mini-player.tsx @@ -1,10 +1,11 @@ import React from "react"; -import { Text, View, XStack, YStack } from "tamagui"; +import { Text, XStack, YStack } from "tamagui"; import { useActiveTrack } from "react-native-track-player"; import { JellifyTrack } from "../../types/JellifyTrack"; import { usePlayerContext } from "../../player/provider"; import { BottomTabNavigationEventMap, BottomTabNavigationProp } from "@react-navigation/bottom-tabs"; import { NavigationHelpers, ParamListBase } from "@react-navigation/native"; +import { BlurView } from "@react-native-community/blur"; export function Miniplayer({ navigation }: { navigation : NavigationHelpers }) : React.JSX.Element { @@ -13,12 +14,12 @@ export function Miniplayer({ navigation }: { navigation : NavigationHelpers navigation.navigate("Player")}> + navigation.navigate("Player")}> {activeTrack?.title ?? "Nothing Playing"} - + ) } \ No newline at end of file diff --git a/components/navigation.tsx b/components/navigation.tsx index ff0bed69..5c928827 100644 --- a/components/navigation.tsx +++ b/components/navigation.tsx @@ -18,7 +18,13 @@ export default function Navigation(): React.JSX.Element { /> - + ) diff --git a/helpers/mappings.ts b/helpers/mappings.ts index ae66ae2f..1dcfa346 100644 --- a/helpers/mappings.ts +++ b/helpers/mappings.ts @@ -1,11 +1,10 @@ import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models"; import { JellifyTrack } from "../types/JellifyTrack"; -import { JellifyServer } from "../types/JellifyServer"; import { TrackType } from "react-native-track-player"; import { Api } from "@jellyfin/sdk"; -import { getDynamicHlsApi } from "@jellyfin/sdk/lib/utils/api"; +import { QueuingType } from "../enums/queuing-type"; -export function mapDtoToTrack(api: Api, item: BaseItemDto) { +export function mapDtoToTrack(api: Api, item: BaseItemDto, queuingType?: QueuingType) { return { url: `${api.basePath}/Audio/${item.Id!}/universal?TranscodingProtocol=hls?EnableRemoteMedia=true?EnableRedirection=true`, @@ -13,6 +12,11 @@ export function mapDtoToTrack(api: Api, item: BaseItemDto) { headers: { "X-Emby-Token": api.accessToken - } + }, + title: item.Name, + album: item.Album, + artist: item.Artists?.join(", "), + duration: item.RunTimeTicks, + QueuingType: queuingType ?? QueuingType.DirectlyQueued } as JellifyTrack } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index efd7d958..567c72a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@gcores/react-native-carplay": "^1.1.12", "@georstat/react-native-image-cache": "^3.1.0", "@jellyfin/sdk": "^0.10.0", + "@react-native-community/blur": "^4.4.1", "@react-native-community/masked-view": "^0.1.11", "@react-native-masked-view/masked-view": "^0.3.1", "@react-navigation/bottom-tabs": "^6.6.1", @@ -5869,6 +5870,16 @@ "node": ">=14" } }, + "node_modules/@react-native-community/blur": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@react-native-community/blur/-/blur-4.4.1.tgz", + "integrity": "sha512-XBSsRiYxE/MOEln2ayunShfJtWztHwUxLFcSL20o+HNNRnuUDv+GXkF6FmM2zE8ZUfrnhQ/zeTqvnuDPGw6O8A==", + "license": "MIT", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, "node_modules/@react-native-community/cli": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/@react-native-community/cli/-/cli-14.0.0.tgz", diff --git a/package.json b/package.json index 3995bfc0..4412a63c 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@gcores/react-native-carplay": "^1.1.12", "@georstat/react-native-image-cache": "^3.1.0", "@jellyfin/sdk": "^0.10.0", + "@react-native-community/blur": "^4.4.1", "@react-native-community/masked-view": "^0.1.11", "@react-native-masked-view/masked-view": "^0.3.1", "@react-navigation/bottom-tabs": "^6.6.1", diff --git a/player/provider.tsx b/player/provider.tsx index 8df8bce8..cf47a506 100644 --- a/player/provider.tsx +++ b/player/provider.tsx @@ -2,7 +2,6 @@ import { createContext, ReactNode, SetStateAction, useContext, useState } from " import { JellifyTrack } from "../types/JellifyTrack"; import { storage } from "../constants/storage"; import { MMKVStorageKeys } from "../enums/mmkv-storage-keys"; -import { useActiveTrack, useProgress } from "react-native-track-player"; import { findPlayQueueIndexStart } from "./mutators/helpers"; import { add, remove, removeUpcomingTracks, setupPlayer } from "react-native-track-player/lib/src/trackPlayer"; import _ from "lodash";