package model

type Track struct {
	SourceID   string   `json:"source_id,omitempty"`
	Title      string   `json:"title"`
	Artists    []string `json:"artists"`
	Album      string   `json:"album,omitempty"`
	DurationMS int      `json:"duration_ms,omitempty"`
	ISRC       string   `json:"isrc,omitempty"`
	Explicit   bool     `json:"explicit,omitempty"`
}

type Playlist struct {
	SourceID    string  `json:"source_id,omitempty"`
	Name        string  `json:"name"`
	Description string  `json:"description,omitempty"`
	Tracks      []Track `json:"tracks"`
}

type Library struct {
	UserID       string     `json:"user_id"`
	DisplayName  string     `json:"display_name"`
	Playlists    []Playlist `json:"playlists"`
	LikedSongs   []Track    `json:"liked_songs"`
	LikedName    string     `json:"liked_name"`
	SourceSystem string     `json:"source_system"`
}

type MatchedTrack struct {
	Source  Track   `json:"source"`
	QobuzID int64   `json:"qobuz_id,omitempty"`
	Score   float64 `json:"score"`
	Query   string  `json:"query,omitempty"`
	Reason  string  `json:"reason,omitempty"`
	Matched bool    `json:"matched"`
}

type PlaylistTransferResult struct {
	Name          string         `json:"name"`
	TargetID      int64          `json:"target_id,omitempty"`
	TotalTracks   int            `json:"total_tracks"`
	MatchedTracks int            `json:"matched_tracks"`
	AddedTracks   int            `json:"added_tracks"`
	Unmatched     []MatchedTrack `json:"unmatched"`
	Errors        []string       `json:"errors"`
}

type TransferReport struct {
	StartedAt string                   `json:"started_at"`
	EndedAt   string                   `json:"ended_at"`
	DryRun    bool                     `json:"dry_run"`
	Results   []PlaylistTransferResult `json:"results"`
}
