mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-07-11 23:41:25 +08:00
fix: optimize directory data handling in BuildSetDirKeyboard function
This commit is contained in:
@@ -127,13 +127,9 @@ func BuildSetDirKeyboard(dirs []database.Dir, dataid string) (*tg.ReplyInlineMar
|
|||||||
buttons := make([]tg.KeyboardButtonClass, 0)
|
buttons := make([]tg.KeyboardButtonClass, 0)
|
||||||
for _, dir := range dirs {
|
for _, dir := range dirs {
|
||||||
dirDataId := xid.New().String()
|
dirDataId := xid.New().String()
|
||||||
dirData := tcbdata.Add{
|
dirData := data
|
||||||
Files: data.Files,
|
dirData.DirID = dir.ID
|
||||||
SelectedStorName: data.SelectedStorName,
|
dirData.SettedDir = true
|
||||||
AsBatch: data.AsBatch,
|
|
||||||
DirID: dir.ID,
|
|
||||||
SettedDir: true,
|
|
||||||
}
|
|
||||||
err := cache.Set(dirDataId, dirData)
|
err := cache.Set(dirDataId, dirData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to set directory data in cache: %w", err)
|
return nil, fmt.Errorf("failed to set directory data in cache: %w", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user