Skip to content

Commit

Permalink
Fix: Fixed infinite loading process of lyrics
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Mar 21, 2024
1 parent 1eb57af commit 6e45f21
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions lib/screens/now_playing_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ class NowPlayingPage extends StatelessWidget {
child: ValueListenableBuilder<String?>(
valueListenable: lyrics,
builder: (_, value, __) {
if (lastFetchedLyrics !=
'${metadata.artist} - ${metadata.title}') {
getSongLyrics(
metadata.artist ?? '',
metadata.title,
);
}
if (value != null && value != 'not found') {
return SingleChildScrollView(
child: Padding(
Expand Down Expand Up @@ -416,16 +423,7 @@ class NowPlayingPage extends StatelessWidget {
IconButton(
icon: const Icon(FluentIcons.text_32_filled),
iconSize: iconSize,
onPressed: () {
if (lastFetchedLyrics !=
'${mediaItem.artist} - ${mediaItem.title}') {
getSongLyrics(
mediaItem.artist ?? '',
mediaItem.title,
);
}
_lyricsController.flipcard();
},
onPressed: _lyricsController.flipcard,
),
ValueListenableBuilder<bool>(
valueListenable: songLikeStatus,
Expand Down

0 comments on commit 6e45f21

Please sign in to comment.