mirror of
https://github.com/stashapp/stash.git
synced 2025-12-07 08:54:10 +01:00
Scan for files with ALLCAPS extensions (#650)
This commit is contained in:
parent
56210cf456
commit
ec2bcc7a74
2 changed files with 8 additions and 11 deletions
|
|
@ -3,6 +3,7 @@ package manager
|
|||
import (
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
|
@ -17,22 +18,17 @@ var extensionsToScan = []string{"zip", "m4v", "mp4", "mov", "wmv", "avi", "mpg",
|
|||
var extensionsGallery = []string{"zip"}
|
||||
|
||||
func constructGlob() string { // create a sequence for glob doublestar from our extensions
|
||||
extLen := len(extensionsToScan)
|
||||
glb := "{"
|
||||
for i := 0; i < extLen-1; i++ { // append extensions and commas
|
||||
glb += extensionsToScan[i] + ","
|
||||
var extList []string
|
||||
for _, ext := range extensionsToScan {
|
||||
extList = append(extList, strings.ToLower(ext))
|
||||
extList = append(extList, strings.ToUpper(ext))
|
||||
}
|
||||
if extLen >= 1 { // append last extension without comma
|
||||
glb += extensionsToScan[extLen-1]
|
||||
}
|
||||
glb += "}"
|
||||
return glb
|
||||
|
||||
return "{" + strings.Join(extList, ",") + "}"
|
||||
}
|
||||
|
||||
func isGallery(pathname string) bool {
|
||||
for _, ext := range extensionsGallery {
|
||||
if filepath.Ext(pathname) == "."+ext {
|
||||
if strings.ToLower(filepath.Ext(pathname)) == "."+strings.ToLower(ext) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ const markup = `
|
|||
* Add support for parent/child studios.
|
||||
|
||||
### 🎨 Improvements
|
||||
* Search for files which have low or upper case supported filename extensions.
|
||||
* Add dialog when pasting movie images.
|
||||
* Allow click and click-drag selection after selecting scene.
|
||||
* Added multi-scene edit dialog.
|
||||
|
|
|
|||
Loading…
Reference in a new issue