Update main.go

This commit is contained in:
zhaarey 2025-02-12 16:56:24 +08:00
parent 82d03dc3d9
commit 8193efc9d6

View File

@ -1012,7 +1012,6 @@ func writeMP4Tags(trackPath string, meta *structs.AutoGenerated, trackNum, track
Artist: meta.Data[0].Relationships.Tracks.Data[index].Attributes.ArtistName,
ArtistSort: meta.Data[0].Relationships.Tracks.Data[index].Attributes.ArtistName,
Custom: map[string]string{
"DATE": meta.Data[0].Attributes.ReleaseDate,
"PERFORMER": meta.Data[0].Relationships.Tracks.Data[index].Attributes.ArtistName,
"RELEASETIME": meta.Data[0].Relationships.Tracks.Data[index].Attributes.ReleaseDate,
"ISRC": meta.Data[0].Relationships.Tracks.Data[index].Attributes.Isrc,
@ -1773,7 +1772,12 @@ func extractMediaQuality(b string) (string, error) {
if len(split) >= 3 {
bitDepth := split[len(split)-1]
sampleRate := split[len(split)-2]
Quality = fmt.Sprintf("%s-bit / %s Hz", bitDepth, sampleRate)
HZ, err := strconv.Atoi(sampleRate)
if err != nil {
fmt.Println(err)
}
KHZ := float64(HZ) / 1000.0
Quality = fmt.Sprintf("%sB-%skHz", bitDepth, KHZ)
break
}
}