]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/simafm.py
Improved ETag support, add some stats
[mpd-sima.git] / sima / lib / simafm.py
index f54ab015e99a57a01ddded9e58db83a711795ac9..cc70cf7bcac4d0989dbb992425be4c6c37ccc1f2 100644 (file)
@@ -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