feat(publish): 德穆兰选项支持后台开关并默认打开下赛季通行证

This commit is contained in:
yml2213
2026-10-31 18:26:05 +08:00
parent ecdffb3f2b
commit 9c379b7e0c
9 changed files with 86 additions and 5 deletions
@@ -330,6 +330,7 @@ func normalizePublishOptionsValue(value string) (string, error) {
if err := json.Unmarshal([]byte(value), &fields); err != nil {
return "", err
}
originalVersion := options.SchemaVersion
if options.SchemaVersion < publishOptionsSchemaVersion {
if hasLegacyPublishQuantityItem(options.QuantityItems) {
options = DefaultPublishOptions()
@@ -342,6 +343,12 @@ func normalizePublishOptionsValue(value string) (string, error) {
} else {
normalizePublishOptions(&options)
}
// v2 一次性迁移:新增「是否解锁德穆兰」开关并默认关闭,同时打开「下赛季是否购买通行证」。
// 已经是 v2 的配置不再覆盖,保留后台手动调整的结果。
if originalVersion < 2 {
options.UnlockDemulanEnabled = false
options.NextSeasonPassEnabled = true
}
options.SchemaVersion = publishOptionsSchemaVersion
raw, err := json.Marshal(options)
if err != nil {