Artist charts have the artist name in the 'name' field. There is no 'artist' field.

This commit is contained in:
Hugo 2018-04-05 18:08:21 +03:00
parent 06f6cf627d
commit 892acd6df9

View file

@ -1169,8 +1169,15 @@ class _Chartable(object):
seq = [] seq = []
for node in doc.getElementsByTagName(chart_kind.lower()): for node in doc.getElementsByTagName(chart_kind.lower()):
item = chart_type( if chart_kind == "artist":
_extract(node, "artist"), _extract(node, "name"), self.network) item = chart_type(
_extract(node, "name"),
self.network)
else:
item = chart_type(
_extract(node, "artist"),
_extract(node, "name"),
self.network)
weight = _number(_extract(node, "playcount")) weight = _number(_extract(node, "playcount"))
seq.append(TopItem(item, weight)) seq.append(TopItem(item, weight))