Images section (#813)

* 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
This commit is contained in:
WithoutPants
2020-10-13 10:12:46 +11:00
committed by GitHub
parent df3252e24f
commit aca2c7c5f4
147 changed files with 12483 additions and 946 deletions

View File

@@ -0,0 +1,30 @@
package api
import (
"context"
"strconv"
"github.com/stashapp/stash/pkg/models"
)
func (r *queryResolver) FindImage(ctx context.Context, id *string, checksum *string) (*models.Image, error) {
qb := models.NewImageQueryBuilder()
var image *models.Image
var err error
if id != nil {
idInt, _ := strconv.Atoi(*id)
image, err = qb.Find(idInt)
} else if checksum != nil {
image, err = qb.FindByChecksum(*checksum)
}
return image, err
}
func (r *queryResolver) FindImages(ctx context.Context, imageFilter *models.ImageFilterType, imageIds []int, filter *models.FindFilterType) (*models.FindImagesResultType, error) {
qb := models.NewImageQueryBuilder()
images, total := qb.Query(imageFilter, filter)
return &models.FindImagesResultType{
Count: total,
Images: images,
}, nil
}