mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
23 lines
450 B
Go
23 lines
450 B
Go
package urlbuilders
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
type GalleryURLBuilder struct {
|
|
BaseURL string
|
|
GalleryID string
|
|
}
|
|
|
|
func NewGalleryURLBuilder(baseURL string, gallery *models.Gallery) GalleryURLBuilder {
|
|
return GalleryURLBuilder{
|
|
BaseURL: baseURL,
|
|
GalleryID: strconv.Itoa(gallery.ID),
|
|
}
|
|
}
|
|
|
|
func (b GalleryURLBuilder) GetPreviewURL() string {
|
|
return b.BaseURL + "/gallery/" + b.GalleryID + "/preview"
|
|
}
|