build spotify-to-navidrome migrator with recovery flow
This commit is contained in:
44
internal/model/model.go
Normal file
44
internal/model/model.go
Normal file
@@ -0,0 +1,44 @@
|
||||
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 MatchedTrack struct {
|
||||
Source Track `json:"source"`
|
||||
TargetID string `json:"target_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 string `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"`
|
||||
}
|
||||
Reference in New Issue
Block a user