Workaround to detect empty dates in some Subsonic clients

This commit is contained in:
Deluan 2023-01-22 20:06:23 -05:00 committed by Joe Stump
parent a53e622cb4
commit ab7dd56421
No known key found for this signature in database
GPG Key ID: 29151C3EC48A0EB9

View File

@ -49,7 +49,11 @@ func ParamTime(r *http.Request, param string, def time.Time) time.Time {
if err != nil {
return def
}
return ToTime(value)
t := ToTime(value)
if t.Before(time.Date(1970, time.January, 2, 0, 0, 0, 0, time.UTC)) {
return def
}
return t
}
func ParamInt(r *http.Request, param string, def int) int {