mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-24 22:34:04 +08:00
fix: resolve concurrent read/write issues in WrapObjName (#7865)
This commit is contained in:
parent
c2633dd443
commit
bdcf450203
@ -115,12 +115,12 @@ func ExtractFolder(objs []Obj, extractFolder string) {
|
||||
}
|
||||
|
||||
func WrapObjName(objs Obj) Obj {
|
||||
return &ObjWrapName{Obj: objs}
|
||||
return &ObjWrapName{Name: utils.MappingName(objs.GetName()), Obj: objs}
|
||||
}
|
||||
|
||||
func WrapObjsName(objs []Obj) {
|
||||
for i := 0; i < len(objs); i++ {
|
||||
objs[i] = &ObjWrapName{Obj: objs[i]}
|
||||
objs[i] = &ObjWrapName{Name: utils.MappingName(objs[i].GetName()), Obj: objs[i]}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,9 +16,6 @@ func (o *ObjWrapName) Unwrap() Obj {
|
||||
}
|
||||
|
||||
func (o *ObjWrapName) GetName() string {
|
||||
if o.Name == "" {
|
||||
o.Name = utils.MappingName(o.Obj.GetName())
|
||||
}
|
||||
return o.Name
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user