Skip to content

Commit

Permalink
fix: wrong artist name sent while scrobbling #958
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Dec 29, 2023
1 parent dcbe729 commit b499999
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions lib/components/player/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion lib/provider/scrobbler_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b499999

Please sign in to comment.