fix(player): refresh lyrics after automatic track changes

This commit is contained in:
zarzet
2026-08-01 15:38:40 +07:00
parent b3bbe93c1e
commit 6a3a85f7c9
2 changed files with 93 additions and 1 deletions
+7 -1
View File
@@ -186,7 +186,13 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
super.initState();
_mediaItemSub = ref.listenManual<AsyncValue<MediaItem?>>(
currentMediaItemProvider,
(previous, next) => _loadMetadataForItem(next.value),
(previous, next) => _loadMetadataForItem(
next.value,
// When automatic playback advances while Lyrics is already visible,
// onPageChanged will not run again. Inspect an unresolved SAF URI now
// instead of leaving the new track with an empty Lyrics page.
inspectUnresolvedContentUri: _currentPage == 1,
),
);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;