/*
Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>

Scotty is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later version.

Scotty is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
Scotty. If not, see <https://www.gnu.org/licenses/>.
*/

package deezer

type Result struct {
	Error *Error `json:"error,omitempty"`
}

type Error struct {
	// {"error":{"type":"OAuthException","message":"Invalid OAuth access token.","code":300}}
	Type    string `json:"type"`
	Message string `json:"message"`
	Code    int    `json:"code"`
}

type TracksResult struct {
	Result
	Next     string       `json:"next"`
	Previous string       `json:"prev"`
	Total    int          `json:"total"`
	Tracks   []LovedTrack `json:"data"`
}

type Track struct {
	Id       int    `json:"id"`
	Type     string `json:"type"`
	Title    string `json:"title"`
	Link     string `json:"link"`
	Duration int    `json:"duration"`
	Rank     int    `json:"rank"`
	Readable bool   `json:"readable"`
	Explicit bool   `json:"explicit_lyrics"`
	Album    Album  `json:"album"`
	Artist   Artist `json:"artist"`
}

type LovedTrack struct {
	Track
	AddedAt int64 `json:"time_add"`
}

type Album struct {
	Id        int    `json:"id"`
	Type      string `json:"type"`
	Title     string `json:"title"`
	TrackList string `json:"tracklist"`
}

type Artist struct {
	Id   int    `json:"id"`
	Type string `json:"type"`
	Name string `json:"name"`
}