mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Gallery list improvement (#622)
* Add grid view to galleries * Show scene in gallery card * Add is missing scene gallery filter * Don't store galleries with no images
This commit is contained in:
@@ -4,17 +4,18 @@ import (
|
||||
"archive/zip"
|
||||
"bytes"
|
||||
"database/sql"
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/stashapp/stash/pkg/api/urlbuilders"
|
||||
"github.com/stashapp/stash/pkg/logger"
|
||||
"github.com/stashapp/stash/pkg/utils"
|
||||
_ "golang.org/x/image/webp"
|
||||
"image"
|
||||
"image/jpeg"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/stashapp/stash/pkg/api/urlbuilders"
|
||||
"github.com/stashapp/stash/pkg/logger"
|
||||
"github.com/stashapp/stash/pkg/utils"
|
||||
_ "golang.org/x/image/webp"
|
||||
)
|
||||
|
||||
type Gallery struct {
|
||||
@@ -28,6 +29,16 @@ type Gallery struct {
|
||||
|
||||
const DefaultGthumbWidth int = 200
|
||||
|
||||
func (g *Gallery) CountFiles() int {
|
||||
filteredFiles, readCloser, err := g.listZipContents()
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
defer readCloser.Close()
|
||||
|
||||
return len(filteredFiles)
|
||||
}
|
||||
|
||||
func (g *Gallery) GetFiles(baseURL string) []*GalleryFilesType {
|
||||
var galleryFiles []*GalleryFilesType
|
||||
filteredFiles, readCloser, err := g.listZipContents()
|
||||
|
||||
Reference in New Issue
Block a user