Add cache breaker for screenshot using modtime (#271)

This commit is contained in:
WithoutPants
2019-12-18 04:28:44 +11:00
committed by Leopere
parent 0714cbfa34
commit 043745a84f
2 changed files with 8 additions and 4 deletions

View File

@@ -1,6 +1,9 @@
package urlbuilders
import "strconv"
import (
"strconv"
"time"
)
type SceneURLBuilder struct {
BaseURL string
@@ -30,8 +33,8 @@ func (b SceneURLBuilder) GetSpriteVTTURL() string {
return b.BaseURL + "/scene/" + b.SceneID + "_thumbs.vtt"
}
func (b SceneURLBuilder) GetScreenshotURL() string {
return b.BaseURL + "/scene/" + b.SceneID + "/screenshot"
func (b SceneURLBuilder) GetScreenshotURL(updateTime time.Time) string {
return b.BaseURL + "/scene/" + b.SceneID + "/screenshot?" + strconv.FormatInt(updateTime.Unix(), 10)
}
func (b SceneURLBuilder) GetChaptersVTTURL() string {