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

24
internal/report/report.go Normal file
View File

@@ -0,0 +1,24 @@
package report
import (
"encoding/json"
"fmt"
"os"
"navimigrate/internal/model"
)
func Write(path string, rep model.TransferReport) error {
f, err := os.Create(path)
if err != nil {
return fmt.Errorf("create report file: %w", err)
}
defer f.Close()
enc := json.NewEncoder(f)
enc.SetIndent("", " ")
if err := enc.Encode(rep); err != nil {
return fmt.Errorf("encode report: %w", err)
}
return nil
}