mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Scan now uses exclude regex on gallery zips (#2317)
* Fix zip galleries not using regex excludes
This commit is contained in:
@@ -2,6 +2,8 @@ package manager
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"archive/zip"
|
"archive/zip"
|
||||||
|
"github.com/stashapp/stash/pkg/file"
|
||||||
|
"github.com/stashapp/stash/pkg/manager/config"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/stashapp/stash/pkg/logger"
|
"github.com/stashapp/stash/pkg/logger"
|
||||||
@@ -14,20 +16,26 @@ func walkGalleryZip(path string, walkFunc func(file *zip.File) error) error {
|
|||||||
}
|
}
|
||||||
defer readCloser.Close()
|
defer readCloser.Close()
|
||||||
|
|
||||||
for _, file := range readCloser.File {
|
excludeImgRegex := generateRegexps(config.GetInstance().GetImageExcludes())
|
||||||
if file.FileInfo().IsDir() {
|
|
||||||
|
for _, f := range readCloser.File {
|
||||||
|
if f.FileInfo().IsDir() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(file.Name, "__MACOSX") {
|
if strings.Contains(f.Name, "__MACOSX") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isImage(file.Name) {
|
if !isImage(f.Name) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
err := walkFunc(file)
|
if matchFileRegex(file.ZipFile(path, f).Path(), excludeImgRegex) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
err := walkFunc(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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))
|
* Show counts on list tabs in Performer, Studio and Tag pages. ([#2169](https://github.com/stashapp/stash/pull/2169))
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 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))
|
* 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))
|
* 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))
|
* Allow Stash to be iframed. ([#2217](https://github.com/stashapp/stash/pull/2217))
|
||||||
|
|||||||
Reference in New Issue
Block a user