Exemplo n.º 1
0
 def _on_search_activated(self, action, variant, artist):
     """
         Switch to page
         @param action as SimpleAction
         @param variant as GVariant
         @param artist as str
     """
     InfoCache.uncache(artist, 'wikipedia')
     InfoContent.clear(self)
     self.set_visible_child_name('spinner')
     self._spinner.start()
     t = Thread(target=self._load_page_content, args=(artist,))
     t.daemon = True
     t.start()
Exemplo n.º 2
0
 def _on_btn_release(self, widget, event):
     """
         Reload current view if autoload unchanged
         @param widget as Gtk.Widget
         @param event as Gdk.Event
     """
     if self._timeout_id is not None:
         GLib.source_remove(self._timeout_id)
         self._timeout_id = None
         visible_name = self._stack.get_visible_child_name()
         # Clear cache if needed
         if visible_name in ['lastfm', 'wikipedia']:
             for artist in self._current_track.artists:
                 InfoCache.uncache(artist, visible_name)
             # stack -> scrolled -> viewport -> grid
             self._on_child_unmap(
                    self._stack.get_visible_child().get_child().get_child())
         self._on_current_changed(Lp().player)