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

View File

@@ -0,0 +1,24 @@
package spotify
import "testing"
func TestParsePlaylistID(t *testing.T) {
tests := []struct {
in string
want string
}{
{"spotify:playlist:16DZpOTLqZvdbqxEavLmWk", "16DZpOTLqZvdbqxEavLmWk"},
{"https://open.spotify.com/playlist/16DZpOTLqZvdbqxEavLmWk?si=abc", "16DZpOTLqZvdbqxEavLmWk"},
{"16DZpOTLqZvdbqxEavLmWk", "16DZpOTLqZvdbqxEavLmWk"},
}
for _, tt := range tests {
got, err := ParsePlaylistID(tt.in)
if err != nil {
t.Fatalf("ParsePlaylistID(%q) returned error: %v", tt.in, err)
}
if got != tt.want {
t.Fatalf("ParsePlaylistID(%q) = %q, want %q", tt.in, got, tt.want)
}
}
}