def create_album(self, _album): album = Album(_album['AlbumID']) try: album.title = u'%s' % _album['AlbumName'] except: album.title = u'%s' % _album['Name'] album.author = u'%s' % _album['ArtistName'] if _album['Year']: album.year = int(_album['Year']) if _album['CoverArtFilename']: album.thumbnail = BaseImage(u'http://images.gs-cdn.net/static/albums/80_' + _album['CoverArtFilename']) album.thumbnail.url = album.thumbnail.id return album
def create_album(self, _album): album = Album(_album['AlbumID']) try: album.title = u'%s' % _album['AlbumName'] except: album.title = u'%s' % _album['Name'] album.author = u'%s' % _album['ArtistName'] if _album['Year']: album.year = int(_album['Year']) if _album['CoverArtFilename']: album.thumbnail = BaseImage( u'http://images.gs-cdn.net/static/albums/80_' + _album['CoverArtFilename']) album.thumbnail.url = album.thumbnail.id return album
def _make_album(self, coll): alb = Album(coll.id) alb.title = coll.title alb.author = coll.title return alb