Edit to allow URL to be saved

This commit is contained in:
Paddez 2016-11-07 13:18:02 +00:00
parent 54c4f9c093
commit 88619b30d4
No known key found for this signature in database
GPG key ID: 1DB178216DA02CD1
2 changed files with 12 additions and 7 deletions

View file

@ -1833,9 +1833,12 @@ class Album(_Opus):
"""An album."""
__hash__ = _Opus.__hash__
cover_image = None
def __init__(self, artist, title, network, username=None):
def __init__(self, artist, title, network, username=None, url=None):
super(Album, self).__init__(artist, title, network, "album", username)
if url:
self.cover_image = url
def get_release_date(self):
"""Returns the release date of the album."""
@ -1852,7 +1855,9 @@ class Album(_Opus):
COVER_MEDIUM
COVER_SMALL
"""
if self.cover_image:
return self.cover_image
else:
return _extract_all(
self._request(
self.ws_prefix + ".getInfo", cacheable=True), 'image')[size]

View file

@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name="pylast",
version="1.6.0",
version="1.6.1",
author="Amr Hassan <amr.hassan@gmail.com>",
install_requires=['six'],
tests_require=['mock', 'pytest', 'coverage', 'pep8', 'pyyaml', 'pyflakes'],