From bb589a4d2193400eb84adf14578f696228abbe08 Mon Sep 17 00:00:00 2001 From: Chris Newton Date: Wed, 28 Feb 2018 17:04:46 -0700 Subject: [PATCH] Add missing limit parameter for track.getSimilar --- pylast/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index a1ee98f..f644f3c 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -2016,13 +2016,17 @@ class Track(_Opus): self._request(self.ws_prefix + '.unlove') - def get_similar(self): + def get_similar(self, limit=None): """ Returns similar tracks for this track on the network, based on listening data. """ - doc = self._request(self.ws_prefix + '.getSimilar', True) + params = self._get_params() + if limit: + params['limit'] = limit + + doc = self._request(self.ws_prefix + '.getSimilar', True, params) seq = [] for node in doc.getElementsByTagName(self.ws_prefix):