X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fsimafm.py;fp=sima%2Flib%2Fsimafm.py;h=cc70cf7bcac4d0989dbb992425be4c6c37ccc1f2;hb=df9f0f9dae0f8712f672b4eb7f4211e62f6c2e21;hp=f54ab015e99a57a01ddded9e58db83a711795ac9;hpb=3b790488058841bcb00180aa07277334a394b3ea;p=mpd-sima.git diff --git a/sima/lib/simafm.py b/sima/lib/simafm.py index f54ab01..cc70cf7 100644 --- a/sima/lib/simafm.py +++ b/sima/lib/simafm.py @@ -120,7 +120,9 @@ class SimaFM: payload.update(results=100) if method == 'track': payload.update(track=track) - return payload + # > hashing the URL into a cache key + # return a sorted list of 2-tuple to have consistent cache + return sorted(payload.items(), key=lambda param: param[0]) def get_similar(self, artist=None): """Fetch similar artists