mirror of
https://github.com/stashapp/stash.git
synced 2026-04-28 18:04:57 +02:00
* Add new configuration options * Refactor scan/clean * Schema changes * Add details to galleries * Remove redundant code * Refine thumbnail generation * Gallery overhaul * Don't allow modifying zip gallery images * Show gallery card overlays * Hide zoom slider when not in grid mode
30 lines
670 B
Go
30 lines
670 B
Go
package gallery
|
|
|
|
import (
|
|
"github.com/stashapp/stash/pkg/api/urlbuilders"
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
func GetFiles(g *models.Gallery, baseURL string) []*models.GalleryFilesType {
|
|
var galleryFiles []*models.GalleryFilesType
|
|
|
|
qb := models.NewImageQueryBuilder()
|
|
images, err := qb.FindByGalleryID(g.ID)
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
|
|
for i, img := range images {
|
|
builder := urlbuilders.NewImageURLBuilder(baseURL, img.ID)
|
|
imageURL := builder.GetImageURL()
|
|
|
|
galleryFile := models.GalleryFilesType{
|
|
Index: i,
|
|
Name: &img.Title.String,
|
|
Path: &imageURL,
|
|
}
|
|
galleryFiles = append(galleryFiles, &galleryFile)
|
|
}
|
|
|
|
return galleryFiles
|
|
}
|