musicbrainz-api 0.20.0-beta.0 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/coverartarchive-api.js +7 -0
- package/lib/entry-node.cjs +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -308,9 +308,9 @@ Arguments:
|
|
|
308
308
|
- `query.offset`: optional, return search results starting at a given offset. Used for paging through more than one page of results.
|
|
309
309
|
- `limit.query`: optional, an integer value defining how many entries should be returned. Only values between 1 and 100 (both inclusive) are allowed. If not given, this defaults to 25.
|
|
310
310
|
|
|
311
|
-
For example, to
|
|
311
|
+
For example, to search for _release-group_: _"We Will Rock You"_ by _Queen_:
|
|
312
312
|
```js
|
|
313
|
-
const query = 'query="We Will Rock You"
|
|
313
|
+
const query = 'query=artist:"Queen" AND release:"We Will Rock You"';
|
|
314
314
|
const result = await mbApi.search('release-group', {query});
|
|
315
315
|
```
|
|
316
316
|
|
|
@@ -10,6 +10,13 @@ export class CoverArtArchiveApi {
|
|
|
10
10
|
Accept: "application/json"
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
+
const contentType = response.headers.get("Content-Type");
|
|
14
|
+
if (response.status === 404 && contentType?.toLowerCase() !== "application/json") {
|
|
15
|
+
return {
|
|
16
|
+
"error": "Not Found",
|
|
17
|
+
"help": "For usage, please see: https://musicbrainz.org/development/mmd"
|
|
18
|
+
};
|
|
19
|
+
}
|
|
13
20
|
return response.json();
|
|
14
21
|
}
|
|
15
22
|
/**
|
package/lib/entry-node.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Node.js CommonJS entry point
|
|
2
|
-
"use strict";
|
|
3
|
-
module.exports = {
|
|
4
|
-
loadMusicBrainzApi: () => import('./entry-node.js'),
|
|
5
|
-
};
|
|
1
|
+
// Node.js CommonJS entry point
|
|
2
|
+
"use strict";
|
|
3
|
+
module.exports = {
|
|
4
|
+
loadMusicBrainzApi: () => import('./entry-node.js'),
|
|
5
|
+
};
|