Skip to content

Commit

Permalink
fixed lyrics bug, started to add carousel for mobile navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Apr 24, 2024
1 parent 34f2c09 commit 7f5d355
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ class HighTideWindow(Adw.ApplicationWindow):
queue_list = Gtk.Template.Child()
main_view_stack = Gtk.Template.Child()
playbar_main_box = Gtk.Template.Child()
mobile_picture = Gtk.Template.Child()
# navigation_carousel = Gtk.Template.Child()
# previous_carousel_picture = Gtk.Template.Child()
current_carousel_picture = Gtk.Template.Child()
# next_carousel_picture = Gtk.Template.Child()

def __init__(self, **kwargs):
super().__init__(**kwargs)
Expand All @@ -101,6 +104,7 @@ def __init__(self, **kwargs):

self.player_object = playerObject()
variables.player_object = self.player_object
variables.search_entry = self.search_entry

self.volume_button.get_adjustment().set_value(self.settings.get_int("last-volume")/10)

Expand Down Expand Up @@ -223,7 +227,15 @@ def on_song_changed(self, *args):
self.settings.set_int("last-playing-song-id", track.id)

threading.Thread(target=utils.add_image, args=(self.playing_track_image, album)).start()
threading.Thread(target=utils.add_picture, args=(self.mobile_picture, album)).start()
threading.Thread(target=utils.add_picture, args=(self.current_carousel_picture, album)).start()

# next_track = self.player_object.get_next_track()
# if next_track:
# threading.Thread(target=utils.add_picture, args=(self.next_carousel_picture, next_track.album)).start()

# prev_track = self.player_object.get_prev_track()
# if prev_track:
# threading.Thread(target=utils.add_picture, args=(self.previous_carousel_picture, prev_track.album)).start()

if self.player_object.is_playing:
self.play_button.set_icon_name("media-playback-pause-symbolic")
Expand Down Expand Up @@ -390,8 +402,11 @@ def on_lyrics_button_clicked_func(self, widget):
th.start()

def add_lyrics_to_page(self):
lyrics = self.player_object.playing_track.lyrics()
self.lyrics_label.set_label(lyrics.text)
try:
lyrics = self.player_object.playing_track.lyrics()
self.lyrics_label.set_label(lyrics.text)
except:
return

def download_song(self):
"""Added to check the streamed song quality, triggered with ctrl+d"""
Expand Down

0 comments on commit 7f5d355

Please sign in to comment.