Files
lucida/src/streamers/deezer/constants.ts
2025-07-20 18:28:43 -04:00

173 lines
3.0 KiB
TypeScript

export const AcceptableAlbumTypes = ['upc']
export const AcceptableTrackTypes = ['isrc']
export const UPC = `https://api.deezer.com/album/upc:{upc}?limit=100`
export const ISRC = `https://api.deezer.com/track/isrc:{upc}`
export type RawUPCAlbum = {
id: number
title: string
upc: string
link: string
share: string
cover: string
cover_small: string
cover_medium: string
cover_big: string
cover_xl: string
md5_image: string
genre_id: number
genres: {
data: Genre[]
}
label: string
nb_tracks: number
duration: number
fans: number
release_date: string
available: boolean
tracklist: string
explicit_lyrics: boolean
explicit_contents_lyrics: number
explicit_contents_cover: number
contributors: Contributor[]
artist: ArtistFromAlbumUPC
type: 'album'
tracks: { data: TrackWithinUPCAlbum[] }
}
type Genre = {
id: number
name: string
picture: string
type: 'genre'
}
type Contributor = {
id: number
name: string
link: string
share: string
picture: string
picture_small: string
picture_medium: string
picture_big: string
picture_xl: string
radio: boolean
tracklist: string
type: 'artist'
role: 'Main'
}
type ArtistFromAlbumUPC = {
id: number
name: string
picture: string
picture_small: string
picture_medium: string
picture_big: string
picture_xl: string
tracklist: string
type: 'artist'
}
type TrackWithinUPCAlbum = {
id: number
readable: boolean
title: string
title_short: string
title_version: ''
link: string
duration: number
rank: number
explicit_lyrics: boolean
explicit_content_lyrics: number
explicit_content_cover: number
preview: string
md5_image: string
artist: {
id: number
name: string
tracklist: string
type: 'artist'
}
album: {
id: number
title: string
over: string
cover_small: string
cover_medium: string
cover_big: string
cover_xl: string
md5_image: string
tracklist: string
type: 'album'
}
type: 'track'
}
export type RawISRCTrack = {
id: number
readable: boolean
title: string
title_short: string
title_version: string
isrc: string
link: string
share: string
duration: number
track_position: number
disk_number: number
rank: number
release_date: string
explicit_lyrics: boolean
explicit_content_lyrics: number
explicit_content_cover: number
preview: string
bpm: number
gain: number
available_countries: string[] // is there a better way to do this?
contributors: Contributor[]
md5_image: string
track_token: string
artist: ArtistFromTrackISRC
album: AlbumFromTrackISRC
type: 'track'
}
type ArtistFromTrackISRC = {
id: number
name: string
picture: string
picture_small: string
picture_medium: string
picture_big: string
picture_xl: string
radio: boolean
tracklist: string
type: 'artist'
}
type AlbumFromTrackISRC = {
id: number
title: string
link: string
cover: string
cover_small: string
cover_medium: string
cover_big: string
cover_xl: string
md5_image: string
release_date: string
tracklist: string
type: 'album'
}
export type RawError = {
error: {
type: string
message: string
code: number
}
}