fix: mapping filename in GetName

some missed filename mapping
This commit is contained in:
Noah Hsu
2022-11-30 20:46:54 +08:00
parent d94cf72da2
commit 83644dab85
11 changed files with 33 additions and 25 deletions

View File

@ -5,6 +5,7 @@ import (
"time"
"github.com/alist-org/alist/v3/internal/model"
"github.com/alist-org/alist/v3/pkg/utils"
)
//type BaseResp struct {
@ -39,7 +40,7 @@ func (f File) GetSize() int64 {
}
func (f File) GetName() string {
return f.FileName
return utils.MappingName(f.FileName)
}
func (f File) ModTime() time.Time {

View File

@ -6,6 +6,8 @@ import (
"sort"
"strings"
"time"
"github.com/alist-org/alist/v3/pkg/utils"
)
// 居然有四种返回方式
@ -134,7 +136,7 @@ type Cloud189File struct {
}
func (c *Cloud189File) GetSize() int64 { return c.Size }
func (c *Cloud189File) GetName() string { return c.Name }
func (c *Cloud189File) GetName() string { return utils.MappingName(c.Name) }
func (c *Cloud189File) ModTime() time.Time {
if c.parseTime == nil {
c.parseTime = MustParseTime(c.LastOpTime)
@ -166,7 +168,7 @@ type Cloud189Folder struct {
}
func (c *Cloud189Folder) GetSize() int64 { return 0 }
func (c *Cloud189Folder) GetName() string { return c.Name }
func (c *Cloud189Folder) GetName() string { return utils.MappingName(c.Name) }
func (c *Cloud189Folder) ModTime() time.Time {
if c.parseTime == nil {
c.parseTime = MustParseTime(c.LastOpTime)

View File

@ -3,6 +3,8 @@ package baiduphoto
import (
"fmt"
"time"
"github.com/alist-org/alist/v3/pkg/utils"
)
type TokenErrResp struct {
@ -100,7 +102,7 @@ type (
)
func (a *Album) GetSize() int64 { return 0 }
func (a *Album) GetName() string { return fmt.Sprint(a.Title) }
func (a *Album) GetName() string { return utils.MappingName(a.Title) }
func (a *Album) ModTime() time.Time {
if a.parseTime == nil {
a.parseTime = toTime(a.Mtime)

View File

@ -4,6 +4,8 @@ import (
"fmt"
"strconv"
"time"
"github.com/alist-org/alist/v3/pkg/utils"
)
type ErrResp struct {
@ -147,7 +149,7 @@ type Files struct {
}
func (c *Files) GetSize() int64 { size, _ := strconv.ParseInt(c.Size, 10, 64); return size }
func (c *Files) GetName() string { return c.Name }
func (c *Files) GetName() string { return utils.MappingName(c.Name) }
func (c *Files) ModTime() time.Time { return c.ModifiedTime }
func (c *Files) IsDir() bool { return c.Kind == FOLDER }
func (c *Files) GetID() string { return c.ID }