mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-12 22:38:38 -05:00
use persisted queue
This commit is contained in:
+8
-2
@@ -4,7 +4,7 @@ import { storage } from "../constants/storage";
|
||||
import { MMKVStorageKeys } from "../enums/mmkv-storage-keys";
|
||||
import { findPlayNextIndexStart, findPlayQueueIndexStart } from "./helpers/index";
|
||||
import TrackPlayer, { Event, Progress, State, usePlaybackState, useProgress, useTrackPlayerEvents } from "react-native-track-player";
|
||||
import _, { isEqual, isUndefined } from "lodash";
|
||||
import { isEqual, isUndefined } from "lodash";
|
||||
import { getPlaystateApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
import { handlePlaybackProgressUpdated, handlePlaybackState } from "./handlers";
|
||||
import { useSetupPlayer, useUpdateOptions } from "../player/hooks";
|
||||
@@ -299,8 +299,14 @@ const PlayerContextInitializer = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
if (queue.length > 0 && nowPlaying) {
|
||||
TrackPlayer.setQueue(queue)
|
||||
.then(() => {
|
||||
TrackPlayer.skip(queue.findIndex(track => track.item.Id! === nowPlaying.item.Id!));
|
||||
});
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!showMiniplayer)
|
||||
|
||||
Reference in New Issue
Block a user