mirror of
https://github.com/navidrome/navidrome.git
synced 2025-12-23 23:18:05 -05:00
* feat(deezer): add functions to fetch related artists, biographies, and top tracks for an artist Signed-off-by: Deluan <deluan@navidrome.org> * feat(deezer): add language support for Deezer API client Signed-off-by: Deluan <deluan@navidrome.org> * fix(deezer): Use GraphQL API for translated biographies The previous implementation scraped the __DZR_APP_STATE__ from HTML, which only contained English content. The actual biography displayed on Deezer's website comes from their GraphQL API at pipe.deezer.com, which properly respects the Accept-Language header and returns translated content. This change: - Switches from HTML scraping to the GraphQL API - Uses Accept-Language header instead of URL path for language - Updates tests to match the new implementation - Removes unused HTML fixture file Signed-off-by: Deluan <deluan@navidrome.org> * refactor(deezer): move JWT token handling to a separate file for better organization Signed-off-by: Deluan <deluan@navidrome.org> * feat(deezer): enhance JWT token handling with expiration validation Signed-off-by: Deluan <deluan@navidrome.org> * refactor(deezer): change log level for unknown agent warnings from Warn to Debug Signed-off-by: Deluan <deluan@navidrome.org> * fix(deezer): reduce JWT token expiration buffer from 10 minutes to 1 minute Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
67 lines
1.7 KiB
Go
67 lines
1.7 KiB
Go
package deezer
|
|
|
|
type SearchArtistResults struct {
|
|
Data []Artist `json:"data"`
|
|
Total int `json:"total"`
|
|
Next string `json:"next"`
|
|
}
|
|
|
|
type Artist struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
Link string `json:"link"`
|
|
Picture string `json:"picture"`
|
|
PictureSmall string `json:"picture_small"`
|
|
PictureMedium string `json:"picture_medium"`
|
|
PictureBig string `json:"picture_big"`
|
|
PictureXl string `json:"picture_xl"`
|
|
NbAlbum int `json:"nb_album"`
|
|
NbFan int `json:"nb_fan"`
|
|
Radio bool `json:"radio"`
|
|
Tracklist string `json:"tracklist"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type Error struct {
|
|
Error struct {
|
|
Type string `json:"type"`
|
|
Message string `json:"message"`
|
|
Code int `json:"code"`
|
|
} `json:"error"`
|
|
}
|
|
|
|
type RelatedArtists struct {
|
|
Data []Artist `json:"data"`
|
|
Total int `json:"total"`
|
|
}
|
|
|
|
type TopTracks struct {
|
|
Data []Track `json:"data"`
|
|
Total int `json:"total"`
|
|
Next string `json:"next"`
|
|
}
|
|
|
|
type Track struct {
|
|
ID int `json:"id"`
|
|
Title string `json:"title"`
|
|
Link string `json:"link"`
|
|
Duration int `json:"duration"`
|
|
Rank int `json:"rank"`
|
|
Preview string `json:"preview"`
|
|
Artist Artist `json:"artist"`
|
|
Album Album `json:"album"`
|
|
Contributors []Artist `json:"contributors"`
|
|
}
|
|
|
|
type Album struct {
|
|
ID int `json:"id"`
|
|
Title string `json:"title"`
|
|
Cover string `json:"cover"`
|
|
CoverSmall string `json:"cover_small"`
|
|
CoverMedium string `json:"cover_medium"`
|
|
CoverBig string `json:"cover_big"`
|
|
CoverXl string `json:"cover_xl"`
|
|
Tracklist string `json:"tracklist"`
|
|
Type string `json:"type"`
|
|
}
|