diff --git a/readme.md b/readme.md index eceedb5..865b482 100644 --- a/readme.md +++ b/readme.md @@ -51,7 +51,7 @@ This add-on uses [Pipenv](https://pypi.org/project/pipenv/) to manage its depend ### Setup -[Install Pipenv](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv) and run `pipenv install --dev`. +[Install Pipenv](https://pipenv.pypa.io/en/latest/installation.html#installing-pipenv) and run `pipenv install --dev`. ### Build diff --git a/resources/lib/models/user.py b/resources/lib/models/user.py index 52b9207..f17a8a6 100644 --- a/resources/lib/models/user.py +++ b/resources/lib/models/user.py @@ -11,12 +11,22 @@ class User(ListItem): def to_list_item(self, addon_base): list_item = xbmcgui.ListItem(label=self.label, label2=self.label2) list_item.setArt({"thumb": self.thumb}) - list_item.setInfo("music", { - "title": self.info.get("description") + list_item.setIsFolder(True) + # We have to use the `video`-type in order to display a proper description + list_item.setInfo("video", { + "plot": self._get_description() }) + list_item.setProperty("isPlayable", "false") url = addon_base + PATH_USER + "?" + urllib.parse.urlencode({ "id": self.id, "call": "/users/{id}/tracks".format(id=self.id) }) return url, list_item, True + + def _get_description(self): + return "{}\n{} followers\n\n{}".format( + self.label2 if self.label2 != "" else self.label, + self.info.get("followers"), + self.info.get("description") + ) diff --git a/resources/lib/soundcloud/api_v2.py b/resources/lib/soundcloud/api_v2.py index f464610..22d5dca 100644 --- a/resources/lib/soundcloud/api_v2.py +++ b/resources/lib/soundcloud/api_v2.py @@ -175,7 +175,8 @@ def _map_json_to_collection(self, json_obj): user.label2 = item.get("full_name", "") user.thumb = self._get_thumbnail(item, self.thumbnail_size) user.info = { - "artist": item.get("description", None) + "description": item.get("description", ""), + "followers": item.get("followers_count", 0) } collection.items.append(user)