mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add a cache for gallery thumbnails (#496)
This commit is contained in:
@@ -26,6 +26,8 @@ type Gallery struct {
|
||||
UpdatedAt SQLiteTimestamp `db:"updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
const DefaultGthumbWidth int = 200
|
||||
|
||||
func (g *Gallery) GetFiles(baseURL string) []*GalleryFilesType {
|
||||
var galleryFiles []*GalleryFilesType
|
||||
filteredFiles, readCloser, err := g.listZipContents()
|
||||
@@ -152,3 +154,11 @@ func reorder(a []*zip.File, toFirst int) []*zip.File {
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
func (g *Gallery) ImageCount() int {
|
||||
images, _, _ := g.listZipContents()
|
||||
if images == nil {
|
||||
return 0
|
||||
}
|
||||
return len(images)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user