fix(trainbit): incorrect filename display (#4027)

This commit is contained in:
Night Space 2023-04-02 21:13:20 +08:00 committed by GitHub
parent d3efee2ea1
commit 3cdb8e7a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,10 +113,10 @@ func parseRawFileObject(rawObject []any) ([]model.Obj, error) {
} }
isFolder := int64(object["ty"].(float64)) == 1 isFolder := int64(object["ty"].(float64)) == 1
var name string var name string
if isFolder { if object["ext"].(string) != "" {
name = object["name"].(string) name = strings.Join([]string{object["name"].(string), object["ext"].(string)}, ".")
} else { } else {
name = object["name"].(string) + object["ext"].(string) name = object["name"].(string)
} }
modified, err := time.Parse("2006/01/02 15:04:05", object["modified"].(string)) modified, err := time.Parse("2006/01/02 15:04:05", object["modified"].(string))
if err != nil { if err != nil {