Esempio n. 1
0
 def search_album(self):
     res = self.session.search("album", self.keyword).albums
     album = next((a for a in res
                   if a.name.lower() == self.keyword.lower()), None)
     logger.info("Album not found" if album is None else "Album found OK")
     if album:
         self.albums = create_mopidy_albums([album])
         tracks = self.session.get_album_tracks(album.id)
         self.tracks = create_mopidy_tracks(tracks)
         logger.info("Found %d tracks for album", len(self.tracks))
Esempio n. 2
0
 def search_album(self):
     res = self.session.search("album", self.keyword).albums
     album = next(
         (a for a in res if a.name.lower() == self.keyword.lower()), None)
     logger.info("Album not found" if album is None else "Album found OK")
     if album:
         self.albums = create_mopidy_albums([album])
         tracks = self.session.get_album_tracks(album.id)
         self.tracks = create_mopidy_tracks(tracks)
         logger.info("Found %d tracks for album", len(self.tracks))
Esempio n. 3
0
 def run(self):
     if self.kind == "artist":
         artists = self.session.search("artist", self.keyword).artists
         self.results = create_mopidy_artists(artists)
     elif self.kind == "album":
         albums = self.session.search("album", self.keyword).albums
         self.results = create_mopidy_albums(albums)
     elif self.kind == "track":
         tracks = self.session.search("track", self.keyword).tracks
         self.results = create_mopidy_tracks(tracks)
Esempio n. 4
0
 def run(self):
     if self.kind == "artist":
         artists = self.session.search("artist", self.keyword).artists
         self.results = create_mopidy_artists(artists)
     elif self.kind == "album":
         albums = self.session.search("album", self.keyword).albums
         self.results = create_mopidy_albums(albums)
     elif self.kind == "track":
         tracks = self.session.search("track", self.keyword).tracks
         self.results = create_mopidy_tracks(tracks)