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 ( import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings"
"sync" "sync"
"time" "time"
@ -17,22 +18,17 @@ var extensionsToScan = []string{"zip", "m4v", "mp4", "mov", "wmv", "avi", "mpg",
var extensionsGallery = []string{"zip"} var extensionsGallery = []string{"zip"}
func constructGlob() string { // create a sequence for glob doublestar from our extensions func constructGlob() string { // create a sequence for glob doublestar from our extensions
extLen := len(extensionsToScan) var extList []string
glb := "{" for _, ext := range extensionsToScan {
for i := 0; i < extLen-1; i++ { // append extensions and commas extList = append(extList, strings.ToLower(ext))
glb += extensionsToScan[i] + "," extList = append(extList, strings.ToUpper(ext))
} }
if extLen >= 1 { // append last extension without comma return "{" + strings.Join(extList, ",") + "}"
glb += extensionsToScan[extLen-1]
}
glb += "}"
return glb
} }
func isGallery(pathname string) bool { func isGallery(pathname string) bool {
for _, ext := range extensionsGallery { for _, ext := range extensionsGallery {
if filepath.Ext(pathname) == "."+ext { if strings.ToLower(filepath.Ext(pathname)) == "."+strings.ToLower(ext) {
return true return true
} }
} }

View file

@ -12,6 +12,7 @@ const markup = `
* Add support for parent/child studios. * Add support for parent/child studios.
### 🎨 Improvements ### 🎨 Improvements
* Search for files which have low or upper case supported filename extensions.
* Add dialog when pasting movie images. * Add dialog when pasting movie images.
* Allow click and click-drag selection after selecting scene. * Allow click and click-drag selection after selecting scene.
* Added multi-scene edit dialog. * Added multi-scene edit dialog.