mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add timestamp suffix to all image urls (#1200)
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
package urlbuilders
|
||||
|
||||
import "strconv"
|
||||
import (
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type StudioURLBuilder struct {
|
||||
BaseURL string
|
||||
StudioID string
|
||||
BaseURL string
|
||||
StudioID string
|
||||
UpdatedAt string
|
||||
}
|
||||
|
||||
func NewStudioURLBuilder(baseURL string, studioID int) StudioURLBuilder {
|
||||
func NewStudioURLBuilder(baseURL string, studio *models.Studio) StudioURLBuilder {
|
||||
return StudioURLBuilder{
|
||||
BaseURL: baseURL,
|
||||
StudioID: strconv.Itoa(studioID),
|
||||
BaseURL: baseURL,
|
||||
StudioID: strconv.Itoa(studio.ID),
|
||||
UpdatedAt: strconv.FormatInt(studio.UpdatedAt.Timestamp.Unix(), 10),
|
||||
}
|
||||
}
|
||||
|
||||
func (b StudioURLBuilder) GetStudioImageURL() string {
|
||||
return b.BaseURL + "/studio/" + b.StudioID + "/image"
|
||||
return b.BaseURL + "/studio/" + b.StudioID + "/image?" + b.UpdatedAt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user