Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaarey committed Feb 12, 2025
1 parent 82d03dc commit 8193efc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 8193efc

Please sign in to comment.