Optionaloptions: { origin?: string; userAgent?: string }Returns a qualified image URL for a barcode representing a given UPC
the UPC value
Optionaloptions: { label?: boolean; width?: number }options for creating the image
URL to the barcode image
Optionalinput: BidirectionalPaginationQuery<BoxsetFilterInput, BoxsetSortInput>Optionalselect: SelectionUsing a precalculated global disc ID and/or content hash, find a unique disc with its nested releases and media items.
Most discs in the database have a content hash, but the global ID is slightly easier to obtain due to its use in other tools.
the ID and/or hash of the disc
matching disc with releases
Returns a qualified image URL from a path. If only one dimension is provided, the other dimension will be resized automatically, maintaining the original aspect ratio.
Optionaloptions: { height?: number; width?: number }Returns a matching media item (movies/series) with releases that contain
a disc with the specified hash and details for the disc. There may be
multiple releases and media items with the same disc. This method will
only return the first media item, use getMediaItemsByDiscHashes to
receive all results.
the disc hash (from hashDisc)
matching media item
Fetch a media item by its external database IDs. If there are multiple results (e.g you provided IDs for items that are not the same), only the first result will be returned.
Database items are created with their TMDB association, so every item should have one. If you only have an IMDb or TVDB ID, you may find more success if you first consult TMDB:
one or multiple IDs with which to try to identify the item.
a matching media item
Returns multiple matching media items (movies/series) with releases that contain a disc with the specified hash and details for the disc. There may be multiple releases and media items with the same disc.
Hashes with no matches will still be in the resulting record, but with an empty array.
the disc hashes (from hashDisc)
a mapping of disc hashes to media item arrays
Get all media items which are "tagged" with a specific group. This is used by TheDiscDB to identify cast, crew, genres, and studios.
group slug, e.g. comedy, jim-carrey, a24
Optionalrole: MediaItemGroupRolenarrow results by role, useful in removing irrelevant results
Optionalinput: BidirectionalPaginationQuery<MediaItemFilterInput, MediaItemSortInput>input & pagination options
media items and page info
Fetch a release by its URL slugs, useful for resolving a user-provided link.
the slug for the media item as a whole on thediscdb.com
the slug for just the release on thediscdb.com
a matching release with required mediaItem prop, whose
releases array contains all releases for the media item other
than the one requested.
Fetch a release by its Universal Product Code (UPC).
the upc for the release, a 12-digit number
Ask the server to hash a disc's files. It should be preferred to do this locally when possible.
This could be used to hash files uploaded to a web form on a browser that does not support the filesystem API (not tested - relies on date modified instead of date created, which are often the same, but perhaps not always)
details for the relevant files from the disc.
.m2ts file in BDMV/STREAMthe computed hash
Search media items and boxsets.
Search string to find results with. The effective minimum query length is 2.
Optionaloptions: { limit: number }Truncate the number of results returned. I have seen up to 467 results without providing a limit.
const results = await discdb.search("the mummy", { limit: 50 });
console.log(results);
// [
// {
// key: "movie-the-mummy-1999",
// type: SearchType.Movie,
// title: "The Mummy",
// slug: "the-mummy-1999",
// imageUrl: "Movie/the-mummy-1999/cover.jpg",
// relativeUrl: "/movie/the-mummy-1999",
// externalIds: {
// imdb: "tt0120616",
// tmdb: 564,
// upc: 191329243763,
// asin: "B0C25X1883",
// },
// groups: [],
// },
// // ...
// {
// key: "boxset-the-mummy-trilogy-4k",
// type: SearchType.Boxset,
// title: "The Mummy Trilogy 4K",
// slug: "the-mummy-trilogy-4k",
// imageUrl: "boxset/the-mummy-trilogy-4k.jpg",
// relativeUrl: "/boxset/the-mummy-trilogy-4k",
// externalIds: {},
// groups: [],
// },
// // ...
// ]
Internal, typed GraphQL client that may be used to bypass wrapper logic or compose custom queries