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

View File

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