diff --git a/lib/components/AddToPlaylistScreen/add_to_playlist_button.dart b/lib/components/AddToPlaylistScreen/add_to_playlist_button.dart index e50178ab..c5f5adba 100644 --- a/lib/components/AddToPlaylistScreen/add_to_playlist_button.dart +++ b/lib/components/AddToPlaylistScreen/add_to_playlist_button.dart @@ -5,11 +5,13 @@ import 'package:finamp/models/jellyfin_models.dart'; import 'package:finamp/services/favorite_provider.dart'; import 'package:finamp/services/feedback_helper.dart'; import 'package:finamp/services/finamp_settings_helper.dart'; +import 'package:finamp/services/queue_service.dart'; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_vibrate/flutter_vibrate.dart'; +import 'package:get_it/get_it.dart'; import 'playlist_actions_menu.dart'; @@ -35,6 +37,8 @@ class AddToPlaylistButton extends ConsumerStatefulWidget { } class _AddToPlaylistButtonState extends ConsumerState { + final _queueService = GetIt.instance(); + @override Widget build(BuildContext context) { if (widget.item == null) { @@ -74,12 +78,14 @@ class _AddToPlaylistButtonState extends ConsumerState { } bool inPlaylist = queueItemInPlaylist(widget.queueItem); + final currentTrack = _queueService.getCurrentTrack()?.baseItem; await showPlaylistActionsMenu( context: context, item: widget.item!, parentPlaylist: inPlaylist ? widget.queueItem!.source.item : null, - usePlayerTheme: true, + usePlayerTheme: widget.item?.blurHash != null && + widget.item?.blurHash == currentTrack?.blurHash, ); }), ), diff --git a/lib/components/PlayerScreen/queue_list_item.dart b/lib/components/PlayerScreen/queue_list_item.dart index 8140c065..410a3066 100644 --- a/lib/components/PlayerScreen/queue_list_item.dart +++ b/lib/components/PlayerScreen/queue_list_item.dart @@ -68,13 +68,12 @@ class _QueueListItemState extends State : const Color.fromRGBO(255, 255, 255, 0.125); void menuCallback() { - var currentTrack = jellyfin_models.BaseItemDto.fromJson( - _queueService.getCurrentTrack()?.item.extras?["itemJson"]); + var currentTrack = _queueService.getCurrentTrack()?.baseItem; showModalSongMenu( context: context, item: baseItem, usePlayerTheme: widget.item.baseItem?.blurHash != null && - widget.item.baseItem?.blurHash == currentTrack.blurHash, + widget.item.baseItem?.blurHash == currentTrack?.blurHash, themeProvider: _menuTheme, isInPlaylist: queueItemInPlaylist(widget.item), parentItem: widget.item.source.item,