Scan for files with ALLCAPS extensions (#650)

This commit is contained in:
bnkai 2020-07-11 10:22:36 +03:00 committed by GitHub
parent 56210cf456
commit ec2bcc7a74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 11 deletions

View file

@ -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
}
}

View file

@ -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.