fixed few song not have artistid
This commit is contained in:
parent
e521cfcb7c
commit
42c0aa0e5a
27
main.go
27
main.go
@ -815,10 +815,6 @@ func rip(albumId string, token string, storefront string, userToken string) erro
|
|||||||
|
|
||||||
func writeMP4Tags(trackPath string, meta *structs.AutoGenerated, trackNum, trackTotal int) error {
|
func writeMP4Tags(trackPath string, meta *structs.AutoGenerated, trackNum, trackTotal int) error {
|
||||||
index := trackNum - 1
|
index := trackNum - 1
|
||||||
artistID, err := strconv.ParseUint(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID, 10, 32)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
albumID, err := strconv.ParseUint(meta.Data[0].ID, 10, 32)
|
albumID, err := strconv.ParseUint(meta.Data[0].ID, 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -839,14 +835,21 @@ func writeMP4Tags(trackPath string, meta *structs.AutoGenerated, trackNum, track
|
|||||||
"LABEL": meta.Data[0].Attributes.RecordLabel,
|
"LABEL": meta.Data[0].Attributes.RecordLabel,
|
||||||
"UPC": meta.Data[0].Attributes.Upc,
|
"UPC": meta.Data[0].Attributes.Upc,
|
||||||
},
|
},
|
||||||
ItunesAlbumID: int32(albumID),
|
ItunesAlbumID: int32(albumID),
|
||||||
Composer: meta.Data[0].Relationships.Tracks.Data[index].Attributes.ComposerName,
|
Composer: meta.Data[0].Relationships.Tracks.Data[index].Attributes.ComposerName,
|
||||||
ComposerSort: meta.Data[0].Relationships.Tracks.Data[index].Attributes.ComposerName,
|
ComposerSort: meta.Data[0].Relationships.Tracks.Data[index].Attributes.ComposerName,
|
||||||
Date: meta.Data[0].Attributes.ReleaseDate,
|
Date: meta.Data[0].Attributes.ReleaseDate,
|
||||||
CustomGenre: meta.Data[0].Relationships.Tracks.Data[index].Attributes.GenreNames[0],
|
CustomGenre: meta.Data[0].Relationships.Tracks.Data[index].Attributes.GenreNames[0],
|
||||||
Copyright: meta.Data[0].Attributes.Copyright,
|
Copyright: meta.Data[0].Attributes.Copyright,
|
||||||
Publisher: meta.Data[0].Attributes.RecordLabel,
|
Publisher: meta.Data[0].Attributes.RecordLabel,
|
||||||
ItunesArtistID: int32(artistID),
|
}
|
||||||
|
|
||||||
|
if len(meta.Data[0].Relationships.Artists.Data) > 0 {
|
||||||
|
artistID, err := strconv.ParseUint(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
t.ItunesArtistID = int32(artistID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(meta.Data[0].ID, "pl.") && !Config.UseSongInfoForPlaylist {
|
if strings.Contains(meta.Data[0].ID, "pl.") && !Config.UseSongInfoForPlaylist {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user