From a0a1b88ce24d7d0d227eea4ed5199890b407f9ed Mon Sep 17 00:00:00 2001 From: Aditya Kumar Das Date: Thu, 22 Feb 2024 01:11:15 +0530 Subject: [PATCH] Added azLyrics query Helps to fetch lyrics from azlyrics website --- lib/services/queries/lyrics.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/services/queries/lyrics.dart b/lib/services/queries/lyrics.dart index 618f960f..bc22fbe4 100644 --- a/lib/services/queries/lyrics.dart +++ b/lib/services/queries/lyrics.dart @@ -15,6 +15,20 @@ import 'package:http/http.dart' as http; class LyricsQueries { const LyricsQueries(); + Query azLyrics(Track? track) { + return useQuery("azlyrics-query/${track?.id}", () async { + if (track == null) { + throw "No Track Currently"; + } + final lyrics = await ServiceUtils.getAZLyrics( + title: track.name!, + artists: + track.artists?.map((s) => s.name).whereNotNull().toList() ?? []); + return lyrics; + }); + } + + Query static( Track? track, String geniusAccessToken,