rom_list_page improves

This commit is contained in:
cuu 2019-01-15 01:06:12 +08:00
parent eba7164167
commit 2b00e00f26

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"os" "os"
"strings" "strings"
"regexp" //"regexp"
"path/filepath" "path/filepath"
"os/exec" "os/exec"
"errors" "errors"
@ -106,12 +106,11 @@ func (self *RomListPage) GeneratePathList(path string) ([]map[string]string,erro
if len(bname) > 1 { if len(bname) > 1 {
is_excluded := false is_excluded := false
for _,exclude_pattern := range self.EmulatorConfig.EXCLUDE { for _,exclude_ext := range self.EmulatorConfig.EXCLUDE {
if matched, err := regexp.MatchString(exclude_pattern,bname); err == nil { exclude_ext2 := strings.Trim(exclude_ext,"\r\n ")
if matched == true { if len(exclude_ext2) > 1 && strings.HasSuffix(bname,exclude_ext2) {
is_excluded = true is_excluded= true
break break
}
} }
} }