Merge d9b43e6d9c
into cdd441dda1
This commit is contained in:
commit
46b79d0db7
|
@ -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"
|
||||||
|
@ -1918,9 +1918,12 @@ class Album(_Opus):
|
||||||
"""An album."""
|
"""An album."""
|
||||||
|
|
||||||
__hash__ = _Opus.__hash__
|
__hash__ = _Opus.__hash__
|
||||||
|
cover_url = 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)
|
super(Album, self).__init__(artist, title, network, "album", username)
|
||||||
|
if 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."""
|
||||||
|
@ -1937,7 +1940,9 @@ class Album(_Opus):
|
||||||
COVER_MEDIUM
|
COVER_MEDIUM
|
||||||
COVER_SMALL
|
COVER_SMALL
|
||||||
"""
|
"""
|
||||||
|
if self.cover_url:
|
||||||
|
return self.cover_url
|
||||||
|
else:
|
||||||
return _extract_all(
|
return _extract_all(
|
||||||
self._request(
|
self._request(
|
||||||
self.ws_prefix + ".getInfo", cacheable=True), 'image')[size]
|
self.ws_prefix + ".getInfo", cacheable=True), 'image')[size]
|
||||||
|
@ -4243,8 +4248,9 @@ def _extract_top_albums(doc, network):
|
||||||
name = _extract(node, "name")
|
name = _extract(node, "name")
|
||||||
artist = _extract(node, "name", 1)
|
artist = _extract(node, "name", 1)
|
||||||
playcount = _extract(node, "playcount")
|
playcount = _extract(node, "playcount")
|
||||||
|
cover_url = _extract_all(node, "image")[COVER_EXTRA_LARGE]
|
||||||
|
|
||||||
seq.append(TopItem(Album(artist, name, network), playcount))
|
seq.append(TopItem(Album(artist, name, network, url=cover_url), playcount))
|
||||||
|
|
||||||
return seq
|
return seq
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -4,7 +4,7 @@ from setuptools import setup, find_packages
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pylast",
|
name="pylast",
|
||||||
version="1.6.0",
|
version="1.6.1",
|
||||||
author="Amr Hassan <amr.hassan@gmail.com>",
|
author="Amr Hassan <amr.hassan@gmail.com>",
|
||||||
install_requires=['six'],
|
install_requires=['six'],
|
||||||
# FIXME This can be removed after 2017-09 when 3.3 is no longer supported
|
# FIXME This can be removed after 2017-09 when 3.3 is no longer supported
|
||||||
|
|
Loading…
Reference in a new issue