build spotify-to-navidrome migrator with recovery flow

This commit is contained in:
2026-04-09 03:10:58 +02:00
parent 650a0c6a87
commit c1360a6423
23 changed files with 3383 additions and 0 deletions

44
internal/model/model.go Normal file
View 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"`
}