fix artistid

pull/22/head
zhaarey 5 months ago
parent 63290b67b7
commit b55788e9fe
  1. 18
      main.go
  2. 19
      main_select.go

@ -818,15 +818,17 @@ func writeM4a(w *mp4.Writer, info *SongInfo, meta *AutoGenerated, data []byte, t
} }
} }
if len(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID) > 0 { if len(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data) > 0 {
atID, err := strconv.ParseUint(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID, 10, 32) if len(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID) > 0 {
if err != nil { atID, err := strconv.ParseUint(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID, 10, 32)
return err if err != nil {
} return err
}
err = addMeta(mp4.BoxType{'a', 't', 'I', 'D'}, uint32(atID)) err = addMeta(mp4.BoxType{'a', 't', 'I', 'D'}, uint32(atID))
if err != nil { if err != nil {
return err return err
}
} }
} }
trkn := make([]byte, 8) trkn := make([]byte, 8)

@ -812,16 +812,17 @@ func writeM4a(w *mp4.Writer, info *SongInfo, meta *AutoGenerated, data []byte, t
} }
} }
} }
if len(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data) > 0 {
if len(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID) > 0 {
atID, err := strconv.ParseUint(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID, 10, 32)
if err != nil {
return err
}
if len(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID) > 0 { err = addMeta(mp4.BoxType{'a', 't', 'I', 'D'}, uint32(atID))
atID, err := strconv.ParseUint(meta.Data[0].Relationships.Tracks.Data[index].Relationships.Artists.Data[0].ID, 10, 32) if err != nil {
if err != nil { return err
return err }
}
err = addMeta(mp4.BoxType{'a', 't', 'I', 'D'}, uint32(atID))
if err != nil {
return err
} }
} }
trkn := make([]byte, 8) trkn := make([]byte, 8)

Loading…
Cancel
Save