refactor: replace mmkv.Merge with common.MergeQMCKeys in LoadMMKVOrDefault and LoadMacKeysV10 for improved key merging consistency

This commit is contained in:
鲁树人
2026-10-20 00:18:27 +09:00
parent e22bf8f38b
commit 08c988f8bb
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -3,7 +3,6 @@ package qmc
import ( import (
"git.um-react.app/um/cli/algo/common" "git.um-react.app/um/cli/algo/common"
"git.um-react.app/um/cli/algo/qmc/qmmac" "git.um-react.app/um/cli/algo/qmc/qmmac"
"git.um-react.app/um/cli/internal/mmkv"
"go.uber.org/zap" "go.uber.org/zap"
) )
@@ -20,7 +19,7 @@ func LoadMMKVOrDefault(opts MMKVLoaderOptions, logger *zap.Logger) (result commo
logger.Warn("LoadMMKVOrDefault: could not read QQMusic v10.x keys", zap.Error(err)) logger.Warn("LoadMMKVOrDefault: could not read QQMusic v10.x keys", zap.Error(err))
} }
allKeys := mmkv.Merge(key1, key2) allKeys := common.MergeQMCKeys(key1, key2)
logger.Debug("Keys loaded", zap.Any("keys", allKeys), zap.Int("len", len(allKeys))) logger.Debug("Keys loaded", zap.Any("keys", allKeys), zap.Int("len", len(allKeys)))
return allKeys, nil return allKeys, nil
} }
+1 -1
View File
@@ -159,5 +159,5 @@ func LoadMacKeysV10(logger *zap.Logger) (common.QMCKeys, error) {
return nil, err return nil, err
} }
return mmkv.Merge(append(keys1, keys2...)...), nil return common.MergeQMCKeys(append(keys1, keys2...)...), nil
} }