From 8193efc9d69776a14958f5bbbc68141c43cf3601 Mon Sep 17 00:00:00 2001 From: zhaarey <157944548+zhaarey@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:56:24 +0800 Subject: [PATCH] Update main.go --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f899cab..2ed6234 100644 --- a/main.go +++ b/main.go @@ -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 } }