|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import BaseNodeBrainz from 'nodebrainz';
|
|
|
|
|
import type {
|
|
|
|
|
Artist,
|
|
|
|
|
ArtistCredit,
|
|
|
|
|
Group,
|
|
|
|
|
mbArtist,
|
|
|
|
@ -13,6 +14,7 @@ import type {
|
|
|
|
|
Release,
|
|
|
|
|
SearchOptions,
|
|
|
|
|
Tag,
|
|
|
|
|
Track,
|
|
|
|
|
Work,
|
|
|
|
|
} from './interfaces';
|
|
|
|
|
import { mbArtistType, mbReleaseGroupType, mbWorkType } from './interfaces';
|
|
|
|
@ -172,6 +174,114 @@ function searchOptionstoWorkSearchOptions(
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertRelease(release: Release): mbRelease {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'release',
|
|
|
|
|
id: release.id,
|
|
|
|
|
title: release.title,
|
|
|
|
|
artist: release['artist-credit'].map(convertArtistCredit),
|
|
|
|
|
date:
|
|
|
|
|
release['release-events'] && release['release-events'].length > 0
|
|
|
|
|
? new Date(String(release['release-events'][0].date))
|
|
|
|
|
: undefined,
|
|
|
|
|
tracks: release.media.flatMap(convertMedium),
|
|
|
|
|
tags: release.tags.map(convertTag),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertReleaseGroup(releaseGroup: Group): mbReleaseGroup {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'release-group',
|
|
|
|
|
id: releaseGroup.id,
|
|
|
|
|
title: releaseGroup.title,
|
|
|
|
|
artist: releaseGroup['artist-credit'].map(convertArtistCredit),
|
|
|
|
|
type:
|
|
|
|
|
(releaseGroup['primary-type'] as mbReleaseGroupType) ||
|
|
|
|
|
mbReleaseGroupType.OTHER,
|
|
|
|
|
firstReleased: new Date(releaseGroup['first-release-date']),
|
|
|
|
|
tags: releaseGroup.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertRecording(recording: Recording): mbRecording {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'recording',
|
|
|
|
|
id: recording.id,
|
|
|
|
|
title: recording.title,
|
|
|
|
|
artist: recording['artist-credit'].map(convertArtistCredit),
|
|
|
|
|
length: recording.length,
|
|
|
|
|
firstReleased: new Date(recording['first-release-date']),
|
|
|
|
|
tags: recording.tags.map(convertTag),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertArtist(artist: Artist): mbArtist {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'artist',
|
|
|
|
|
id: artist.id,
|
|
|
|
|
name: artist.name,
|
|
|
|
|
sortName: artist['sort-name'],
|
|
|
|
|
type: (artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
recordings: artist.recordings.map(convertRecording),
|
|
|
|
|
releases: artist.releases.map(convertRelease),
|
|
|
|
|
releaseGroups: artist['release-groups'].map(convertReleaseGroup),
|
|
|
|
|
works: artist.works.map(convertWork),
|
|
|
|
|
tags: artist.tags.map(convertTag),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertWork(work: Work): mbWork {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'work',
|
|
|
|
|
id: work.id,
|
|
|
|
|
title: work.title,
|
|
|
|
|
type: (work.type as mbWorkType) || mbWorkType.OTHER,
|
|
|
|
|
artist: work.relations.map(convertRelation),
|
|
|
|
|
tags: work.tags.map(convertTag),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertArtistCredit(artistCredit: ArtistCredit): mbArtist {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'artist',
|
|
|
|
|
id: artistCredit.artist.id,
|
|
|
|
|
name: artistCredit.artist.name,
|
|
|
|
|
sortName: artistCredit.artist['sort-name'],
|
|
|
|
|
type: (artistCredit.artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: artistCredit.artist.tags.map(convertTag),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertRelation(relation: Relation): mbArtist {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'artist',
|
|
|
|
|
id: relation.artist.id,
|
|
|
|
|
name: relation.artist.name,
|
|
|
|
|
sortName: relation.artist['sort-name'],
|
|
|
|
|
type: (relation.artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: relation.artist.tags.map(convertTag),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertTag(tag: Tag): string {
|
|
|
|
|
return tag.name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertMedium(medium: Medium): mbRecording[] {
|
|
|
|
|
return (medium.tracks ?? []).map(convertTrack);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function convertTrack(track: Track): mbRecording {
|
|
|
|
|
return {
|
|
|
|
|
media_type: 'recording',
|
|
|
|
|
id: track.id,
|
|
|
|
|
title: track.title,
|
|
|
|
|
artist: track.recording['artist-credit'].map(convertArtistCredit),
|
|
|
|
|
length: track.recording.length,
|
|
|
|
|
tags: track.recording.tags.map(convertTag),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
constructor() {
|
|
|
|
|
super({
|
|
|
|
@ -180,7 +290,7 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public searchMulti = async (search: SearchOptions) => {
|
|
|
|
|
public searchMulti = (search: SearchOptions) => {
|
|
|
|
|
try {
|
|
|
|
|
const artistSearch = searchOptionstoArtistSearchOptions(search);
|
|
|
|
|
const recordingSearch = searchOptionstoRecordingSearchOptions(search);
|
|
|
|
@ -188,13 +298,11 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
searchOptionstoReleaseGroupSearchOptions(search);
|
|
|
|
|
const releaseSearch = searchOptionstoReleaseSearchOptions(search);
|
|
|
|
|
const workSearch = searchOptionstoWorkSearchOptions(search);
|
|
|
|
|
const artistResults = await this.searchArtists(artistSearch);
|
|
|
|
|
const recordingResults = await this.searchRecordings(recordingSearch);
|
|
|
|
|
const releaseGroupResults = await this.searchReleaseGroups(
|
|
|
|
|
releaseGroupSearch
|
|
|
|
|
);
|
|
|
|
|
const releaseResults = await this.searchReleases(releaseSearch);
|
|
|
|
|
const workResults = await this.searchWorks(workSearch);
|
|
|
|
|
const artistResults = this.searchArtists(artistSearch);
|
|
|
|
|
const recordingResults = this.searchRecordings(recordingSearch);
|
|
|
|
|
const releaseGroupResults = this.searchReleaseGroups(releaseGroupSearch);
|
|
|
|
|
const releaseResults = this.searchReleases(releaseSearch);
|
|
|
|
|
const workResults = this.searchWorks(workSearch);
|
|
|
|
|
|
|
|
|
|
const combinedResults = {
|
|
|
|
|
status: 'ok',
|
|
|
|
@ -218,138 +326,63 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public searchArtists = async (search: ArtistSearchOptions) => {
|
|
|
|
|
public searchArtists = (search: ArtistSearchOptions) => {
|
|
|
|
|
try {
|
|
|
|
|
const results = await this.search('artist', search);
|
|
|
|
|
const rawResults = this.search('artist', search) as Artist[];
|
|
|
|
|
const results = rawResults.map(convertArtist);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public searchRecordings = async (search: RecordingSearchOptions) => {
|
|
|
|
|
public searchRecordings = (search: RecordingSearchOptions) => {
|
|
|
|
|
try {
|
|
|
|
|
const results = await this.search('recording', search);
|
|
|
|
|
const rawResults = this.search('recording', search) as Recording[];
|
|
|
|
|
const results = rawResults.map(convertRecording);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public searchReleaseGroups = async (search: ReleaseGroupSearchOptions) => {
|
|
|
|
|
public searchReleaseGroups = (
|
|
|
|
|
search: ReleaseGroupSearchOptions
|
|
|
|
|
): mbReleaseGroup[] => {
|
|
|
|
|
try {
|
|
|
|
|
const results = await this.search('release-group', search);
|
|
|
|
|
const rawResults = this.search('release-group', search) as Group[];
|
|
|
|
|
const results = rawResults.map(convertReleaseGroup);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public searchReleases = async (search: ReleaseSearchOptions) => {
|
|
|
|
|
public searchReleases = (search: ReleaseSearchOptions): mbRelease[] => {
|
|
|
|
|
try {
|
|
|
|
|
const results = await this.search('release', search);
|
|
|
|
|
const rawResults = this.search('release', search) as Release[];
|
|
|
|
|
const results = rawResults.map(convertRelease);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public searchWorks = async (search: WorkSearchOptions) => {
|
|
|
|
|
public searchWorks = (search: WorkSearchOptions) => {
|
|
|
|
|
try {
|
|
|
|
|
const results = await this.search('work', search);
|
|
|
|
|
const results = this.search('work', search);
|
|
|
|
|
return results;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public getArtist = async (artistId: string): Promise<mbArtist> => {
|
|
|
|
|
public getArtist = (artistId: string): mbArtist => {
|
|
|
|
|
try {
|
|
|
|
|
const rawData = this.artist(artistId, {
|
|
|
|
|
inc: 'tags+recordings+releases+release-groups+works',
|
|
|
|
|
});
|
|
|
|
|
const artist: mbArtist = {
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
name: rawData.name,
|
|
|
|
|
sortName: rawData['sort-name'],
|
|
|
|
|
type: (rawData.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
recordings: rawData.recordings.map(
|
|
|
|
|
(recording: Recording): mbRecording => {
|
|
|
|
|
return {
|
|
|
|
|
id: recording.id,
|
|
|
|
|
artist: [
|
|
|
|
|
{
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
name: rawData.name,
|
|
|
|
|
sortName: rawData['sort-name'],
|
|
|
|
|
type: (rawData.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
title: recording.title,
|
|
|
|
|
length: recording.length,
|
|
|
|
|
tags: recording.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
releases: rawData.releases.map((release: Release): mbRelease => {
|
|
|
|
|
return {
|
|
|
|
|
id: release.id,
|
|
|
|
|
artist: [
|
|
|
|
|
{
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
name: rawData.name,
|
|
|
|
|
sortName: rawData['sort-name'],
|
|
|
|
|
type: (rawData.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
title: release.title,
|
|
|
|
|
date: new Date(String(release.date)),
|
|
|
|
|
tags: release.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}),
|
|
|
|
|
releaseGroups: rawData['release-groups'].map(
|
|
|
|
|
(releaseGroup: Group): mbReleaseGroup => {
|
|
|
|
|
return {
|
|
|
|
|
id: releaseGroup.id,
|
|
|
|
|
artist: [
|
|
|
|
|
{
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
name: rawData.name,
|
|
|
|
|
sortName: rawData['sort-name'],
|
|
|
|
|
type: (rawData.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
title: releaseGroup.title,
|
|
|
|
|
type:
|
|
|
|
|
(releaseGroup['primary-type'] as mbReleaseGroupType) ||
|
|
|
|
|
mbReleaseGroupType.OTHER,
|
|
|
|
|
firstReleased: new Date(releaseGroup['first-release-date']),
|
|
|
|
|
tags: releaseGroup.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
works: rawData.works.map((work: Work): mbWork => {
|
|
|
|
|
return {
|
|
|
|
|
id: work.id,
|
|
|
|
|
title: work.title,
|
|
|
|
|
type: (work.type as mbWorkType) || mbWorkType.OTHER,
|
|
|
|
|
artist: [
|
|
|
|
|
{
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
name: rawData.name,
|
|
|
|
|
sortName: rawData['sort-name'],
|
|
|
|
|
type: (rawData.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
tags: work.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}),
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
const artist: mbArtist = convertArtist(rawData);
|
|
|
|
|
return artist;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw new Error(
|
|
|
|
@ -358,29 +391,12 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public getRecording = async (recordingId: string): Promise<mbRecording> => {
|
|
|
|
|
public getRecording = (recordingId: string): mbRecording => {
|
|
|
|
|
try {
|
|
|
|
|
const rawData = this.recording(recordingId, {
|
|
|
|
|
inc: 'tags+artists+releases',
|
|
|
|
|
});
|
|
|
|
|
const recording: mbRecording = {
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
title: rawData.title,
|
|
|
|
|
artist: rawData['artist-credit'].map(
|
|
|
|
|
(artist: ArtistCredit): mbArtist => {
|
|
|
|
|
return {
|
|
|
|
|
id: artist.artist.id,
|
|
|
|
|
name: artist.artist.name,
|
|
|
|
|
sortName: artist.artist['sort-name'],
|
|
|
|
|
type: (artist.artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: artist.artist.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
length: rawData.length,
|
|
|
|
|
firstReleased: new Date(rawData['first-release-date']),
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
const recording: mbRecording = convertRecording(rawData);
|
|
|
|
|
return recording;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw new Error(
|
|
|
|
@ -389,33 +405,12 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public async getReleaseGroup(
|
|
|
|
|
releaseGroupId: string
|
|
|
|
|
): Promise<mbReleaseGroup> {
|
|
|
|
|
public getReleaseGroup(releaseGroupId: string): mbReleaseGroup {
|
|
|
|
|
try {
|
|
|
|
|
const rawData = this.releaseGroup(releaseGroupId, {
|
|
|
|
|
inc: 'tags+artists+releases',
|
|
|
|
|
});
|
|
|
|
|
const releaseGroup: mbReleaseGroup = {
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
title: rawData.title,
|
|
|
|
|
artist: rawData['artist-credit'].map(
|
|
|
|
|
(artist: ArtistCredit): mbArtist => {
|
|
|
|
|
return {
|
|
|
|
|
id: artist.artist.id,
|
|
|
|
|
name: artist.artist.name,
|
|
|
|
|
sortName: artist.artist['sort-name'],
|
|
|
|
|
type: (artist.artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: artist.artist.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
type:
|
|
|
|
|
(rawData['primary-type'] as mbReleaseGroupType) ||
|
|
|
|
|
mbReleaseGroupType.OTHER,
|
|
|
|
|
firstReleased: new Date(rawData['first-release-date']),
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
const releaseGroup: mbReleaseGroup = convertReleaseGroup(rawData);
|
|
|
|
|
return releaseGroup;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw new Error(
|
|
|
|
@ -424,51 +419,12 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async getRelease(releaseId: string): Promise<mbRelease> {
|
|
|
|
|
public getRelease(releaseId: string): mbRelease {
|
|
|
|
|
try {
|
|
|
|
|
const rawData = this.release(releaseId, {
|
|
|
|
|
inc: 'tags+artists+recordings',
|
|
|
|
|
});
|
|
|
|
|
const release: mbRelease = {
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
title: rawData.title,
|
|
|
|
|
artist: rawData['artist-credit'].map(
|
|
|
|
|
(artist: ArtistCredit): mbArtist => {
|
|
|
|
|
return {
|
|
|
|
|
id: artist.artist.id,
|
|
|
|
|
name: artist.artist.name,
|
|
|
|
|
sortName: artist.artist['sort-name'],
|
|
|
|
|
type: (artist.artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: artist.artist.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
),
|
|
|
|
|
date:
|
|
|
|
|
rawData['release-events'] && rawData['release-events'].length > 0
|
|
|
|
|
? new Date(String(rawData['release-events'][0].date))
|
|
|
|
|
: undefined,
|
|
|
|
|
tracks: rawData.media.flatMap((media: Medium): mbRecording[] => {
|
|
|
|
|
return (media.tracks ?? []).map((track): mbRecording => {
|
|
|
|
|
return {
|
|
|
|
|
id: track.id,
|
|
|
|
|
title: track.title,
|
|
|
|
|
artist: track.recording['artist-credit'].map((artist) => {
|
|
|
|
|
return {
|
|
|
|
|
id: artist.artist.id,
|
|
|
|
|
name: artist.artist.name,
|
|
|
|
|
sortName: artist.artist['sort-name'],
|
|
|
|
|
type:
|
|
|
|
|
(artist.artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: artist.artist.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}),
|
|
|
|
|
length: track.recording.length,
|
|
|
|
|
tags: track.recording.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
const release: mbRelease = convertRelease(rawData);
|
|
|
|
|
return release;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw new Error(
|
|
|
|
@ -477,24 +433,10 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async getWork(workId: string): Promise<mbWork> {
|
|
|
|
|
public getWork(workId: string): mbWork {
|
|
|
|
|
try {
|
|
|
|
|
const rawData = this.work(workId, { inc: 'tags+artist-rels' });
|
|
|
|
|
const work: mbWork = {
|
|
|
|
|
id: rawData.id,
|
|
|
|
|
title: rawData.title,
|
|
|
|
|
type: (rawData.type as mbWorkType) || mbWorkType.OTHER,
|
|
|
|
|
artist: rawData.relations.map((relation: Relation): mbArtist => {
|
|
|
|
|
return {
|
|
|
|
|
id: relation.artist.id,
|
|
|
|
|
name: relation.artist.name,
|
|
|
|
|
sortName: relation.artist['sort-name'],
|
|
|
|
|
type: (relation.artist.type as mbArtistType) || mbArtistType.OTHER,
|
|
|
|
|
tags: relation.artist.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
}),
|
|
|
|
|
tags: rawData.tags.map((tag: Tag) => tag.name),
|
|
|
|
|
};
|
|
|
|
|
const work: mbWork = convertWork(rawData);
|
|
|
|
|
return work;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
throw new Error(
|
|
|
|
@ -505,3 +447,11 @@ class MusicBrainz extends BaseNodeBrainz {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default MusicBrainz;
|
|
|
|
|
export type {
|
|
|
|
|
SearchOptions,
|
|
|
|
|
ArtistSearchOptions,
|
|
|
|
|
RecordingSearchOptions,
|
|
|
|
|
ReleaseSearchOptions,
|
|
|
|
|
ReleaseGroupSearchOptions,
|
|
|
|
|
WorkSearchOptions,
|
|
|
|
|
};
|
|
|
|
|