Each function in Helium requires that the data be returned in a format that Helium can understand.
More complex response types are described in TypeScript, which is a typed version of JavaScript that provides a better explanation of the expected data types.
The response types are listed below:
getScriptData: object
- name: string - The display name of the script
- supportsAlbumArtist: boolean - Set to true, if the script supports input in the form of artist and album. Used only with the script type scriptTypeTagDownloader.
- supportsBarcode: boolean - Set to true, if the script supports input in the form of barcode. Used only with the script type scriptTypeTagDownloader.
- supportsCatalognumber: boolean - Set to true, if the script supports input in the form of catalog number. Used only with the script type scriptTypeTagDownloader.
- scriptType: number - Defines the type of the script. See the API definition for more information.
getAlbumResults: object[]
This function returns a list of album matches, where a match is defined as follows in TypeScript:
class AlbumResult { id: string; title: string; format: string; label: string; catalogNumber: string; year: string; details: string; isCompleted: boolean; country: string; genre: string; style: string; artist: string; album: string; thumbnailUrl: string; resourceUrl: string; barcode: string; tracks: number; discCount: number; score: number; }
getAlbumWithTracks(id: string): object
This function returns a specific album match with all information about that album, including the track list, artist, and label information. This type is the most complex in Helium. For an example of how it is used, see musicbrainz-downloader.js.
class AlbumDetails { id: number; currentCD: number; totalCDs: number; title: string; sortTitle: string; artist: string; sortArtist: string; albumArtist: string; pictureFile: string; albumPictureURL: string; releaseYear: number; releaseDate: string; publisher: string; catalogNumber: string; composer: string; price: string; format: string; bitrate: string; trackList: TrackInformation[]; involvedPeople: InvolvedPerson[]; releaseType: ReleaseTypes; version: string; sortAlbum: string; sortAlbumArtist: string; barcode: string; genre: string; style: string; labelInformation: LabelInformation; // Definition below artistInformation: ArtistInformation; // Definition below }
TrackInformation has the following TypeScript definition:
class PluginTrackInformation { duration: number; title: string; titleSortOrder: string; subtitle: string; remix: string; artist: string; album: string; albumArtist: string; artistSortOrder: string; media: string; genre: string; currentTrack: number; totalTracks: number; currentCd: number; totalCds: number; releaseYear: number; recordingYear: number; releaseType: PluginReleaseTypes; label: string; comment: string; language: string; bpm: string; composer: string; lyrics: string; custom1: string; custom2: string; custom3: string; custom4: string; custom5: string; lyricist: string; produced: string; isrc: string; copyright: string; studio: string; albumSubtitle: string; partOfSeries: string; custom6: string; custom7: string; custom8: string; custom9: string; custom10: string; albumVersion: string; grouping: string; mood: string; situation: string; catalogNumber: string; musicians: InvolvedPerson[] = []; involvedPersons: InvolvedPerson[] = []; multipleArtists: MultipleArtist[] = []; originalArtist: string; originalTitle: string; originalLyricist: string; originalYear: number; rating: number; obscure: number; recordingDateMonth: number; recordingDateDay: number; releaseDateMonth: number; releaseDateDay: number; originalDateMonth: number; originalDateDay: number; albumSortOrder: string; albumArtistSortOrder: string; }
InvolvedPerson has the following TypeScript definition:
class InvolvedPerson { role: string; name: string; }
MultipleArtist has the following TypeScript definition:
class MultipleArtist { orderNumber: number; artist: string; artistSortOrder: string; artistFunction: string; }
ReleaseTypes has the following TypeScript definition:
enum ReleaseTypes { Unknown = 0, SingleMaxi = 1, Album = 2, Anthology = 3, Bootleg = 4, Sampler = 5, Soundtrack = 6, LivePerformance = 7, Compilation = 8, AudioBook = 9, SoundEffects = 10, Video = 11, DVD = 12, Digital = 13, EP = 14, Custom1 = 15, Custom2 = 16, Custom3 = 17, Custom4 = 18, Custom5 = 19 }
getLyrics: string
This result is different from the other functions; its response is a string only and not a list of objects or an object that needs to be serialized using JSON.stringify().
getAlbumPictures(): object[]
This result should always return a list of objects, whether it contains zero, one, or multiple matches. Each object in the result has the following TypeScript definition:
class PictureResult { smallUrl: string; url: string; resourceUrl: string; }
getArtistPictures(): object[]
This result should always return a list of objects, whether it contains zero, one, or multiple matches. Each object in the result has the following TypeScript definition:
class PictureResult { smallUrl: string; url: string; resourceUrl: string; }
getLabelPictures(): object[]
This result should always return a list of objects, whether it contains zero, one, or multiple matches. Each object in the result has the following TypeScript definition:
class PictureResult { smallUrl: string; url: string; resourceUrl: string; }
getLabelInformation(): object
This result returns a single match as an object with the following structure, exposed as TypeScript:
class LabelInformation { name: string; contactInfo: string; parentLabel: string; webPage: string; profile: string; imageName: string; formed: number; disbanded: number; labelCode: string; country: string; sublabels: string[]; id: number; discogsUrl: string; }
getArtistInformation(): object
This result returns a single match as an object with the following structure, exposed as TypeScript:
class ArtistInformation { name: string; bornName: string; biography: string; formed: number; disbanded: number; country: string; imageName: string; imageUrl: string; artistUrl: string; akas: string[]; groupMembers: string[]; memberOf: string[]; similarArtists: string[]; influencedBy: string[]; followers: string[]; seeAlso: string[]; performedSongsBy: string[]; id: number; isGroup: boolean; discogsUrl: string; }