mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-11 09:27:30 +00:00
updated to handle missing song lyrics
This commit is contained in:
parent
72ed3ce2d1
commit
a7ab70d953
@ -48,7 +48,9 @@ class LyricsQueries {
|
|||||||
throw "No track currently";
|
throw "No track currently";
|
||||||
}
|
}
|
||||||
final timedLyrics = await ServiceUtils.getTimedLyrics(track);
|
final timedLyrics = await ServiceUtils.getTimedLyrics(track);
|
||||||
if (timedLyrics == null) throw Exception("Unable to find lyrics");
|
if (timedLyrics == null) {
|
||||||
|
return SubtitleSimple(errorMessage: "Unable to find lyrics");
|
||||||
|
}
|
||||||
|
|
||||||
return timedLyrics;
|
return timedLyrics;
|
||||||
},
|
},
|
||||||
@ -83,8 +85,8 @@ class LyricsQueries {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res.statusCode != 200) {
|
if (res.statusCode != 200) {
|
||||||
throw Exception("Unable to find lyrics");
|
return SubtitleSimple(errorMessage: "Unable to find lyrics");
|
||||||
}
|
}
|
||||||
final linesRaw = Map.castFrom<dynamic, dynamic, String, dynamic>(
|
final linesRaw = Map.castFrom<dynamic, dynamic, String, dynamic>(
|
||||||
jsonDecode(res.body),
|
jsonDecode(res.body),
|
||||||
)["lyrics"]?["lines"] as List?;
|
)["lyrics"]?["lines"] as List?;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user