Exemplo n.º 1
0
 def play(self):
     """
         Play row
     """
     from lollypop.web import Web
     Lp().player.emit('loading-changed', True)
     web = Web()
     if self.__item.is_track:
         web.save_track(self.__item, DbPersistent.NONE)
     else:
         web.save_album(self.__item, DbPersistent.NONE)
Exemplo n.º 2
0
 def _on_save_clicked(self, button):
     """
         Save into collection
         @param button as Gtk.Button
     """
     from lollypop.web import Web
     web = Web()
     if self.__item.is_track:
         web.save_track(self.__item, DbPersistent.EXTERNAL)
     else:
         web.save_album(self.__item, DbPersistent.EXTERNAL)
     self.destroy()
Exemplo n.º 3
0
 def __on_item_found(self, search, position):
     """
         Get track from search
         @param search as NetworkSearch
         @param position as int
     """
     if search.items:
         item = search.items[0]
         if item.is_track:
             debug("LastfmCharts::__on_item_found(): %s - %s" %
                   (item.name, item.artists))
             search.stop()
             search.disconnect_by_func(self.__on_item_found)
             item.mtime = self.__time + position
             web = Web()
             web.save_track(item, DbPersistent.CHARTS, [Type.LASTFM])
Exemplo n.º 4
0
 def __on_item_found(self, search, position):
     """
         Get track from search
         @param search as NetworkSearch
         @param position as int
     """
     if search.items:
         item = search.items[0]
         if item.is_track:
             debug("LastfmCharts::__on_item_found(): %s - %s" % (
                                                             item.name,
                                                             item.artists))
             search.stop()
             search.disconnect_by_func(self.__on_item_found)
             item.mtime = self.__time + position
             web = Web()
             web.save_track(item, DbPersistent.CHARTS, [Type.LASTFM])
Exemplo n.º 5
0
 def on_activated(self, persistent):
     """
         Download item
         @param persistent as DbPersistent
     """
     from lollypop.web import Web
     web = Web()
     web.connect("saved", self.__on_saved, persistent)
     if self.__item.is_track:
         web.save_track(self.__item, persistent)
     else:
         web.save_album(self.__item, persistent)
         if self.__progress is not None:
             self.__progress.set_opacity(1)
         web.connect("progress", self.__on_progress)
     self.__stack.set_visible_child_name("spinner")
     self.__stack.get_visible_child().start()
Exemplo n.º 6
0
 def on_activated(self, persistent):
     """
         Download item
         @param persistent as DbPersistent
     """
     from lollypop.web import Web
     web = Web()
     web.connect("saved", self.__on_saved, persistent)
     if self.__item.is_track:
         web.save_track(self.__item, persistent)
     else:
         web.save_album(self.__item, persistent)
         if self.__progress is not None:
             self.__progress.set_opacity(1)
         web.connect("progress", self.__on_progress)
     self.__stack.set_visible_child_name("spinner")
     self.__stack.get_visible_child().start()