Return Cover URL with the Album metadata

This commit is contained in:
Paddez 2016-11-07 13:42:42 +00:00
parent f911168a57
commit d9b43e6d9c
No known key found for this signature in database
GPG key ID: 1DB178216DA02CD1

View file

@ -32,7 +32,7 @@ import warnings
import re import re
import six import six
__version__ = '1.6.0' __version__ = '1.6.1'
__author__ = 'Amr Hassan, hugovk' __author__ = 'Amr Hassan, hugovk'
__copyright__ = "Copyright (C) 2008-2010 Amr Hassan, 2013-2016 hugovk" __copyright__ = "Copyright (C) 2008-2010 Amr Hassan, 2013-2016 hugovk"
__license__ = "apache2" __license__ = "apache2"
@ -1833,12 +1833,12 @@ class Album(_Opus):
"""An album.""" """An album."""
__hash__ = _Opus.__hash__ __hash__ = _Opus.__hash__
cover_image = None cover_url = None
def __init__(self, artist, title, network, username=None, url=None): def __init__(self, artist, title, network, username=None, url=None):
super(Album, self).__init__(artist, title, network, "album", username) super(Album, self).__init__(artist, title, network, "album", username)
if url: if url:
self.cover_image = url self.cover_url = url
def get_release_date(self): def get_release_date(self):
"""Returns the release date of the album.""" """Returns the release date of the album."""
@ -1855,8 +1855,8 @@ class Album(_Opus):
COVER_MEDIUM COVER_MEDIUM
COVER_SMALL COVER_SMALL
""" """
if self.cover_image: if self.cover_url:
return self.cover_image return self.cover_url
else: else:
return _extract_all( return _extract_all(
self._request( self._request(