Merge pull request #332 from pylast/deprecate-artist.get_cover_image
This commit is contained in:
commit
e7ad4ac5b2
|
@ -1,6 +1,6 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.4.4
|
rev: v2.6.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: ["--py3-plus"]
|
args: ["--py3-plus"]
|
||||||
|
@ -15,13 +15,13 @@ repos:
|
||||||
types: []
|
types: []
|
||||||
|
|
||||||
- repo: https://gitlab.com/pycqa/flake8
|
- repo: https://gitlab.com/pycqa/flake8
|
||||||
rev: 3.8.2
|
rev: 3.8.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
|
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
|
||||||
|
|
||||||
- repo: https://github.com/asottile/seed-isort-config
|
- repo: https://github.com/asottile/seed-isort-config
|
||||||
rev: v2.1.1
|
rev: v2.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: seed-isort-config
|
- id: seed-isort-config
|
||||||
|
|
||||||
|
|
|
@ -1726,6 +1726,15 @@ class Artist(_BaseObject, _Taggable):
|
||||||
SIZE_SMALL
|
SIZE_SMALL
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
warnings.warn(
|
||||||
|
"Artist.get_cover_image is deprecated and will be removed in a future "
|
||||||
|
"version. In the meantime, only default star images are available. "
|
||||||
|
"See https://github.com/pylast/pylast/issues/317 and "
|
||||||
|
"https://support.last.fm/t/api-announcement/202",
|
||||||
|
DeprecationWarning,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
|
|
||||||
if "image" not in self.info:
|
if "image" not in self.info:
|
||||||
self.info["image"] = _extract_all(
|
self.info["image"] = _extract_all(
|
||||||
self._request(self.ws_prefix + ".getInfo", cacheable=True), "image"
|
self._request(self.ws_prefix + ".getInfo", cacheable=True), "image"
|
||||||
|
|
|
@ -250,7 +250,10 @@ class TestPyLastArtist(TestPyLastWithLastFm):
|
||||||
# Act
|
# Act
|
||||||
url = artist1.get_url()
|
url = artist1.get_url()
|
||||||
mbid = artist1.get_mbid()
|
mbid = artist1.get_mbid()
|
||||||
image = artist1.get_cover_image()
|
|
||||||
|
with pytest.warns(DeprecationWarning):
|
||||||
|
image = artist1.get_cover_image()
|
||||||
|
|
||||||
playcount = artist1.get_playcount()
|
playcount = artist1.get_playcount()
|
||||||
streamable = artist1.is_streamable()
|
streamable = artist1.is_streamable()
|
||||||
name = artist1.get_name(properly_capitalized=False)
|
name = artist1.get_name(properly_capitalized=False)
|
||||||
|
|
Loading…
Reference in a new issue