canape/backend/models/utils.go
Lucas BEE 72970bd52e Cleanup episodes handling
Do not delete fields about an episode when we already have them
Update the polochon and trakttv libs
2020-04-06 18:20:14 +02:00

20 lines
313 B
Go

package models
func updateIfNonEmpty(old *string, newValue string) {
if newValue != "" {
*old = newValue
}
}
func updateIfNonZeroInt(old *int, newValue int) {
if newValue != 0 {
*old = newValue
}
}
func updateIfNonZeroFloat(old *float32, newValue float32) {
if newValue != 0. {
*old = newValue
}
}