mirror of https://github.com/stashapp/stash.git
Scan now uses exclude regex on gallery zips (#2317)
* Fix zip galleries not using regex excludes
This commit is contained in:
parent
3fdc32b432
commit
9321388770
|
@ -2,6 +2,8 @@ package manager
|
|||
|
||||
import (
|
||||
"archive/zip"
|
||||
"github.com/stashapp/stash/pkg/file"
|
||||
"github.com/stashapp/stash/pkg/manager/config"
|
||||
"strings"
|
||||
|
||||
"github.com/stashapp/stash/pkg/logger"
|
||||
|
@ -14,20 +16,26 @@ func walkGalleryZip(path string, walkFunc func(file *zip.File) error) error {
|
|||
}
|
||||
defer readCloser.Close()
|
||||
|
||||
for _, file := range readCloser.File {
|
||||
if file.FileInfo().IsDir() {
|
||||
excludeImgRegex := generateRegexps(config.GetInstance().GetImageExcludes())
|
||||
|
||||
for _, f := range readCloser.File {
|
||||
if f.FileInfo().IsDir() {
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.Contains(file.Name, "__MACOSX") {
|
||||
if strings.Contains(f.Name, "__MACOSX") {
|
||||
continue
|
||||
}
|
||||
|
||||
if !isImage(file.Name) {
|
||||
if !isImage(f.Name) {
|
||||
continue
|
||||
}
|
||||
|
||||
err := walkFunc(file)
|
||||
if matchFileRegex(file.ZipFile(path, f).Path(), excludeImgRegex) {
|
||||
continue
|
||||
}
|
||||
|
||||
err := walkFunc(f)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* Show counts on list tabs in Performer, Studio and Tag pages. ([#2169](https://github.com/stashapp/stash/pull/2169))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
* Fix image exclude regex not being honoured when scanning in zips. ([#2317](https://github.com/stashapp/stash/pull/2317))
|
||||
* Delete funscripts when deleting scene files. ([#2265](https://github.com/stashapp/stash/pull/2265))
|
||||
* Removed trusted proxies setting. ([#2229](https://github.com/stashapp/stash/pull/2229))
|
||||
* Allow Stash to be iframed. ([#2217](https://github.com/stashapp/stash/pull/2217))
|
||||
|
|
Loading…
Reference in New Issue