コード例 #1
0
ファイル: discogsalbum.py プロジェクト: triplem/discogstagger
    def map(self):
        """ map the retrieved information to the tagger specific objects """

        album = Album(self.release.id, self.release.title, self.album_artists(self.release.artists))

        album.sort_artist = self.sort_artist(self.release.artists)
        album.url = self.url
        album.catnumbers = [catno for name, catno in self.labels_and_numbers]
        album.labels = [name for name, catno in self.labels_and_numbers]
        album.images = self.images
        album.year = self.year
        album.genres = self.release.data["genres"]

        try:
            album.styles = self.release.data["styles"]
        except KeyError:
            album.styles = [""]

        if "country" in self.release.data:
            album.country = self.release.data["country"]
        else:
            logging.warn("no country set for relid %s" % self.release.id)
            album.country = ""

        if "notes" in self.release.data:
            album.notes = self.release.data["notes"]

        album.disctotal = self.disctotal
        album.is_compilation = self.is_compilation

        album.master_id = self.master_id

        album.discs = self.discs_and_tracks(album)

        return album
コード例 #2
0
ファイル: spotify.py プロジェクト: avukich/mp3-tag-editor
 def get_album_old(self, id):
     spotify_album = self.sp.album(id)
     album = Album()
     album.title = spotify_album['name']
     album.artist = spotify_album['artists'][0]['name']
     album.genres = self.get_genres(spotify_album['artists'][0]['id'])
     album.year = parse_release_date(
         spotify_album['release_date'],
         spotify_album['release_date_precision'])
     download_album_art(spotify_album['images'][0]['url'])
     return album
コード例 #3
0
    def map(self):
        """ map the retrieved information to the tagger specific objects """

        album = Album(self.release.id, self.release.title,
                      self.album_artists(self.release.artists))

        album.sort_artist = self.sort_artist(self.release.artists)
        album.url = self.url
        album.catnumbers = [catno for name, catno in self.labels_and_numbers]
        album.labels = [name for name, catno in self.labels_and_numbers]
        album.images = self.images
        album.year = self.year
        album.genres = self.release.data["genres"]

        try:
            album.styles = self.release.data["styles"]
        except KeyError:
            album.styles = [""]

        if "country" in self.release.data:
            album.country = self.release.data["country"]
        else:
            logging.warn("no country set for relid %s" % self.release.id)
            album.country = ""

        if "notes" in self.release.data:
            album.notes = self.release.data["notes"]

        album.disctotal = self.disctotal
        album.is_compilation = self.is_compilation

        album.master_id = self.master_id

        album.discs = self.discs_and_tracks(album)

        return album