refactor: simplify codebase (-209 lines)

This commit is contained in:
Mathis Maquenne
2026-03-01 21:55:42 +01:00
parent cd45c3f40a
commit 08b608ec80
31 changed files with 389 additions and 598 deletions
+7 -16
View File
@@ -1,32 +1,23 @@
package deezer
type Media struct {
Errors []MediaError `json:"errors"`
Errors []mediaError `json:"errors"`
Data []struct {
Media []struct {
Type string `json:"media_type"`
Cipher Cipher `json:"cipher"`
Format string `json:"format"`
Sources []Source `json:"sources"`
Format string `json:"format"`
Sources []struct {
URL string `json:"url"`
} `json:"sources"`
}
Errors []MediaError `json:"errors"`
Errors []mediaError `json:"errors"`
} `json:"data"`
}
type MediaError struct {
type mediaError struct {
Code int `json:"code"`
Message string `json:"message"`
}
type Cipher struct {
Type string `json:"type"`
}
type Source struct {
URL string `json:"url"`
Provider string `json:"provider"`
}
func (m *Media) GetURL() string {
return m.Data[0].Media[0].Sources[0].URL
}