stash/pkg/api/urlbuilders/performer.go

25 lines
593 B
Go
Raw Normal View History

2019-02-09 12:30:49 +00:00
package urlbuilders
import (
"github.com/stashapp/stash/pkg/models"
"strconv"
)
2019-02-09 12:30:49 +00:00
type PerformerURLBuilder struct {
BaseURL string
2019-02-09 12:30:49 +00:00
PerformerID string
UpdatedAt string
2019-02-09 12:30:49 +00:00
}
func NewPerformerURLBuilder(baseURL string, performer *models.Performer) PerformerURLBuilder {
return PerformerURLBuilder{
BaseURL: baseURL,
PerformerID: strconv.Itoa(performer.ID),
UpdatedAt: strconv.FormatInt(performer.UpdatedAt.Timestamp.Unix(), 10),
2019-02-09 12:30:49 +00:00
}
}
func (b PerformerURLBuilder) GetPerformerImageURL() string {
return b.BaseURL + "/performer/" + b.PerformerID + "/image?" + b.UpdatedAt
2019-02-09 12:30:49 +00:00
}