fix: DProxyTypes judge

This commit is contained in:
Xhofe
2022-03-22 19:53:26 +08:00
parent 9e483d902f
commit db275f885a
4 changed files with 5 additions and 12 deletions

View File

@ -35,7 +35,7 @@ func GetFileType(ext string) int {
if ext == "" {
return conf.UNKNOWN
}
ext = strings.ToLower(strings.TrimLeft(ext, "."))
ext = strings.ToLower(strings.TrimPrefix(ext, "."))
if IsContain(conf.OfficeTypes, ext) {
return conf.OFFICE
}
@ -128,10 +128,6 @@ func Split(p string) (string, string) {
return path.Split(p)
}
// FormatName TODO
func FormatName(name string) string {
name = strings.ReplaceAll(name, "/", " ")
name = strings.ReplaceAll(name, "#", " ")
name = strings.ReplaceAll(name, "?", " ")
return name
func Ext(name string) string {
return strings.TrimPrefix(path.Ext(name), ".")
}