fix: wrong artist name sent while scrobbling #958

This commit is contained in:
Kingkor Roy Tirtho 2023-12-29 18:28:25 +06:00
parent dcbe7294b7
commit b4999993bf
2 changed files with 11 additions and 6 deletions

View File

@ -74,10 +74,14 @@ class PlayerView extends HookConsumerWidget {
useMemoized(() => GlobalKey(), []); useMemoized(() => GlobalKey(), []);
useEffect(() { useEffect(() {
WidgetsBinding.instance.renderView.automaticSystemUiAdjustment = false; for (final renderView in WidgetsBinding.instance.renderViews) {
renderView.automaticSystemUiAdjustment = false;
}
return () { return () {
WidgetsBinding.instance.renderView.automaticSystemUiAdjustment = true; for (final renderView in WidgetsBinding.instance.renderViews) {
renderView.automaticSystemUiAdjustment = true;
}
}; };
}, [panelController.isPanelOpen]); }, [panelController.isPanelOpen]);
@ -90,10 +94,11 @@ class PlayerView extends HookConsumerWidget {
final topPadding = MediaQueryData.fromView(View.of(context)).padding.top; final topPadding = MediaQueryData.fromView(View.of(context)).padding.top;
return WillPopScope( return PopScope(
onWillPop: () async { canPop: panelController.isPanelOpen,
onPopInvoked: (canPop) async {
if (!canPop) return;
panelController.close(); panelController.close();
return false;
}, },
child: IconTheme( child: IconTheme(
data: theme.iconTheme.copyWith(color: bodyTextColor), data: theme.iconTheme.copyWith(color: bodyTextColor),

View File

@ -43,7 +43,7 @@ class ScrobblerNotifier extends PersistedStateNotifier<ScrobblerState?> {
_scrobbleController.stream.listen((track) async { _scrobbleController.stream.listen((track) async {
try { try {
await state?.scrobblenaut.track.scrobble( await state?.scrobblenaut.track.scrobble(
artist: track.artists.first.name!, artist: track.artists!.first.name!,
track: track.name!, track: track.name!,
album: track.album!.name!, album: track.album!.name!,
chosenByUser: true, chosenByUser: true,