diff --git a/lib/services/sourced_track/sourced_track.dart b/lib/services/sourced_track/sourced_track.dart index a5e094ed..7eedfad8 100644 --- a/lib/services/sourced_track/sourced_track.dart +++ b/lib/services/sourced_track/sourced_track.dart @@ -135,16 +135,10 @@ abstract class SourcedTrack extends Track { return await PipedSourcedTrack.fetchFromTrack(track: track, ref: ref); } catch (e) { if (e is DioException || e is ClientException || e is SocketException) { - if (preferences.audioSource == AudioSource.jiosaavn) { - return await JioSaavnSourcedTrack.fetchFromTrack( - track: track, - ref: ref, - weakMatch: true, - ); - } return await JioSaavnSourcedTrack.fetchFromTrack( track: track, ref: ref, + weakMatch: preferences.audioSource == AudioSource.jiosaavn, ); } rethrow; diff --git a/lib/services/sourced_track/sources/youtube.dart b/lib/services/sourced_track/sources/youtube.dart index 3fc78f0b..c24edfc0 100644 --- a/lib/services/sourced_track/sources/youtube.dart +++ b/lib/services/sourced_track/sources/youtube.dart @@ -1,3 +1,4 @@ +import 'package:catcher_2/core/catcher_2.dart'; import 'package:collection/collection.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:http/http.dart'; @@ -221,14 +222,19 @@ class YoutubeSourcedTrack extends SourcedTrack { final ytLink = links.firstWhereOrNull((link) => link.platform == "youtube"); if (ytLink?.url != null) { - return [ - await toSiblingType( - 0, - YoutubeVideoInfo.fromVideo( - await youtubeClient.videos.get(ytLink!.url!), - ), - ) - ]; + try { + return [ + await toSiblingType( + 0, + YoutubeVideoInfo.fromVideo( + await youtubeClient.videos.get(ytLink!.url!), + ), + ) + ]; + } on VideoUnplayableException catch (e, stack) { + // Ignore this error and continue with the search + Catcher2.reportCheckedError(e, stack); + } } final query = SourcedTrack.getSearchTerm(track); diff --git a/lib/themes/theme.dart b/lib/themes/theme.dart index cf1da7be..390a7509 100644 --- a/lib/themes/theme.dart +++ b/lib/themes/theme.dart @@ -24,7 +24,13 @@ ThemeData theme(Color seed, Brightness brightness, bool isAmoled) { horizontalTitleGap: 5, iconColor: scheme.onSurface, ), - appBarTheme: const AppBarTheme(surfaceTintColor: Colors.transparent), + appBarTheme: const AppBarTheme( + surfaceTintColor: Colors.transparent, + scrolledUnderElevation: 0, + shadowColor: Colors.transparent, + elevation: 0, + backgroundColor: Colors.transparent, + ), inputDecorationTheme: InputDecorationTheme( border: OutlineInputBorder( borderRadius: BorderRadius.circular(15),