mirror of
https://github.com/csd4ni3l/music-player.git
synced 2026-01-01 04:03:42 +01:00
fix artist and lyrics label staying as a set value after no music is playing
This commit is contained in:
@@ -285,6 +285,9 @@ class Main(arcade.gui.UIView):
|
|||||||
self.current_synchronized_lyrics = None
|
self.current_synchronized_lyrics = None
|
||||||
self.lyrics_times = None
|
self.lyrics_times = None
|
||||||
self.parsed_lyrics = None
|
self.parsed_lyrics = None
|
||||||
|
self.current_lyrics_label.text = "Play a song to get lyrics."
|
||||||
|
self.next_lyrics_label.text = "Play a song to get lyrics."
|
||||||
|
self.current_music_artist_label.text = "No songs playing"
|
||||||
self.current_music_thumbnail_image.texture = music_icon
|
self.current_music_thumbnail_image.texture = music_icon
|
||||||
self.current_music_title_label.text = "No songs playing"
|
self.current_music_title_label.text = "No songs playing"
|
||||||
self.full_length_label.text = "00:00"
|
self.full_length_label.text = "00:00"
|
||||||
@@ -505,6 +508,10 @@ class Main(arcade.gui.UIView):
|
|||||||
self.current_synchronized_lyrics = get_lyrics(self.current_music_artist, self.current_music_title)[1]
|
self.current_synchronized_lyrics = get_lyrics(self.current_music_artist, self.current_music_title)[1]
|
||||||
self.lyrics_times, self.parsed_lyrics = parse_synchronized_lyrics(self.current_synchronized_lyrics) if self.current_synchronized_lyrics else (None, None)
|
self.lyrics_times, self.parsed_lyrics = parse_synchronized_lyrics(self.current_synchronized_lyrics) if self.current_synchronized_lyrics else (None, None)
|
||||||
|
|
||||||
|
if not self.current_synchronized_lyrics:
|
||||||
|
self.current_lyrics_label.text = "No known lyrics found"
|
||||||
|
self.next_lyrics_label.text = "No known lyrics found"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if self.current_music_player is not None:
|
if self.current_music_player is not None:
|
||||||
self.skip_sound() # reset properties
|
self.skip_sound() # reset properties
|
||||||
|
|||||||
Reference in New Issue
Block a user