Skip to content

Commit 297f543

Browse files
committed
1.1.0
1 parent e64ffd2 commit 297f543

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

HISTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.1.0 / 2017-02-23
2+
==================
3+
* Implemented new Discogs rate limiting headers. The rate limit param in a callback now looks like: `{ limit: 240, used: 1, remaining: 239 }`
4+
15
1.0.2 / 2016-11-10
26
==================
37
* Added `collection().getReleaseInstances()`

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(The MIT License)
22

3-
Copyright (c) 2014-2016 B. van Eijck <[email protected]>
3+
Copyright (c) 2014-2017 B. van Eijck <[email protected]>
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

lib/client.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,11 @@ DiscogsClient.prototype._rawRequest = function(options, callback){
204204
};
205205

206206
// Find and add rate limiting when present
207-
if(res.headers['x-ratelimit-type']){
207+
if(res.headers['x-discogs-ratelimit']){
208208
rateLimit = {
209-
type: res.headers['x-ratelimit-type'],
210-
limit: res.headers['x-ratelimit-limit'],
211-
reset: res.headers['x-ratelimit-reset'],
212-
remaining: res.headers['x-ratelimit-remaining']
209+
limit: parseInt(res.headers['x-discogs-ratelimit'], 10),
210+
used: parseInt(res.headers['x-discogs-ratelimit-used'], 10),
211+
remaining: parseInt(res.headers['x-discogs-ratelimit-remaining'], 10)
213212
};
214213
}
215214

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "disconnect",
33
"description": "A full featured Discogs API v2.0 client library",
4-
"version": "1.0.2",
4+
"version": "1.1.0",
55
"keywords": ["discogs", "api", "client", "oauth"],
66
"homepage": "https://github.com/bartve/disconnect",
77
"bugs": "https://github.com/bartve/disconnect/issues",

0 commit comments

Comments
 (0)