fix: better error message for failing to find lyrics #1085

This commit is contained in:
Kingkor Roy Tirtho 2024-01-23 23:13:13 +06:00
parent 79839329b0
commit e58e18de33
3 changed files with 4 additions and 4 deletions

View File

@ -73,7 +73,7 @@ class PlainLyrics extends HookConsumerWidget {
return const ShimmerLyrics(); return const ShimmerLyrics();
} else if (lyricsQuery.hasError) { } else if (lyricsQuery.hasError) {
return Text( return Text(
"Sorry, no Lyrics were found for `${playlist.activeTrack?.name}` :'(\n${lyricsQuery.error.toString()}", "Sorry, no Lyrics were found for `${playlist.activeTrack?.name}` :'(\n${lyricsQuery.error.toString().replaceAll("Exception: ", "")}",
style: textTheme.bodyLarge?.copyWith( style: textTheme.bodyLarge?.copyWith(
color: palette.bodyTextColor, color: palette.bodyTextColor,
), ),

View File

@ -190,7 +190,7 @@ class SyncedLyrics extends HookConsumerWidget {
else if (playlist.activeTrack != null && else if (playlist.activeTrack != null &&
(timedLyricsQuery.hasError)) (timedLyricsQuery.hasError))
Text( Text(
"Sorry, no Lyrics were found for `${playlist.activeTrack?.name}` :'(\n${timedLyricsQuery.error.toString()}", "Sorry, no Lyrics were found for `${playlist.activeTrack?.name}` :'(\n${timedLyricsQuery.error.toString().replaceAll("Exception: ", "")}",
style: bodyTextTheme, style: bodyTextTheme,
) )
else if (isUnSyncLyric == true) else if (isUnSyncLyric == true)

View File

@ -63,8 +63,8 @@ class LyricsQueries {
/// Special thanks to [raptag](https://github.com/raptag) for discovering this /// Special thanks to [raptag](https://github.com/raptag) for discovering this
/// jem /// jem
Query<SubtitleSimple, dynamic> spotifySynced(WidgetRef ref, Track? track) { Query<SubtitleSimple, Exception> spotifySynced(WidgetRef ref, Track? track) {
return useSpotifyQuery<SubtitleSimple, dynamic>( return useSpotifyQuery<SubtitleSimple, Exception>(
"spotify-synced-lyrics/${track?.id}}", "spotify-synced-lyrics/${track?.id}}",
(spotify) async { (spotify) async {
if (track == null) { if (track == null) {