Skip to content

Commit 705a237

Browse files
committed
Add parameter to search to allow for more results
1 parent 9fd9e5a commit 705a237

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

tests/test_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ def test_artist_radio(session):
118118

119119

120120
def test_search(session):
121-
res = session.search('artist', 'lasgo')
121+
res = session.search('artist', 'lasgo', 100)
122122
assert res.artists[0].name == "Lasgo"
123+
assert len(res.artists) == 100
123124

124125

125126
def test_artist_picture(session):

tidalapi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ def get_video_url(self, video_id):
255255
request = self.request('GET', 'videos/%s/urlpostpaywall' % video_id, params)
256256
return request.json()['urls'][0]
257257

258-
def search(self, field, value):
258+
def search(self, field, value, limit=50):
259259
params = {
260260
'query': value,
261-
'limit': 50,
261+
'limit': limit,
262262
}
263263
if field not in ['artist', 'album', 'playlist', 'track']:
264264
raise ValueError('Unknown field \'%s\'' % field)

0 commit comments

Comments
 (0)