fix: category for filename

This commit is contained in:
divyam234 2024-04-19 23:11:07 +05:30
parent 15a037c7ee
commit 3ca28cc06d

View file

@ -1,4 +1,4 @@
package catregory package category
import ( import (
"path/filepath" "path/filepath"
@ -25,7 +25,7 @@ var (
) )
func GetCategory(fileName string) Category { func GetCategory(fileName string) Category {
fileExtension := strings.ToLower(filepath.Ext(fileName)) fileExtension := strings.Split(strings.ToLower(filepath.Ext(fileName)), ".")[1]
if contains(documentExtensions, fileExtension) { if contains(documentExtensions, fileExtension) {
return Document return Document