mirror of
https://github.com/BradNut/graphbrainz
synced 2025-09-08 17:40:32 +00:00
Add Disc type, lookup, and discs field on Media (#16)
* Add Disc type, lookup, and discs field on Media * Remove query optimization so search subqueries work
This commit is contained in:
parent
7d45b44cda
commit
780596480a
74 changed files with 1472 additions and 26 deletions
|
|
@ -153,7 +153,7 @@ type Artist implements Node, Entity {
|
|||
area: Area
|
||||
|
||||
# The area in which an artist began their career (or where
|
||||
# were born, if the artist is a person).
|
||||
# they were born, if the artist is a person).
|
||||
beginArea: Area
|
||||
|
||||
# The area in which an artist ended their career (or where
|
||||
|
|
@ -590,6 +590,28 @@ scalar Date
|
|||
# Decimal degrees, used for latitude and longitude.
|
||||
scalar Degrees
|
||||
|
||||
# Information about the physical CD and releases associated with a
|
||||
# particular [disc ID](https://musicbrainz.org/doc/Disc_ID).
|
||||
type Disc implements Node {
|
||||
# The ID of an object
|
||||
id: ID!
|
||||
|
||||
# The [disc ID](https://musicbrainz.org/doc/Disc_ID) of this disc.
|
||||
discID: DiscID!
|
||||
|
||||
# The number of offsets (tracks) on the disc.
|
||||
offsetCount: Int!
|
||||
|
||||
# The sector offset of each track on the disc.
|
||||
offsets: [Int]
|
||||
|
||||
# The sector offset of the lead-out (the end of the disc).
|
||||
sectors: Int!
|
||||
|
||||
# The list of releases linked to this disc ID.
|
||||
releases(after: String, first: Int): ReleaseConnection
|
||||
}
|
||||
|
||||
# [Disc ID](https://musicbrainz.org/doc/Disc_ID) is the code
|
||||
# number which MusicBrainz uses to link a physical CD to a [release](https://musicbrainz.org/doc/Release)
|
||||
# listing.
|
||||
|
|
@ -928,6 +950,13 @@ type LookupQuery {
|
|||
mbid: MBID!
|
||||
): Collection
|
||||
|
||||
# Look up a specific physical disc by its disc ID.
|
||||
disc(
|
||||
# The [disc ID](https://musicbrainz.org/doc/Disc_ID)
|
||||
# of the disc.
|
||||
discID: DiscID!
|
||||
): Disc
|
||||
|
||||
# Look up a specific event by its MBID.
|
||||
event(
|
||||
# The MBID of the entity.
|
||||
|
|
@ -1019,6 +1048,9 @@ type Medium {
|
|||
|
||||
# The number of audio tracks on this medium.
|
||||
trackCount: Int
|
||||
|
||||
# A list of physical discs and their disc IDs for this medium.
|
||||
discs: [Disc]
|
||||
}
|
||||
|
||||
# An object with an ID
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ You may also be interested in reading the [schema in GraphQL syntax](schema.md).
|
|||
<li>[CollectionConnection](#collectionconnection)</li>
|
||||
<li>[CollectionEdge](#collectionedge)</li>
|
||||
<li>[Coordinates](#coordinates)</li>
|
||||
<li>[Disc](#disc)</li>
|
||||
<li>[Event](#event)</li>
|
||||
<li>[EventConnection](#eventconnection)</li>
|
||||
<li>[EventEdge](#eventedge)</li>
|
||||
|
|
@ -555,7 +556,7 @@ is often, but not always, its birth/formation country.
|
|||
<td valign="top"><a href="#area">Area</a></td>
|
||||
<td>
|
||||
The area in which an artist began their career (or where
|
||||
were born, if the artist is a person).
|
||||
they were born, if the artist is a person).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
@ -1656,6 +1657,72 @@ Geographic coordinates described with latitude and longitude.
|
|||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
### Disc
|
||||
|
||||
Information about the physical CD and releases associated with a
|
||||
particular [disc ID](https://musicbrainz.org/doc/Disc_ID).
|
||||
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th align="left">Field / Argument</th>
|
||||
<th align="left">Type</th>
|
||||
<th align="left">Description</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td valign="top"><strong>id</strong> </td>
|
||||
<td valign="top"><a href="#id">ID</a>!</td>
|
||||
<td>
|
||||
The ID of an object
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>discID</strong> </td>
|
||||
<td valign="top"><a href="#discid">DiscID</a>!</td>
|
||||
<td>
|
||||
The <a href="https://musicbrainz.org/doc/Disc_ID">disc ID</a> of this disc.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>offsetCount</strong> </td>
|
||||
<td valign="top"><a href="#int">Int</a>!</td>
|
||||
<td>
|
||||
The number of offsets (tracks) on the disc.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>offsets</strong> </td>
|
||||
<td valign="top">[<a href="#int">Int</a>]</td>
|
||||
<td>
|
||||
The sector offset of each track on the disc.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>sectors</strong> </td>
|
||||
<td valign="top"><a href="#int">Int</a>!</td>
|
||||
<td>
|
||||
The sector offset of the lead-out (the end of the disc).
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>releases</strong> </td>
|
||||
<td valign="top"><a href="#releaseconnection">ReleaseConnection</a></td>
|
||||
<td>
|
||||
The list of releases linked to this disc ID.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="top">after</td>
|
||||
<td valign="top"><a href="#string">String</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="top">first</td>
|
||||
<td valign="top"><a href="#int">Int</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
### Event
|
||||
|
||||
An [event](https://musicbrainz.org/doc/Event) refers to an
|
||||
|
|
@ -2399,6 +2466,19 @@ A lookup of an individual MusicBrainz entity by its MBID.
|
|||
<td valign="top"><a href="#mbid">MBID</a>!</td>
|
||||
<td>The MBID of the entity.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>disc</strong> </td>
|
||||
<td valign="top"><a href="#disc">Disc</a></td>
|
||||
<td>
|
||||
Look up a specific physical disc by its disc ID.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="top">discID</td>
|
||||
<td valign="top"><a href="#discid">DiscID</a>!</td>
|
||||
<td>The <a href="https://musicbrainz.org/doc/Disc_ID">disc ID</a>
|
||||
of the disc.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>event</strong> </td>
|
||||
<td valign="top"><a href="#event">Event</a></td>
|
||||
|
|
@ -2579,6 +2659,13 @@ multi-disc release).
|
|||
The number of audio tracks on this medium.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><strong>discs</strong> </td>
|
||||
<td valign="top">[<a href="#disc">Disc</a>]</td>
|
||||
<td>
|
||||
A list of physical discs and their disc IDs for this medium.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
### PageInfo
|
||||
|
|
|
|||
200
schema.json
200
schema.json
|
|
@ -167,6 +167,33 @@
|
|||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "disc",
|
||||
"description": "Look up a specific physical disc by its disc ID.",
|
||||
"args": [
|
||||
{
|
||||
"name": "discID",
|
||||
"description": "The [disc ID](https://musicbrainz.org/doc/Disc_ID)\nof the disc.",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "DiscID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"defaultValue": null
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"kind": "OBJECT",
|
||||
"name": "Disc",
|
||||
"ofType": null
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "event",
|
||||
"description": "Look up a specific event by its MBID.",
|
||||
|
|
@ -898,6 +925,11 @@
|
|||
"name": "Release",
|
||||
"ofType": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "Disc",
|
||||
"ofType": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "Label",
|
||||
|
|
@ -1459,7 +1491,7 @@
|
|||
},
|
||||
{
|
||||
"name": "beginArea",
|
||||
"description": "The area in which an artist began their career (or where\nwere born, if the artist is a person).",
|
||||
"description": "The area in which an artist began their career (or where\nthey were born, if the artist is a person).",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "OBJECT",
|
||||
|
|
@ -3301,6 +3333,22 @@
|
|||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "discs",
|
||||
"description": "A list of physical discs and their disc IDs for this medium.",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "LIST",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "Disc",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"inputFields": null,
|
||||
|
|
@ -3308,6 +3356,146 @@
|
|||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "Disc",
|
||||
"description": "Information about the physical CD and releases associated with a\nparticular [disc ID](https://musicbrainz.org/doc/Disc_ID).",
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"description": "The ID of an object",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "ID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "discID",
|
||||
"description": "The [disc ID](https://musicbrainz.org/doc/Disc_ID) of this disc.",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "DiscID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "offsetCount",
|
||||
"description": "The number of offsets (tracks) on the disc.",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "offsets",
|
||||
"description": "The sector offset of each track on the disc.",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "LIST",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "sectors",
|
||||
"description": "The sector offset of the lead-out (the end of the disc).",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "releases",
|
||||
"description": "The list of releases linked to this disc ID.",
|
||||
"args": [
|
||||
{
|
||||
"name": "after",
|
||||
"description": null,
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null
|
||||
},
|
||||
{
|
||||
"name": "first",
|
||||
"description": null,
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"kind": "OBJECT",
|
||||
"name": "ReleaseConnection",
|
||||
"ofType": null
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"inputFields": null,
|
||||
"interfaces": [
|
||||
{
|
||||
"kind": "INTERFACE",
|
||||
"name": "Node",
|
||||
"ofType": null
|
||||
}
|
||||
],
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "SCALAR",
|
||||
"name": "DiscID",
|
||||
"description": "[Disc ID](https://musicbrainz.org/doc/Disc_ID) is the code\nnumber which MusicBrainz uses to link a physical CD to a [release](https://musicbrainz.org/doc/Release)\nlisting.\n\nA release may have any number of disc IDs, and a disc ID may be linked to\nmultiple releases. This is because disc ID calculation involves a hash of the\nframe offsets of the CD tracks.\n\nDifferent pressing of a CD often have slightly different frame offsets, and\nhence different disc IDs.\n\nConversely, two different CDs may happen to have exactly the same set of frame\noffsets and hence the same disc ID.",
|
||||
"fields": null,
|
||||
"inputFields": null,
|
||||
"interfaces": null,
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "LabelConnection",
|
||||
|
|
@ -9138,16 +9326,6 @@
|
|||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "SCALAR",
|
||||
"name": "DiscID",
|
||||
"description": "[Disc ID](https://musicbrainz.org/doc/Disc_ID) is the code\nnumber which MusicBrainz uses to link a physical CD to a [release](https://musicbrainz.org/doc/Release)\nlisting.\n\nA release may have any number of disc IDs, and a disc ID may be linked to\nmultiple releases. This is because disc ID calculation involves a hash of the\nframe offsets of the CD tracks.\n\nDifferent pressing of a CD often have slightly different frame offsets, and\nhence different disc IDs.\n\nConversely, two different CDs may happen to have exactly the same set of frame\noffsets and hence the same disc ID.",
|
||||
"fields": null,
|
||||
"inputFields": null,
|
||||
"interfaces": null,
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "SCALAR",
|
||||
"name": "ISWC",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
import { GraphQLObjectType } from 'graphql'
|
||||
import { GraphQLObjectType, GraphQLNonNull } from 'graphql'
|
||||
import { resolveLookup } from '../resolvers'
|
||||
import { mbid, toWords } from '../types/helpers'
|
||||
import {
|
||||
Area,
|
||||
Artist,
|
||||
Collection,
|
||||
Disc,
|
||||
DiscID,
|
||||
Event,
|
||||
Instrument,
|
||||
Label,
|
||||
|
|
@ -36,6 +38,20 @@ export const LookupQuery = new GraphQLObjectType({
|
|||
area: createLookupField(Area),
|
||||
artist: createLookupField(Artist),
|
||||
collection: createLookupField(Collection),
|
||||
disc: {
|
||||
type: Disc,
|
||||
description: 'Look up a specific physical disc by its disc ID.',
|
||||
args: {
|
||||
discID: {
|
||||
type: new GraphQLNonNull(DiscID),
|
||||
description: `The [disc ID](https://musicbrainz.org/doc/Disc_ID)
|
||||
of the disc.`
|
||||
}
|
||||
},
|
||||
resolve: (root, { discID }, { loaders }, info) => {
|
||||
return loaders.lookup.load(['discid', discID])
|
||||
}
|
||||
},
|
||||
event: createLookupField(Event),
|
||||
instrument: createLookupField(Instrument),
|
||||
label: createLookupField(Label),
|
||||
|
|
|
|||
|
|
@ -38,20 +38,20 @@ export function includeRelationships (params, info, fragments = info.fragments)
|
|||
|
||||
export function includeSubqueries (params, info, fragments = info.fragments) {
|
||||
const subqueryIncludes = {
|
||||
aliases: 'aliases',
|
||||
artistCredit: 'artist-credits',
|
||||
artistCredits: 'artist-credits',
|
||||
isrcs: 'isrcs',
|
||||
media: 'media',
|
||||
rating: 'ratings',
|
||||
tags: 'tags'
|
||||
aliases: ['aliases'],
|
||||
artistCredit: ['artist-credits'],
|
||||
artistCredits: ['artist-credits'],
|
||||
isrcs: ['isrcs'],
|
||||
media: ['media', 'discids'],
|
||||
rating: ['ratings'],
|
||||
tags: ['tags']
|
||||
}
|
||||
let fields = getFields(info, fragments)
|
||||
const include = []
|
||||
for (const key in subqueryIncludes) {
|
||||
if (fields[key]) {
|
||||
const value = subqueryIncludes[key]
|
||||
include.push(value)
|
||||
include.push(...value)
|
||||
}
|
||||
}
|
||||
params = {
|
||||
|
|
@ -104,6 +104,13 @@ export function resolveBrowse (root, {
|
|||
let request
|
||||
if (discID) {
|
||||
request = loaders.lookup.load(['discid', discID, params])
|
||||
// If fetching releases by disc ID, they will already include the `media`
|
||||
// and `discids` subqueries, and it is invalid to specify them.
|
||||
if (params.inc) {
|
||||
params.inc = params.inc.filter(value => {
|
||||
return value !== 'media' && value !== 'discids'
|
||||
})
|
||||
}
|
||||
} else if (isrc) {
|
||||
request = loaders.lookup.load(['isrc', isrc, params])
|
||||
} else if (iswc) {
|
||||
|
|
@ -193,7 +200,7 @@ export function createSubqueryResolver ({ inc, key } = {}, handler = value => va
|
|||
return (entity, args, { loaders }, info) => {
|
||||
key = key || toDashed(info.fieldName)
|
||||
let promise
|
||||
if (key in entity || (entity._inc && entity._inc.indexOf(key) >= 0)) {
|
||||
if (key in entity) {
|
||||
promise = Promise.resolve(entity)
|
||||
} else {
|
||||
const { _type: entityType, id } = entity
|
||||
|
|
@ -203,3 +210,15 @@ export function createSubqueryResolver ({ inc, key } = {}, handler = value => va
|
|||
return promise.then(entity => handler(entity[key], args))
|
||||
}
|
||||
}
|
||||
|
||||
export function resolveDiscReleases (disc, args, context, info) {
|
||||
const { releases } = disc
|
||||
if (releases != null) {
|
||||
return {
|
||||
totalCount: releases.length,
|
||||
...connectionFromArray(releases, args)
|
||||
}
|
||||
}
|
||||
args = { ...args, discID: disc.id }
|
||||
return resolveBrowse(disc, args, context, info)
|
||||
}
|
||||
|
|
|
|||
46
src/types/disc.js
Normal file
46
src/types/disc.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
import {
|
||||
GraphQLObjectType,
|
||||
GraphQLNonNull,
|
||||
GraphQLList,
|
||||
GraphQLInt
|
||||
} from 'graphql/type'
|
||||
import { forwardConnectionArgs } from 'graphql-relay'
|
||||
import Node from './node'
|
||||
import { DiscID } from './scalars'
|
||||
import { ReleaseConnection } from './release'
|
||||
import { resolveDiscReleases } from '../resolvers'
|
||||
import { id, resolveHyphenated } from './helpers'
|
||||
|
||||
export default new GraphQLObjectType({
|
||||
name: 'Disc',
|
||||
description: `Information about the physical CD and releases associated with a
|
||||
particular [disc ID](https://musicbrainz.org/doc/Disc_ID).`,
|
||||
interfaces: () => [Node],
|
||||
fields: () => ({
|
||||
id,
|
||||
discID: {
|
||||
type: new GraphQLNonNull(DiscID),
|
||||
description: `The [disc ID](https://musicbrainz.org/doc/Disc_ID) of this disc.`,
|
||||
resolve: disc => disc.id
|
||||
},
|
||||
offsetCount: {
|
||||
type: new GraphQLNonNull(GraphQLInt),
|
||||
description: 'The number of offsets (tracks) on the disc.',
|
||||
resolve: resolveHyphenated
|
||||
},
|
||||
offsets: {
|
||||
type: new GraphQLList(GraphQLInt),
|
||||
description: 'The sector offset of each track on the disc.'
|
||||
},
|
||||
sectors: {
|
||||
type: new GraphQLNonNull(GraphQLInt),
|
||||
description: 'The sector offset of the lead-out (the end of the disc).'
|
||||
},
|
||||
releases: {
|
||||
type: ReleaseConnection,
|
||||
description: 'The list of releases linked to this disc ID.',
|
||||
args: forwardConnectionArgs,
|
||||
resolve: resolveDiscReleases
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
@ -5,6 +5,7 @@ export { default as Entity, EntityConnection } from './entity'
|
|||
export { default as Area, AreaConnection } from './area'
|
||||
export { default as Artist, ArtistConnection } from './artist'
|
||||
export { default as Collection, CollectionConnection } from './collection'
|
||||
export { default as Disc } from './disc'
|
||||
export { default as Event, EventConnection } from './event'
|
||||
export { default as Instrument, InstrumentConnection } from './instrument'
|
||||
export { default as Label, LabelConnection } from './label'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
import { GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql/type'
|
||||
import {
|
||||
GraphQLObjectType,
|
||||
GraphQLList,
|
||||
GraphQLString,
|
||||
GraphQLInt
|
||||
} from 'graphql/type'
|
||||
import Disc from './disc'
|
||||
import { resolveHyphenated, fieldWithID } from './helpers'
|
||||
|
||||
export default new GraphQLObjectType({
|
||||
|
|
@ -26,6 +32,10 @@ multi-disc release).`
|
|||
type: GraphQLInt,
|
||||
description: 'The number of audio tracks on this medium.',
|
||||
resolve: resolveHyphenated
|
||||
},
|
||||
discs: {
|
||||
type: new GraphQLList(Disc),
|
||||
description: 'A list of physical discs and their disc IDs for this medium.'
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ import { toDashed } from './helpers'
|
|||
|
||||
const debug = require('debug')('graphbrainz:types/node')
|
||||
|
||||
const TYPE_MODULES = {
|
||||
discid: 'disc'
|
||||
}
|
||||
|
||||
const { nodeInterface, nodeField } = nodeDefinitions(
|
||||
(globalID, { loaders }) => {
|
||||
const { type, id } = fromGlobalId(globalID)
|
||||
|
|
@ -10,10 +14,11 @@ const { nodeInterface, nodeField } = nodeDefinitions(
|
|||
return loaders.lookup.load([entityType, id])
|
||||
},
|
||||
(obj) => {
|
||||
const type = TYPE_MODULES[obj._type] || obj._type
|
||||
try {
|
||||
return require(`./${obj._type}`).default
|
||||
return require(`./${type}`).default
|
||||
} catch (err) {
|
||||
debug(`Failed to load type: ${obj._type}`)
|
||||
debug(`Failed to load type: ${type}`)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
|
|
|||
BIN
test/fixtures/09cfb1f92b3dd549c5bedb798a351677
vendored
Normal file
BIN
test/fixtures/09cfb1f92b3dd549c5bedb798a351677
vendored
Normal file
Binary file not shown.
29
test/fixtures/09cfb1f92b3dd549c5bedb798a351677.headers
vendored
Normal file
29
test/fixtures/09cfb1f92b3dd549c5bedb798a351677.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:17 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "653",
|
||||
"x-ratelimit-reset": "1481687778",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"32d2057bf6fa9b346b4121c127424148\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/hcwQmxWsG3GdAQvfBa1SCpp4FuU-?fmt=json",
|
||||
"time": 578,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831
vendored
Normal file
BIN
test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831
vendored
Normal file
Binary file not shown.
29
test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831.headers
vendored
Normal file
29
test/fixtures/0ef72077f3a9b6c1962b15d7fe3ce831.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:55 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "633",
|
||||
"x-ratelimit-reset": "1481687756",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"8efbe85e770c94f1eafaa164979660c3\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/5JmJmTPkKkYLm2QFsIh1mpjIBsQ-?fmt=json",
|
||||
"time": 657,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/2f9e4c201203a33929006daf7b750f02
vendored
Normal file
BIN
test/fixtures/2f9e4c201203a33929006daf7b750f02
vendored
Normal file
Binary file not shown.
29
test/fixtures/2f9e4c201203a33929006daf7b750f02.headers
vendored
Normal file
29
test/fixtures/2f9e4c201203a33929006daf7b750f02.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:50 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "433",
|
||||
"x-ratelimit-reset": "1481687750",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"57593d2c6412c5ed2525116fbe713e6f\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/TMXdzZkTcc9Jq24PD0w5J9_AXms-?fmt=json",
|
||||
"time": 425,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/42f40bd6ce862b553415369e4aae5c78
vendored
Normal file
BIN
test/fixtures/42f40bd6ce862b553415369e4aae5c78
vendored
Normal file
Binary file not shown.
29
test/fixtures/42f40bd6ce862b553415369e4aae5c78.headers
vendored
Normal file
29
test/fixtures/42f40bd6ce862b553415369e4aae5c78.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:06 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "421",
|
||||
"x-ratelimit-reset": "1481687766",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"4d10c2fe9b1985981a2a09cfe63354c7\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/Wk7n0EOphIdSwVG38ICTgVxKH3k-?fmt=json",
|
||||
"time": 577,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/46531076b098c8c871b33d19c26a8238
vendored
Normal file
BIN
test/fixtures/46531076b098c8c871b33d19c26a8238
vendored
Normal file
Binary file not shown.
29
test/fixtures/46531076b098c8c871b33d19c26a8238.headers
vendored
Normal file
29
test/fixtures/46531076b098c8c871b33d19c26a8238.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:06 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "424",
|
||||
"x-ratelimit-reset": "1481687766",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"e2dd87c51ca853754ac123b68d9fb091\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/OlFYu35KMh5W5A8rS2npaC5iOOA-?fmt=json",
|
||||
"time": 584,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd
vendored
Normal file
BIN
test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd
vendored
Normal file
Binary file not shown.
29
test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd.headers
vendored
Normal file
29
test/fixtures/4a4a2484d3a51083d527e0d09c78d2bd.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:11 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "554",
|
||||
"x-ratelimit-reset": "1481687772",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"46ab7ed9acc3d2f5050133ed1c09d5b4\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/ZQApCKC13fLDKtoelWo0nUXSlDI-?fmt=json",
|
||||
"time": 678,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/4d223095d0a662328e7304f0e22d7cd5
vendored
Normal file
BIN
test/fixtures/4d223095d0a662328e7304f0e22d7cd5
vendored
Normal file
Binary file not shown.
29
test/fixtures/4d223095d0a662328e7304f0e22d7cd5.headers
vendored
Normal file
29
test/fixtures/4d223095d0a662328e7304f0e22d7cd5.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:00 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "328",
|
||||
"x-ratelimit-reset": "1481687760",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"baf39b8ec310f75c4879e425278c87ee\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/LJbrPXYlRQOp92.q09PsOJIDp64-?fmt=json",
|
||||
"time": 565,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca
vendored
Normal file
BIN
test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca
vendored
Normal file
Binary file not shown.
29
test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca.headers
vendored
Normal file
29
test/fixtures/4e2b1581f7cb0bbd3c5e40c83b0695ca.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:55 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "629",
|
||||
"x-ratelimit-reset": "1481687756",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"8c8694ef7998292fb0e5aee9273bfc9c\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/8jTZJTgjGGtKjwdt8UyAgK3DnbY-?fmt=json",
|
||||
"time": 667,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/50eed45006ac687345f88f82f940541c
vendored
Normal file
BIN
test/fixtures/50eed45006ac687345f88f82f940541c
vendored
Normal file
Binary file not shown.
29
test/fixtures/50eed45006ac687345f88f82f940541c.headers
vendored
Normal file
29
test/fixtures/50eed45006ac687345f88f82f940541c.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:11 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "557",
|
||||
"x-ratelimit-reset": "1481687772",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"4a5adcd26ec43e7c51b0f6507bebc96d\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/X4z7DwTJvy7TM.kmgxMsULXhXE4-?fmt=json",
|
||||
"time": 600,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/5587cbca6ce9cbeb52754f32f8720461
vendored
Normal file
BIN
test/fixtures/5587cbca6ce9cbeb52754f32f8720461
vendored
Normal file
Binary file not shown.
29
test/fixtures/5587cbca6ce9cbeb52754f32f8720461.headers
vendored
Normal file
29
test/fixtures/5587cbca6ce9cbeb52754f32f8720461.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:55 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "623",
|
||||
"x-ratelimit-reset": "1481687756",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"614ec88016c46be66c850f4681039414\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/BTRGIyOdiZ9zJWqrOdTpo5l6RNY-?fmt=json",
|
||||
"time": 633,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/5eaca7f373d448e50af4f742153d551a
vendored
Normal file
BIN
test/fixtures/5eaca7f373d448e50af4f742153d551a
vendored
Normal file
Binary file not shown.
29
test/fixtures/5eaca7f373d448e50af4f742153d551a.headers
vendored
Normal file
29
test/fixtures/5eaca7f373d448e50af4f742153d551a.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:55 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "628",
|
||||
"x-ratelimit-reset": "1481687756",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"cda0e7ee08880dfac7d510261e1914d0\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/JqKqVx.6RyPF63qiq.UkZKL1amc-?fmt=json",
|
||||
"time": 657,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9
vendored
Normal file
BIN
test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9
vendored
Normal file
Binary file not shown.
29
test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9.headers
vendored
Normal file
29
test/fixtures/6100bf95f6a2fc73a34ce80de76b2ea9.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:17 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "648",
|
||||
"x-ratelimit-reset": "1481687778",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"1e23b4d88952ed276b5a0c139ffb5982\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/iyuUxXxwVb95qzws9gT.0p.NNS0-?fmt=json",
|
||||
"time": 595,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/7d26defc18d36a78fa294252c2929aba
vendored
Normal file
BIN
test/fixtures/7d26defc18d36a78fa294252c2929aba
vendored
Normal file
Binary file not shown.
29
test/fixtures/7d26defc18d36a78fa294252c2929aba.headers
vendored
Normal file
29
test/fixtures/7d26defc18d36a78fa294252c2929aba.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:11 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "558",
|
||||
"x-ratelimit-reset": "1481687772",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"dac58f112dc22a1767c7308c353b7ddc\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/YgQIINbxyNhTDK5Iyot3I9irp3c-?fmt=json",
|
||||
"time": 634,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/84c5658a165655d0beea1840cc65b29e
vendored
Normal file
BIN
test/fixtures/84c5658a165655d0beea1840cc65b29e
vendored
Normal file
Binary file not shown.
29
test/fixtures/84c5658a165655d0beea1840cc65b29e.headers
vendored
Normal file
29
test/fixtures/84c5658a165655d0beea1840cc65b29e.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:00 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "326",
|
||||
"x-ratelimit-reset": "1481687760",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"b4482322628423dfefc67b264b740ed4\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/KfzSur0dV4W.P4zSxxNnF0eUvwQ-?fmt=json",
|
||||
"time": 623,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/87a55fd7ad8a5996efd9fa87a188decb
vendored
Normal file
BIN
test/fixtures/87a55fd7ad8a5996efd9fa87a188decb
vendored
Normal file
Binary file not shown.
29
test/fixtures/87a55fd7ad8a5996efd9fa87a188decb.headers
vendored
Normal file
29
test/fixtures/87a55fd7ad8a5996efd9fa87a188decb.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:37:16 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "632",
|
||||
"x-ratelimit-reset": "1481686638",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"69c1c2b6e13b63f4ed96767f4db1b2a9\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/release/7f6d3088-837d-495e-905f-be5c70ac2d82?inc=media%2Bdiscids&fmt=json",
|
||||
"time": 522,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/8b531977c80772b52f69fa86983fb719
vendored
Normal file
BIN
test/fixtures/8b531977c80772b52f69fa86983fb719
vendored
Normal file
Binary file not shown.
29
test/fixtures/8b531977c80772b52f69fa86983fb719.headers
vendored
Normal file
29
test/fixtures/8b531977c80772b52f69fa86983fb719.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:50 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "333",
|
||||
"x-ratelimit-reset": "1481687750",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"74fcc7a55c8bf1b95b3c890d7ae26868\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/rKs_PWM2y.8B7uVgxqJqzTDz7vs-?fmt=json",
|
||||
"time": 443,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/8e96f4f0200526a12901b8b3f596cd5e
vendored
Normal file
BIN
test/fixtures/8e96f4f0200526a12901b8b3f596cd5e
vendored
Normal file
Binary file not shown.
29
test/fixtures/8e96f4f0200526a12901b8b3f596cd5e.headers
vendored
Normal file
29
test/fixtures/8e96f4f0200526a12901b8b3f596cd5e.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:11 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "551",
|
||||
"x-ratelimit-reset": "1481687772",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"784303af8cc0139a7dfb83ab641f799e\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/dT0qfu73Iao5WeycmQB3MOWJ3F8-?fmt=json",
|
||||
"time": 625,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/942f9d096b7e5f2a79cf945af616c347
vendored
Normal file
BIN
test/fixtures/942f9d096b7e5f2a79cf945af616c347
vendored
Normal file
Binary file not shown.
29
test/fixtures/942f9d096b7e5f2a79cf945af616c347.headers
vendored
Normal file
29
test/fixtures/942f9d096b7e5f2a79cf945af616c347.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:05:17 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "431",
|
||||
"x-ratelimit-reset": "1481684718",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"377590d5c3592441ed13c98359ec88ba\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/release/a4864e94-6d75-4ade-bc93-0dabf3521453?inc=media%2Bdiscids&fmt=json",
|
||||
"time": 405,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/9fe6edd3110d84cfd764cab7344c3061
vendored
Normal file
BIN
test/fixtures/9fe6edd3110d84cfd764cab7344c3061
vendored
Normal file
Binary file not shown.
29
test/fixtures/9fe6edd3110d84cfd764cab7344c3061.headers
vendored
Normal file
29
test/fixtures/9fe6edd3110d84cfd764cab7344c3061.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:06 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "422",
|
||||
"x-ratelimit-reset": "1481687766",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"99f9bf6fb616eef573908b2cdee82ade\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/OpEqBUFSMylTQ_KyaQMw0CFjeBQ-?fmt=json",
|
||||
"time": 589,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/a97a8246ca686a803bc85880341f01f7
vendored
Normal file
BIN
test/fixtures/a97a8246ca686a803bc85880341f01f7
vendored
Normal file
Binary file not shown.
29
test/fixtures/a97a8246ca686a803bc85880341f01f7.headers
vendored
Normal file
29
test/fixtures/a97a8246ca686a803bc85880341f01f7.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:55 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "630",
|
||||
"x-ratelimit-reset": "1481687756",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"eccd78e3af3df2654ec5989d8fca8a72\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/6S.Rie5e4noRyrN6Jf.styseKak-?fmt=json",
|
||||
"time": 596,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/ad145d4c621f3570ce7f13ae70291eec
vendored
Normal file
BIN
test/fixtures/ad145d4c621f3570ce7f13ae70291eec
vendored
Normal file
Binary file not shown.
29
test/fixtures/ad145d4c621f3570ce7f13ae70291eec.headers
vendored
Normal file
29
test/fixtures/ad145d4c621f3570ce7f13ae70291eec.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:11 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "553",
|
||||
"x-ratelimit-reset": "1481687772",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"6bf1abc5131d83247f11aba2cea66e92\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/ZpxxNqBzOe1KJQUSJotRAdo1FAA-?fmt=json",
|
||||
"time": 622,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f
vendored
Normal file
BIN
test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f
vendored
Normal file
Binary file not shown.
29
test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f.headers
vendored
Normal file
29
test/fixtures/adf2f53c6377e95ec5bd1fcb502c403f.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:00 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "317",
|
||||
"x-ratelimit-reset": "1481687760",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"a74c03111a54b918359bdeb053ddbaf2\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/MRmVoUlZOvKGZFxixVTsalKWr1Y-?fmt=json",
|
||||
"time": 605,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/afe809da6a1182c06e0b3a6016806801
vendored
Normal file
BIN
test/fixtures/afe809da6a1182c06e0b3a6016806801
vendored
Normal file
Binary file not shown.
29
test/fixtures/afe809da6a1182c06e0b3a6016806801.headers
vendored
Normal file
29
test/fixtures/afe809da6a1182c06e0b3a6016806801.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:06 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "427",
|
||||
"x-ratelimit-reset": "1481687766",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"b96f6e53db8de36a9636aaf43ec81d81\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/Nxl.5VZyyw0PwNZmfKOjUo.hNHQ-?fmt=json",
|
||||
"time": 568,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/b31e543dce9796e06556a651cc9856c2
vendored
Normal file
BIN
test/fixtures/b31e543dce9796e06556a651cc9856c2
vendored
Normal file
Binary file not shown.
29
test/fixtures/b31e543dce9796e06556a651cc9856c2.headers
vendored
Normal file
29
test/fixtures/b31e543dce9796e06556a651cc9856c2.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:06 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "425",
|
||||
"x-ratelimit-reset": "1481687766",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"8f6f3f31f4a37066b07ac26d78ea1fa4\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/MvkF2QCiXS.tu7kJYnDfAX2A6II-?fmt=json",
|
||||
"time": 580,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/b867d371abb4b963b6f68cbfc103f644
vendored
Normal file
BIN
test/fixtures/b867d371abb4b963b6f68cbfc103f644
vendored
Normal file
Binary file not shown.
29
test/fixtures/b867d371abb4b963b6f68cbfc103f644.headers
vendored
Normal file
29
test/fixtures/b867d371abb4b963b6f68cbfc103f644.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:00 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "319",
|
||||
"x-ratelimit-reset": "1481687760",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"4e8503a236dbcbe9d5583f5a684fb8ec\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/M5ef947_b48iguGQaG.URuoqfXE-?fmt=json",
|
||||
"time": 616,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/c5e74502a62b5e330f0e44f9daece6ec
vendored
Normal file
BIN
test/fixtures/c5e74502a62b5e330f0e44f9daece6ec
vendored
Normal file
Binary file not shown.
29
test/fixtures/c5e74502a62b5e330f0e44f9daece6ec.headers
vendored
Normal file
29
test/fixtures/c5e74502a62b5e330f0e44f9daece6ec.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:17 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "645",
|
||||
"x-ratelimit-reset": "1481687778",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"2e7a8dbce2d08bb993c31df65d154fb2\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/mWEN0CB96pflhED60JyFNhrEvMc-?fmt=json",
|
||||
"time": 598,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/cd5ea3df3b6164f9b021690a01da1424
vendored
Normal file
BIN
test/fixtures/cd5ea3df3b6164f9b021690a01da1424
vendored
Normal file
Binary file not shown.
29
test/fixtures/cd5ea3df3b6164f9b021690a01da1424.headers
vendored
Normal file
29
test/fixtures/cd5ea3df3b6164f9b021690a01da1424.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:17 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "642",
|
||||
"x-ratelimit-reset": "1481687778",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"31e7cc9a9174e173c88d4618b238f8ac\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/jmIgyOvnkIgc_1nIfGOzq1tZy.g-?fmt=json",
|
||||
"time": 598,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/cdfa24feec8a751a9257cba4c542ca08
vendored
Normal file
BIN
test/fixtures/cdfa24feec8a751a9257cba4c542ca08
vendored
Normal file
Binary file not shown.
29
test/fixtures/cdfa24feec8a751a9257cba4c542ca08.headers
vendored
Normal file
29
test/fixtures/cdfa24feec8a751a9257cba4c542ca08.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:55:50 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "331",
|
||||
"x-ratelimit-reset": "1481687750",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"b47b135de1ba186aaacb5cf1899a3cfc\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/ZODzHFPuY6DfakUIAd7bTSne224-?fmt=json",
|
||||
"time": 418,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2
vendored
Normal file
BIN
test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2
vendored
Normal file
Binary file not shown.
29
test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2.headers
vendored
Normal file
29
test/fixtures/d202c6a6d4935cbe9f922833b3fa14d2.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:22 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "306",
|
||||
"x-ratelimit-reset": "1481687782",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"94a1d89e4094492980cc3c59a43bfaa7\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/vnTnHXtoa0q35uGdb80jCbMY0fI-?fmt=json",
|
||||
"time": 616,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/dce546fb301927f48b5a344af5157931
vendored
Normal file
BIN
test/fixtures/dce546fb301927f48b5a344af5157931
vendored
Normal file
Binary file not shown.
29
test/fixtures/dce546fb301927f48b5a344af5157931.headers
vendored
Normal file
29
test/fixtures/dce546fb301927f48b5a344af5157931.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:00 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "320",
|
||||
"x-ratelimit-reset": "1481687760",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"18ffe91f797d0ac3f7bb5f55afe8af9e\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/Ljf3f57fCuw7rpaaa5eXOQz.7iQ-?fmt=json",
|
||||
"time": 612,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/e2e06e403837e86ba8a0f80693d2e189
vendored
Normal file
BIN
test/fixtures/e2e06e403837e86ba8a0f80693d2e189
vendored
Normal file
Binary file not shown.
29
test/fixtures/e2e06e403837e86ba8a0f80693d2e189.headers
vendored
Normal file
29
test/fixtures/e2e06e403837e86ba8a0f80693d2e189.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:17 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "651",
|
||||
"x-ratelimit-reset": "1481687778",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"ed7b1e67a098c033f07a041ffa76a998\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/eRs4VG66pPW2MqTunBs9dEZTm9A-?fmt=json",
|
||||
"time": 564,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
test/fixtures/fd7b5af8b59c7fe254b576ea6c206774
vendored
Normal file
BIN
test/fixtures/fd7b5af8b59c7fe254b576ea6c206774
vendored
Normal file
Binary file not shown.
29
test/fixtures/fd7b5af8b59c7fe254b576ea6c206774.headers
vendored
Normal file
29
test/fixtures/fd7b5af8b59c7fe254b576ea6c206774.headers
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"statusCode": 200,
|
||||
"headers": {
|
||||
"date": "Wed, 14 Dec 2016 03:56:22 GMT",
|
||||
"content-type": "application/json; charset=utf-8",
|
||||
"transfer-encoding": "chunked",
|
||||
"connection": "keep-alive",
|
||||
"keep-alive": "timeout=15",
|
||||
"vary": "Accept-Encoding",
|
||||
"x-ratelimit-limit": "700",
|
||||
"x-ratelimit-remaining": "304",
|
||||
"x-ratelimit-reset": "1481687782",
|
||||
"server": "Plack::Handler::Starlet",
|
||||
"etag": "W/\"87d86129dfb94d7fb7710f38e30c4605\"",
|
||||
"access-control-allow-origin": "*",
|
||||
"content-encoding": "gzip"
|
||||
},
|
||||
"url": "http://musicbrainz.org:80/ws/2/discid/tH_cY6hcuSDeTuG6GSWI4wp_x6E-?fmt=json",
|
||||
"time": 619,
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"headers": {
|
||||
"User-Agent": "graphbrainz/4.4.0 ( https://github.com/exogen/graphbrainz )",
|
||||
"host": "musicbrainz.org",
|
||||
"accept-encoding": "gzip, deflate",
|
||||
"accept": "application/json"
|
||||
}
|
||||
}
|
||||
}
|
||||
124
test/schema.js
124
test/schema.js
|
|
@ -907,3 +907,127 @@ test('some entities support ratings', testData, `
|
|||
t.true(releaseGroups.some(releaseGroup => releaseGroup.rating.voteCount > 0))
|
||||
t.true(releaseGroups.some(releaseGroup => releaseGroup.rating.value > 3))
|
||||
})
|
||||
|
||||
test('discs can be looked up by disc ID', testData, `
|
||||
{
|
||||
lookup {
|
||||
disc(discID: "TMXdzZkTcc9Jq24PD0w5J9_AXms-") {
|
||||
id
|
||||
discID
|
||||
offsetCount
|
||||
offsets
|
||||
sectors
|
||||
releases {
|
||||
totalCount
|
||||
edges {
|
||||
node {
|
||||
mbid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`, (t, data) => {
|
||||
const { disc } = data.lookup
|
||||
t.is(disc.discID, 'TMXdzZkTcc9Jq24PD0w5J9_AXms-')
|
||||
t.is(disc.offsetCount, 9)
|
||||
t.is(disc.sectors, 193443)
|
||||
t.deepEqual(disc.offsets, [
|
||||
150, 18190, 34163, 66150, 87453, 116853, 151413, 166833, 184123
|
||||
])
|
||||
t.is(disc.releases.totalCount, 1)
|
||||
t.is(disc.releases.edges.length, 1)
|
||||
t.is(disc.releases.edges[0].node.mbid, '7f6d3088-837d-495e-905f-be5c70ac2d82')
|
||||
})
|
||||
|
||||
test('release media has a list of discs', testData, `
|
||||
{
|
||||
lookup {
|
||||
release(mbid: "7f6d3088-837d-495e-905f-be5c70ac2d82") {
|
||||
media {
|
||||
discs {
|
||||
discID
|
||||
releases {
|
||||
totalCount
|
||||
edges {
|
||||
node {
|
||||
mbid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`, (t, data) => {
|
||||
const { release } = data.lookup
|
||||
t.is(release.media.length, 1)
|
||||
t.is(release.media[0].discs.length, 2)
|
||||
})
|
||||
|
||||
test('disc queries can be deeply nested', testData, `
|
||||
{
|
||||
lookup {
|
||||
disc(discID: "TMXdzZkTcc9Jq24PD0w5J9_AXms-") {
|
||||
discID
|
||||
offsetCount
|
||||
offsets
|
||||
sectors
|
||||
releases {
|
||||
totalCount
|
||||
edges {
|
||||
node {
|
||||
mbid
|
||||
title
|
||||
date
|
||||
media {
|
||||
discs {
|
||||
discID
|
||||
releases {
|
||||
edges {
|
||||
node {
|
||||
date
|
||||
media {
|
||||
discs {
|
||||
discID
|
||||
releases {
|
||||
edges {
|
||||
node {
|
||||
date
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`, (t, data) => {
|
||||
const { disc } = data.lookup
|
||||
t.true(disc.releases.edges.length > 0)
|
||||
disc.releases.edges.forEach(release => {
|
||||
t.true(release.node.media.length > 0)
|
||||
release.node.media.forEach(medium => {
|
||||
t.true(medium.discs.length > 0)
|
||||
medium.discs.forEach(disc => {
|
||||
t.true(disc.releases.edges.length > 0)
|
||||
disc.releases.edges.forEach(release => {
|
||||
t.true(release.node.media.length > 0)
|
||||
release.node.media.forEach(medium => {
|
||||
t.true(medium.discs.length > 0)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue