feat: refresh creation config and visual assets
This commit is contained in:
@@ -191,17 +191,7 @@ fn seed_creation_entry_config_if_missing(ctx: &ReducerContext) {
|
||||
sort_order: 85,
|
||||
},
|
||||
);
|
||||
migrate_coming_soon_entry_from_old_open_default(
|
||||
ctx,
|
||||
now,
|
||||
ComingSoonEntryDefault {
|
||||
id: "baby-object-match",
|
||||
title: "宝贝识物",
|
||||
subtitle: "亲子识物分类",
|
||||
image_src: "/child-motion-demo/picture-book-grass-stage.png",
|
||||
sort_order: 90,
|
||||
},
|
||||
);
|
||||
migrate_baby_object_match_entry_from_old_coming_soon_default(ctx, now);
|
||||
}
|
||||
|
||||
fn migrate_visual_novel_entry_from_old_visible_default(ctx: &ReducerContext, now: Timestamp) {
|
||||
@@ -274,6 +264,38 @@ fn migrate_coming_soon_entry_from_old_open_default(
|
||||
});
|
||||
}
|
||||
|
||||
fn migrate_baby_object_match_entry_from_old_coming_soon_default(
|
||||
ctx: &ReducerContext,
|
||||
now: Timestamp,
|
||||
) {
|
||||
let id = "baby-object-match".to_string();
|
||||
let Some(row) = ctx.db.creation_entry_type_config().id().find(&id) else {
|
||||
return;
|
||||
};
|
||||
|
||||
// 中文注释:宝贝识物已接入完整创作发布链路,只纠偏历史默认敬请期待种子。
|
||||
let still_old_coming_soon_default = row.title == "宝贝识物"
|
||||
&& row.subtitle == "亲子识物分类"
|
||||
&& row.badge == "敬请期待"
|
||||
&& row.image_src == "/child-motion-demo/picture-book-grass-stage.png"
|
||||
&& row.visible
|
||||
&& !row.open
|
||||
&& row.sort_order == 90;
|
||||
if !still_old_coming_soon_default {
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.db
|
||||
.creation_entry_type_config()
|
||||
.id()
|
||||
.update(CreationEntryTypeConfig {
|
||||
badge: "可创建".to_string(),
|
||||
open: true,
|
||||
updated_at: now,
|
||||
..row
|
||||
});
|
||||
}
|
||||
|
||||
fn default_creation_entry_type_configs(now: Timestamp) -> Vec<CreationEntryTypeConfig> {
|
||||
module_runtime::default_creation_entry_type_snapshots(now.to_micros_since_unix_epoch())
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user