+8
-9
service/lastfm/lastfm.go
+8
-9
service/lastfm/lastfm.go
···
409
409
// printout the session details
410
410
fmt.Printf("Submitting track for the did: %+v\n", sess.DID)
411
411
412
-
// horrible no good very bad for now
413
-
artistArr := []string{}
414
-
artistMbIdArr := []string{}
412
+
artists := make([]*teal.AlphaFeedDefs_Artist, 0, len(track.Artist))
415
413
for _, a := range track.Artist {
416
-
artistArr = append(artistArr, a.Name)
417
-
artistMbIdArr = append(artistMbIdArr, a.MBID)
414
+
artist := &teal.AlphaFeedDefs_Artist{
415
+
ArtistName: a.Name,
416
+
ArtistMbId: &a.MBID,
417
+
}
418
+
artists = append(artists, artist)
418
419
}
419
420
420
421
var durationPtr *int64
···
436
437
Duration: durationPtr, // Pointer required
437
438
TrackName: track.Name,
438
439
// should be unix timestamp
439
-
PlayedTime: &playedTimeStr, // Pointer required
440
-
ArtistNames: artistArr, // Slice of strings is correct
441
-
ArtistMbIds: artistMbIdArr, // Slice of strings is correct
440
+
PlayedTime: &playedTimeStr, // Pointer required
441
+
Artists: artists,
442
442
ReleaseMbId: &track.ReleaseMBID, // Pointer required
443
443
ReleaseName: &track.Album, // Pointer required
444
444
RecordingMbId: &track.RecordingMBID, // Pointer required
···
452
452
}
453
453
454
454
authArgs := db.AtpSessionToAuthArgs(sess)
455
-
fmt.Println(authArgs)
456
455
457
456
var out atproto.RepoCreateRecord_Output
458
457
if err := xrpcClient.Do(ctx, authArgs, xrpc.Procedure, "application/json", "com.atproto.repo.createRecord", nil, input, &out); err != nil {
+7
-6
service/spotify/spotify.go
+7
-6
service/spotify/spotify.go
···
63
63
return fmt.Errorf("couldn't get Atproto session for DID %s: %w", did, err)
64
64
}
65
65
66
-
artistArr := make([]string, 0, len(track.Artist))
67
-
artistMbIdArr := make([]string, 0, len(track.Artist))
66
+
artists := make([]*teal.AlphaFeedDefs_Artist, 0, len(track.Artist))
68
67
for _, a := range track.Artist {
69
-
artistArr = append(artistArr, a.Name)
70
-
artistMbIdArr = append(artistMbIdArr, a.MBID)
68
+
artist := &teal.AlphaFeedDefs_Artist{
69
+
ArtistName: a.Name,
70
+
ArtistMbId: &a.MBID,
71
+
}
72
+
artists = append(artists, artist)
71
73
}
72
74
73
75
var durationPtr *int64
···
87
89
Duration: durationPtr,
88
90
TrackName: track.Name,
89
91
PlayedTime: &playedTimeStr,
90
-
ArtistNames: artistArr,
91
-
ArtistMbIds: artistMbIdArr,
92
+
Artists: artists,
92
93
ReleaseMbId: &track.ReleaseMBID,
93
94
ReleaseName: &track.Album,
94
95
RecordingMbId: &track.RecordingMBID,