This commit is contained in:
Daniel 2024-12-19 23:51:12 +08:00
parent a3fec2c9e8
commit 77fa89010f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 37 additions and 2 deletions

View file

@ -554,6 +554,25 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
os.RemoveAll(assets)
}
// 将包含的自定义表情统一移动到 data/emojis/ 下
var emojiDirs []string
filelock.Walk(unzipRootPath, func(path string, d fs.DirEntry, err error) error {
if strings.Contains(path, "emojis") && d.IsDir() {
emojiDirs = append(emojiDirs, path)
}
return nil
})
dataEmojis := filepath.Join(util.DataDir, "emojis")
for _, emojis := range emojiDirs {
if gulu.File.IsDir(emojis) {
if err = filelock.Copy(emojis, dataEmojis); err != nil {
logging.LogErrorf("copy emojis from [%s] to [%s] failed: %s", emojis, dataEmojis, err)
return
}
}
os.RemoveAll(emojis)
}
var baseTargetPath string
if "/" == toPath {
baseTargetPath = "/"