mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-29 11:00:27 +01:00
Connect Athena to Spotify
This commit is contained in:
22
app/Types/ILocalSpotify.ts
Normal file
22
app/Types/ILocalSpotify.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export interface SpotifyArtist {
|
||||
id: string
|
||||
name: string
|
||||
image: string
|
||||
genres: string[]
|
||||
popularity: number
|
||||
followers: number
|
||||
}
|
||||
|
||||
export interface SpotifyTrack {
|
||||
item: {
|
||||
name: string
|
||||
type: string
|
||||
}
|
||||
device: {
|
||||
name: string
|
||||
type: string
|
||||
}
|
||||
author: string
|
||||
duration: number
|
||||
image: string
|
||||
}
|
||||
110
app/Types/ISpotify.ts
Normal file
110
app/Types/ISpotify.ts
Normal file
@@ -0,0 +1,110 @@
|
||||
export interface SpotifyToken {
|
||||
access_token: string
|
||||
refresh_token: string
|
||||
}
|
||||
|
||||
interface Device {
|
||||
name: string
|
||||
type: 'computer' | 'smartphone' | 'speaker'
|
||||
}
|
||||
|
||||
interface ExternalUrl {
|
||||
spotify: string
|
||||
}
|
||||
|
||||
interface ExternalId {
|
||||
isrc: string
|
||||
ean: string
|
||||
upc: string
|
||||
}
|
||||
|
||||
interface Image {
|
||||
url: string
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
interface Restriction {
|
||||
reason: 'market' | 'explicit' | 'product'
|
||||
}
|
||||
|
||||
interface Follower {
|
||||
href: string
|
||||
total: number
|
||||
}
|
||||
|
||||
export interface Artist {
|
||||
external_urls: ExternalUrl
|
||||
followers: Follower
|
||||
genres: string[]
|
||||
href: string
|
||||
id: string
|
||||
images: Image[]
|
||||
name: string
|
||||
popularity: number
|
||||
type: string
|
||||
uri: string
|
||||
}
|
||||
|
||||
interface Album {
|
||||
album_type: 'single' | 'album' | 'compilation'
|
||||
total_tracks: number
|
||||
available_markets: string[]
|
||||
external_urls: ExternalUrl
|
||||
href: string
|
||||
id: string
|
||||
images: Image[]
|
||||
name: string
|
||||
release_date: string
|
||||
release_date_precision: 'day' | 'month' | 'year'
|
||||
restrictions: Restriction
|
||||
type: string
|
||||
uri: string
|
||||
}
|
||||
|
||||
interface Item {
|
||||
album: Album & { album_group: 'album' | 'single' | 'compilation' | 'appears_on' ; artists: Artist[] }
|
||||
artists: Artist[]
|
||||
available_markets: string[]
|
||||
disc_number: number
|
||||
duration_ms: number
|
||||
explicit: boolean
|
||||
external_ids: ExternalId
|
||||
external_urls: ExternalUrl
|
||||
href: string
|
||||
id: string
|
||||
is_playable: boolean
|
||||
restrictions: Restriction
|
||||
name: string
|
||||
popularity: number
|
||||
preview_url: string
|
||||
track_number: number
|
||||
type: string
|
||||
uri: string
|
||||
is_local: boolean
|
||||
}
|
||||
|
||||
export interface PlayerResponse {
|
||||
device: Device
|
||||
timestamp: number
|
||||
is_playing: boolean
|
||||
item: Item
|
||||
progress_ms: number
|
||||
shuffle_state: string
|
||||
repeat_state: string
|
||||
currently_playing_type: 'track' | 'episode' | 'ad' | 'unknown'
|
||||
}
|
||||
|
||||
export interface InternalPlayerResponse {
|
||||
is_playing: boolean
|
||||
device_name?: string
|
||||
device_type?: string
|
||||
name?: string
|
||||
type?: string
|
||||
author?: string
|
||||
id?: string
|
||||
image?: Image
|
||||
progress?: number
|
||||
duration?: number
|
||||
started_at?: number
|
||||
}
|
||||
16
app/Types/IStats.ts
Normal file
16
app/Types/IStats.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export interface Time {
|
||||
hours: number
|
||||
minutes: number
|
||||
seconds: number
|
||||
}
|
||||
|
||||
export interface Stats {
|
||||
range: {
|
||||
start: string
|
||||
end: string
|
||||
}
|
||||
|
||||
development_time: Time
|
||||
commands_ran: number
|
||||
builds_ran: number
|
||||
}
|
||||
Reference in New Issue
Block a user