photoprism/internal/ttl/duration.go
Michael Mayer a287830d1f Videos: Allow setting a lower TTL for caching video content #3631
Adds the new "--http-video-maxage SECONDS" config option.

Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-08-15 11:06:43 +02:00

17 lines
340 B
Go

package ttl
import "strconv"
// Duration represents a cache duration in seconds.
type Duration int
// Int returns the cache Duration in seconds as signed integer.
func (a Duration) Int() int {
return int(a)
}
// String returns the cache Duration in seconds as string.
func (a Duration) String() string {
return strconv.Itoa(int(a))
}