-
-
Notifications
You must be signed in to change notification settings - Fork 38
Use new get_radio_mix for Track and Artist #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,9 +37,13 @@ | |
| from .login import LoginDialog | ||
| # from .new_playlist import NewPlaylistWindow | ||
|
|
||
| from .pages import HTNotLoggedInPage, HTGenericPage, HTExplorePage | ||
| from .pages import HTGenericPage | ||
| from .pages import HTExplorePage | ||
| from .pages import HTNotLoggedInPage | ||
| from .pages import HTCollectionPage | ||
| from .pages import HTArtistPage, HTMixPage, HTHrackRadioPage, HTPlaylistPage | ||
| from .pages import HTArtistPage | ||
| from .pages import HTMixPage | ||
| from .pages import HTPlaylistPage | ||
| from .pages import HTAlbumPage | ||
|
|
||
| from .widgets import HTGenericTrackWidget | ||
|
|
@@ -89,6 +93,9 @@ class HighTideWindow(Adw.ApplicationWindow): | |
| sidebar_stack = Gtk.Template.Child() | ||
| go_next_button = Gtk.Template.Child() | ||
| go_prev_button = Gtk.Template.Child() | ||
| track_radio_button = Gtk.Template.Child() | ||
| album_button = Gtk.Template.Child() | ||
| copy_share_link = Gtk.Template.Child() | ||
|
|
||
| app_id_dialog = Gtk.Template.Child() | ||
|
|
||
|
|
@@ -126,7 +133,13 @@ def __init__(self, **kwargs): | |
| self.create_action_with_target( | ||
| "push-track-radio-page", | ||
| GLib.VariantType.new("s"), | ||
| self.on_push_track_radio_page, | ||
| self.on_push_track_radio_page | ||
| ) | ||
|
|
||
| self.create_action_with_target( | ||
| "push-artist-radio-page", | ||
| GLib.VariantType.new("s"), | ||
| self.on_push_artist_radio_page | ||
| ) | ||
|
|
||
| # self.create_action_with_target( | ||
|
|
@@ -344,6 +357,11 @@ def on_song_changed(self, *args): | |
|
|
||
| self.set_quality_label() | ||
|
|
||
| self.track_radio_button.set_action_target_value( | ||
| GLib.Variant("s", str(track.id))) | ||
| self.album_button.set_action_target_value( | ||
| GLib.Variant("s", str(album.id))) | ||
|
|
||
| if utils.is_favourited(track): | ||
| self.in_my_collection_button.set_icon_name("heart-filled-symbolic") | ||
| else: | ||
|
|
@@ -508,18 +526,6 @@ def on_share_clicked(self, *args): | |
| if track: | ||
| utils.share_this(track) | ||
|
|
||
| @Gtk.Template.Callback("on_track_radio_button_clicked") | ||
| def on_track_radio_button_clicked_func(self, widget): | ||
| track = self.player_object.playing_track | ||
| page = HTHrackRadioPage.new_from_id(track.id).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| @Gtk.Template.Callback("on_album_button_clicked") | ||
| def on_album_button_clicked_func(self, widget): | ||
| track = self.player_object.playing_track | ||
| page = HTAlbumPage.new_from_id(track.album.id).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| @Gtk.Template.Callback("on_skip_forward_button_clicked") | ||
| def on_skip_forward_button_clicked_func(self, widget): | ||
| self.player_object.play_next() | ||
|
|
@@ -746,23 +752,39 @@ def change_discord_rpc_enabled(self, state): | |
| # | ||
|
|
||
| def on_push_artist_page(self, action, parameter): | ||
| if parameter.get_string() == "": | ||
| return | ||
|
Comment on lines
+755
to
+756
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are those for?
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case the parameter of the action is empty it will not try to load the page with an empty id.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
does that ever actually happen? and if it happens, will it pop off the stack or will it just load a blank page? |
||
| page = HTArtistPage.new_from_id(parameter.get_string()).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| def on_push_album_page(self, action, parameter): | ||
| if parameter.get_string() == "": | ||
| return | ||
| page = HTAlbumPage.new_from_id(parameter.get_string()).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| def on_push_playlist_page(self, action, parameter): | ||
| if parameter.get_string() == "": | ||
| return | ||
| page = HTPlaylistPage.new_from_id(parameter.get_string()).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| def on_push_mix_page(self, action, parameter): | ||
| if parameter.get_string() == "": | ||
| return | ||
| page = HTMixPage.new_from_id(parameter.get_string()).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| def on_push_track_radio_page(self, action, parameter): | ||
| page = HTHrackRadioPage.new_from_id(parameter.get_string()).load() | ||
| if parameter.get_string() == "": | ||
| return | ||
| page = HTMixPage.new_from_track(parameter.get_string()).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| def on_push_artist_radio_page(self, action, parameter): | ||
| if parameter.get_string() == "": | ||
| return | ||
| page = HTMixPage.new_from_artist(parameter.get_string()).load() | ||
| self.navigation_view.push(page) | ||
|
|
||
| # | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.