[rhythmbox: 5/6] soundcloud: disable fetch-more-tracks button when we don't have any more tracks to load



commit 4717fa0db0e59ce833f4104bb9f482e3671c86ef
Author: crvi <crvisqr gmail com>
Date:   Sat Feb 8 11:56:40 2020 +0530

    soundcloud: disable fetch-more-tracks button when we don't have any more tracks to load

 plugins/soundcloud/soundcloud.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/plugins/soundcloud/soundcloud.py b/plugins/soundcloud/soundcloud.py
index 5d4a7f548..a790600ff 100644
--- a/plugins/soundcloud/soundcloud.py
+++ b/plugins/soundcloud/soundcloud.py
@@ -219,8 +219,8 @@ class SoundCloudSource(RB.StreamingSource):
                for item in stuff['collection']:
                        self.add_track(db, entry_type, item)
 
-               if 'next_href' in stuff:
-                       self.more_tracks_url = stuff.get('next_href')
+               self.more_tracks_url = stuff.get('next_href')
+               if self.more_tracks_url:
                        self.fetch_more_button.set_sensitive(True)
 
 
@@ -485,6 +485,7 @@ class SoundCloudSource(RB.StreamingSource):
 
                self.fetch_more_button = Gtk.Button.new_with_label(_("Fetch more tracks"))
                self.fetch_more_button.connect("clicked", self.show_more_cb)
+               self.fetch_more_button.set_sensitive(False)
 
                action = Gio.SimpleAction.new("soundcloud-search-type", GLib.VariantType.new('s'))
                action.connect("activate", self.search_type_action_cb)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]