mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
* Add xpath performer and scene scraping * Add studio scraping * Refactor code * Fix compile error * Don't overwrite performer URL during a scrape
16 lines
293 B
Go
16 lines
293 B
Go
// +build !go1.10
|
|
|
|
package xpath
|
|
|
|
import "math"
|
|
|
|
// math.Round() is supported by Go 1.10+,
|
|
// This method just compatible for version <1.10.
|
|
// https://github.com/golang/go/issues/20100
|
|
func round(f float64) int {
|
|
if math.Abs(f) < 0.5 {
|
|
return 0
|
|
}
|
|
return int(f + math.Copysign(0.5, f))
|
|
}
|