mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-02 13:13:34 -04:00
refactor(search): round xmpDM:duration to the nearest millisecond
Address review feedback: a straight int64 cast truncates toward zero, so Tika values that produce results like 1234.999... millisecond would land at 1234 ms instead of 1235 ms. Round before casting so durations are as accurate as float64 allows.
This commit is contained in:
committed by
Ralf Haferkamp
parent
3c59935012
commit
2fc33d6e60
@@ -267,7 +267,7 @@ func (t Tika) getAudio(meta map[string][]string) *libregraph.Audio {
|
||||
// Tika emits fractional seconds.
|
||||
if f, err := strconv.ParseFloat(v, 64); err == nil {
|
||||
initAudio()
|
||||
audio.SetDuration(int64(f * 1000))
|
||||
audio.SetDuration(int64(math.Round(f * 1000)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user