feat(publish): 德穆兰选项支持后台开关并默认打开下赛季通行证
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user