mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-23 19:39:35 -05:00
+2
-2
@@ -47,7 +47,7 @@
|
||||
"@react-navigation/native-stack": "^7.3.25",
|
||||
"@sentry/react-native": "6.17.0",
|
||||
"@shopify/flash-list": "^2.0.3",
|
||||
"@tamagui/config": "^1.132.20",
|
||||
"@tamagui/config": "^1.132.22",
|
||||
"@tanstack/query-async-storage-persister": "^5.84.2",
|
||||
"@tanstack/react-query": "^5.84.2",
|
||||
"@tanstack/react-query-persist-client": "^5.84.2",
|
||||
@@ -92,7 +92,7 @@
|
||||
"react-native-worklets": "0.4.1",
|
||||
"ruby": "^0.6.1",
|
||||
"scheduler": "^0.26.0",
|
||||
"tamagui": "^1.132.20",
|
||||
"tamagui": "^1.132.22",
|
||||
"use-context-selector": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -14,7 +14,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const response = await openai.chat.completions.create({
|
||||
model: 'gpt-4o',
|
||||
model: 'gpt-5',
|
||||
temperature: 0.7,
|
||||
messages: [
|
||||
{
|
||||
@@ -27,11 +27,6 @@ async function main() {
|
||||
content:
|
||||
'You are writing release notes for a mobile app called Jellify. The app is a music player that allows you to play music from your Jellyfin media server and stream music from the internet.',
|
||||
},
|
||||
{
|
||||
role: 'system',
|
||||
content:
|
||||
"You are a music enthusiast and you love music related puns and jokes. You can lightly add a pun or joke to the release notes if it's relevant to the release, but please don't overdo it.",
|
||||
},
|
||||
{
|
||||
role: 'system',
|
||||
content:
|
||||
|
||||
@@ -37,11 +37,11 @@ export const useInitialization = () =>
|
||||
`StoredIndex: ${storedIndex}, storedPlayQueue: ${storedPlayQueue?.map((track, index) => index)}`,
|
||||
)
|
||||
|
||||
if (storedPlayQueue && storedIndex) {
|
||||
if (!isUndefined(storedPlayQueue) && !isUndefined(storedIndex)) {
|
||||
console.debug('Initializing play queue from storage')
|
||||
|
||||
await TrackPlayer.pause()
|
||||
await TrackPlayer.setQueue(storedPlayQueue)
|
||||
await TrackPlayer.reset()
|
||||
await TrackPlayer.add(storedPlayQueue)
|
||||
await TrackPlayer.skip(storedIndex)
|
||||
|
||||
console.debug('Initialized play queue from storage')
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createContext } from 'use-context-selector'
|
||||
import { usePerformanceMonitor } from '../../hooks/use-performance-monitor'
|
||||
import { Event, useTrackPlayerEvents } from 'react-native-track-player'
|
||||
import { refetchNowPlaying } from './functions/queries'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useEffect, useRef } from 'react'
|
||||
import { useAudioNormalization, useInitialization } from './hooks/mutations'
|
||||
import { useCurrentIndex, useNowPlaying, useQueue } from './hooks/queries'
|
||||
import {
|
||||
@@ -12,10 +12,11 @@ import {
|
||||
} from './utils/handlers'
|
||||
import { useJellifyContext } from '..'
|
||||
import { getPlaystateApi } from '@jellyfin/sdk/lib/utils/api'
|
||||
import { getCurrentTrack, handleActiveTrackChanged } from './functions'
|
||||
import { handleActiveTrackChanged } from './functions'
|
||||
import { useAutoDownloadContext, useStreamingQualityContext } from '../Settings'
|
||||
import { useNetworkContext } from '../Network'
|
||||
import JellifyTrack from '@/src/types/JellifyTrack'
|
||||
import { useIsRestoring } from '@tanstack/react-query'
|
||||
|
||||
const PLAYER_EVENTS: Event[] = [
|
||||
Event.PlaybackActiveTrackChanged,
|
||||
@@ -39,8 +40,6 @@ export const PlayerProvider: () => React.JSX.Element = () => {
|
||||
|
||||
usePerformanceMonitor('PlayerProvider', 3)
|
||||
|
||||
const [initialized, setInitialized] = useState<boolean>(false)
|
||||
|
||||
const { mutate: initializePlayQueue } = useInitialization()
|
||||
|
||||
const { data: currentIndex } = useCurrentIndex()
|
||||
@@ -51,6 +50,8 @@ export const PlayerProvider: () => React.JSX.Element = () => {
|
||||
|
||||
const { mutate: normalizeAudioVolume } = useAudioNormalization()
|
||||
|
||||
const isRestoring = useIsRestoring()
|
||||
|
||||
const prefetchedTrackIds = useRef<Set<string>>(new Set())
|
||||
|
||||
useTrackPlayerEvents(PLAYER_EVENTS, (event) => {
|
||||
@@ -86,10 +87,8 @@ export const PlayerProvider: () => React.JSX.Element = () => {
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (!initialized) initializePlayQueue()
|
||||
|
||||
setInitialized(true)
|
||||
}, [])
|
||||
if (!isRestoring) initializePlayQueue()
|
||||
}, [isRestoring])
|
||||
|
||||
return (
|
||||
<PlayerContext.Provider value={{}}>
|
||||
|
||||
Reference in New Issue
Block a user