diff --git a/lib/components/player/player.dart b/lib/components/player/player.dart index 01e38670..458676e3 100644 --- a/lib/components/player/player.dart +++ b/lib/components/player/player.dart @@ -24,6 +24,7 @@ import 'package:spotube/models/local_track.dart'; import 'package:spotube/pages/lyrics/lyrics.dart'; import 'package:spotube/provider/authentication_provider.dart'; import 'package:spotube/provider/proxy_playlist/proxy_playlist_provider.dart'; +import 'package:spotube/services/sourced_track/sources/youtube.dart'; import 'package:spotube/utils/type_conversion_utils.dart'; import 'package:url_launcher/url_launcher_string.dart'; @@ -138,26 +139,25 @@ class PlayerView extends HookConsumerWidget { onPressed: panelController.close, ), actions: [ - TextButton.icon( - icon: Assets.logos.songlinkTransparent.image( - width: 20, - height: 20, - color: bodyTextColor, - ), - label: Text(context.l10n.song_link), - style: TextButton.styleFrom( - foregroundColor: bodyTextColor, - padding: EdgeInsets.zero, - ), - onPressed: currentTrack == null - ? null - : () { - final url = - "https://song.link/s/${currentTrack.id}"; + if (currentTrack is YoutubeSourcedTrack) + TextButton.icon( + icon: Assets.logos.songlinkTransparent.image( + width: 20, + height: 20, + color: bodyTextColor, + ), + label: Text(context.l10n.song_link), + style: TextButton.styleFrom( + foregroundColor: bodyTextColor, + padding: EdgeInsets.zero, + ), + onPressed: () { + final url = + "https://song.link/s/${currentTrack.id}"; - launchUrlString(url); - }, - ), + launchUrlString(url); + }, + ), IconButton( icon: const Icon(SpotubeIcons.info, size: 18), tooltip: context.l10n.details,