From ad4cd7a447e5ff8504481e9e7259ae02c39dfb3b Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 6 Mar 2017 22:58:00 -0500 Subject: [PATCH] Fix #2469: Beatport track limit It looks like the API uses pagination, and the default page size is 10. An easy fix is to just request lots of tracks per page (here, 100). A nicer thing to do in the future would be to actually traverse multiple pages. --- beetsplug/beatport.py | 3 ++- docs/changelog.rst | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/beatport.py b/beetsplug/beatport.py index c62abf7ab..8a73efa16 100644 --- a/beetsplug/beatport.py +++ b/beetsplug/beatport.py @@ -161,7 +161,8 @@ class BeatportClient(object): :returns: Tracks in the matching release :rtype: list of :py:class:`BeatportTrack` """ - response = self._get('/catalog/3/tracks', releaseId=beatport_id) + response = self._get('/catalog/3/tracks', releaseId=beatport_id, + perPage=100) return [BeatportTrack(t) for t in response] def get_track(self, beatport_id): diff --git a/docs/changelog.rst b/docs/changelog.rst index 7e86755fb..9ad8b3b4d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -61,6 +61,8 @@ Fixes: :user:`awesomer`. :bug:`2457` * :doc:`/plugins/thumbnails`: Fix a string-related crash on Python 3. :bug:`2466` +* :doc:`/plugins/beatport`: More than just 10 songs are now fetched per album. + :bug:`2469` 1.4.3 (January 9, 2017)