diff --git a/src/components/player/controls/usePlayerControls.ts b/src/components/player/controls/usePlayerControls.ts index 265c1009..ce2bf2d6 100644 --- a/src/components/player/controls/usePlayerControls.ts +++ b/src/components/player/controls/usePlayerControls.ts @@ -189,6 +189,7 @@ export default () => { ); TrackPlayer.seekTo(trackDuration * newABRepeat[0]); }, + funcName: 'ABRepeat A seek', }); }); diff --git a/src/components/playlist/usePlaylistRN.ts b/src/components/playlist/usePlaylistRN.ts index 043c82dd..e03a1acb 100644 --- a/src/components/playlist/usePlaylistRN.ts +++ b/src/components/playlist/usePlaylistRN.ts @@ -14,7 +14,6 @@ import { syncFavlist } from '@utils/Bilibili/bilifavOperate'; import usePlayback from '@hooks/usePlayback'; import useTPControls from '@hooks/useTPControls'; import useSnack from '@stores/useSnack'; -import { setPlayingList } from '@stores/playingList'; import { clearPlaylistUninterrupted } from '@utils/RNTPUtils'; import { execWhenTrue } from '@utils/Utils'; @@ -52,6 +51,9 @@ export default (playlist: NoxMedia.Playlist) => { const playlistShouldReRender = useNoxSetting( state => state.playlistShouldReRender, ); + const setCurrentPlayingList = useNoxSetting( + state => state.setCurrentPlayingList, + ); const progressEmitter = useNoxSetting( state => state.searchBarProgressEmitter, ); @@ -120,7 +122,7 @@ export default (playlist: NoxMedia.Playlist) => { performFade(callback); }; usedPlaylist.playSong(song, playSongCallback, p => - clearPlaylistUninterrupted().then(() => setPlayingList(p.songList)), + clearPlaylistUninterrupted().then(() => setCurrentPlayingList(p)), ); }; @@ -137,6 +139,7 @@ export default (playlist: NoxMedia.Playlist) => { let layoutHeightCheck = 0; if (currentIndex > -1) { execWhenTrue({ + funcName: 'playlist index priming', executeFn: () => playlistRef.current?.scrollToIndex({ index: currentIndex, diff --git a/src/hooks/usePlaylist.ts b/src/hooks/usePlaylist.ts index 823ff082..9904559d 100644 --- a/src/hooks/usePlaylist.ts +++ b/src/hooks/usePlaylist.ts @@ -119,15 +119,19 @@ const usePlaylist = (playlist: NoxMedia.Playlist): UsePlaylist => { callback: (p: NoxMedia.Playlist, s: NoxMedia.Song) => void, isPlayingCallback: (p: NoxMedia.Playlist) => void = () => undefined, ) => { - if (song.id === currentPlayingId && playlist.id === currentPlayingList.id) - return isPlayingCallback(currentPlayingList); + const queuedSongList = playerSetting.keepSearchedSongListWhenPlaying + ? rows + : playlist.songList; + if (song.id === currentPlayingId && playlist.id === currentPlayingList.id) { + return isPlayingCallback({ + ...currentPlayingList, + songList: queuedSongList, + }); + } // HACK: more responsive, so the current song banner will show // immediately instead of watiting for fade to complete // REVIEW: playfromplaylist also checks currentPlayingId. how is that possible? setCurrentPlayingId(song.id); - const queuedSongList = playerSetting.keepSearchedSongListWhenPlaying - ? rows - : playlist.songList; return callback({ ...playlist, songList: queuedSongList }, song); };