mirror of
https://git.um-react.app/um/cli.git
synced 2025-11-28 03:33:02 +00:00
refactor: improve mmkv logic
This commit is contained in:
@@ -6,8 +6,24 @@ import (
|
||||
"strings"
|
||||
|
||||
"go.uber.org/zap"
|
||||
"unlock-music.dev/cli/internal/utils"
|
||||
)
|
||||
|
||||
type QMCKeys map[string]string
|
||||
|
||||
type CryptoParams struct {
|
||||
// KuGou kgg database path
|
||||
KggDbPath string
|
||||
|
||||
// QMC Crypto config
|
||||
QmcKeys QMCKeys
|
||||
}
|
||||
|
||||
func (k QMCKeys) Get(key string) (string, bool) {
|
||||
value, ok := k[utils.NormalizeUnicode(key)]
|
||||
return value, ok
|
||||
}
|
||||
|
||||
type DecoderParams struct {
|
||||
Reader io.ReadSeeker // required
|
||||
Extension string // required, source extension, eg. ".mp3"
|
||||
@@ -16,8 +32,7 @@ type DecoderParams struct {
|
||||
|
||||
Logger *zap.Logger // required
|
||||
|
||||
// KuGou
|
||||
KggDatabasePath string
|
||||
CryptoParams CryptoParams
|
||||
}
|
||||
type NewDecoderFunc func(p *DecoderParams) Decoder
|
||||
|
||||
|
||||
Reference in New Issue
Block a user