]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/http.py
Remove EchoNest support (Closes #10)
[mpd-sima.git] / sima / lib / http.py
index 10fae9c475204852b73eabe039447d4d5d4497e4..f9a08bed869e961292d6911d03b53a5639f6b0d4 100644 (file)
@@ -190,12 +190,6 @@ class CacheController(object):
         # return the original handler
         return False
 
-    def add_headers(self, url):
-        resp = self.cache.get(url)
-        if resp and 'etag' in resp.headers:
-            return {'If-None-Match': resp.headers['etag']}
-        return {}
-
     def cache_response(self, request, resp):
         """
         Algorithm for caching requests.
@@ -308,10 +302,6 @@ class HttpClient:
             resp = self.controller.update_cached_response(prepreq, resp)
         elif resp.status_code != 200:
             raise WSHTTPError('{0.status_code}: {0.reason}'.format(resp))
-        ratelimit = resp.headers.get('x-ratelimit-remaining', None)
-        if ratelimit and self.stats:
-            minrl = min(int(ratelimit), self.stats.get('minrl'))
-            self.stats.update(minrl=minrl)
         self.controller.cache_response(resp.request, resp)
         return resp