Compare commits

..
4 changed files with 18 additions and 11 deletions

No files matched your search

@@ -1,4 +1,3 @@
import { Ionicons } from "@expo/vector-icons"
import { SongSwipeRow } from "@/components/song-swipe-row"
import {
useSwipeRowGroup,
@@ -232,10 +231,11 @@ export default function AlbumScreen() {
}
>
<Pressable hitSlop={8}>
<Ionicons
<PaletteIcon
tone="foreground"
name="ellipsis-horizontal"
size={22}
color={colors.foreground}
color={palette.isDark ? "#fff" : "#000"}
/>
</Pressable>
</MediaActionMenu>
@@ -1,4 +1,3 @@
import { Ionicons } from "@expo/vector-icons"
import {
CollectionHero,
useCollectionHeroLayout,
@@ -180,7 +179,6 @@ function PlaylistContent({
}) {
const router = useRouter()
const isFocused = useIsFocused()
const colors = useThemeColors()
const { playPlaylist, playPlaylistShuffled, playFromSong } =
usePlaybackActions()
const { isSongFavorite } = useFavorites()
@@ -301,10 +299,11 @@ function PlaylistContent({
onAction={handlePlaylistMenuAction}
>
<Pressable hitSlop={8}>
<Ionicons
<PaletteIcon
tone="foreground"
name="ellipsis-horizontal"
size={22}
color={colors.foreground}
color={palette.isDark ? "#fff" : "#000"}
/>
</Pressable>
</MediaActionMenu>
@@ -312,7 +311,6 @@ function PlaylistContent({
}
}, [
canEdit,
colors.foreground,
deletePlaylist,
handlePlaylistDetailAction,
palette.foreground,
+11 -3
View File
@@ -376,7 +376,8 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
const handlePlaylistStatusUpdate = useCallback(
(status: AudioPlaylistStatus) => {
if (!status.isLoaded) return
// iOS may remove the finished item before delivering its final status.
if (!status.isLoaded && !status.didJustFinish) return
const state = storeRef.current.getState()
if (loadedSongIdsRef.current[status.currentIndex] !== state.queue[0]) {
return
@@ -427,7 +428,14 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
isPlayingRef.current = false
setIsPlayingState(false)
storeRef.current.update(playbackQueue.skipNext)
void playlistRef.current?.seekTo(0)
const playlist = playlistRef.current
if (playlist) {
playlist.pause()
// Reload the final item, which iOS removes when playback ends.
ignoreTrackChangeRef.current = true
playlist.skipTo(status.currentIndex)
scheduleTrackChangeHandling()
}
currentTimeRef.current = 0
setCurrentTime(0)
return
@@ -443,7 +451,7 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
playlist?.play()
}
},
[]
[scheduleTrackChangeHandling]
)
const handleTrackChanged = useCallback(
@@ -955,6 +955,7 @@ export function PlaybackProvider({ children }: { children: ReactNode }) {
if (!shouldContinuePlaying) {
autoPlayNextRef.current = false
isPlayingRef.current = false
audio.pause()
audio.currentTime = 0
currentTimeRef.current = 0
setCurrentTime(0)