fix(17-02): handle float64 numeric values from Wails JSON deserialization

Wails deserializes JSON numbers from JavaScript as float64, not int.
All .(int) type assertions on year, track_number, and disc_number
silently failed. Add asInt() helper, replace all assertions.
This commit is contained in:
2026-03-18 07:46:29 -04:00
parent ffcdc41b0d
commit 900db2e56c
4 changed files with 40 additions and 11 deletions
+13 -2
View File
@@ -111,10 +111,21 @@ func applyFlacTextChanges(cmt *flacvorbis.MetaDataBlockVorbisComment, changes Ta
}
var val string
if m.isInt {
val = strconv.Itoa(v.(int))
n, ok := asInt(v)
if !ok {
continue
}
val = strconv.Itoa(n)
} else {
val = v.(string)
s, ok := v.(string)
if !ok {
continue
}
val = s
}
replaceVorbisComment(cmt, m.vorbisID, val)