From fc1172ca1b84b0e8aeef232bc89e1164d13e7fd0 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Tue, 14 May 2024 23:05:26 +0800 Subject: [PATCH] Update banner --- src/data/banners.ts | 20 +++++++++ src/migrations/1715699010371-UpdateBanner.ts | 43 ++++++++++++++++++++ src/queue/tally.ts | 4 +- src/routes/wish.ts | 4 +- 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 src/migrations/1715699010371-UpdateBanner.ts diff --git a/src/data/banners.ts b/src/data/banners.ts index 2814e6f..a6613cc 100644 --- a/src/data/banners.ts +++ b/src/data/banners.ts @@ -691,6 +691,16 @@ export const banners: { [key: number]: Banner } = { featuredRare: ['freminet', 'lynette', 'xiangling'], timezoneDependent: true, }, + 300065: { + name: 'From Ashes Reborn', + image: 3, + shortName: 'Wanderer', + start: '2024-05-14 18:00:00', + end: '2024-06-04 14:59:00', + color: '#31cae1', + featured: ['wanderer', 'baizhu'], + featuredRare: ['layla', 'faruzan', 'beidou'], + }, 400001: { name: 'Epitome Invocation', @@ -1458,6 +1468,16 @@ export const banners: { [key: number]: Banner } = { ], timezoneDependent: true, }, + 400064: { + name: 'Epitome Invocation', + image: 64, + shortName: 'Tulaytullah', + start: '2024-05-14 18:00:00', + end: '2024-06-04 14:59:00', + color: '#eae5e1', + featured: ['tulaytullahs_remembrance', 'jadefalls_splendor'], + featuredRare: ['prospectors_drill', 'range_gauge', 'favonius_sword', 'rainslasher', 'sacrificial_fragments'], + }, 500001: { name: 'Ode to the Dawn Breeze', diff --git a/src/migrations/1715699010371-UpdateBanner.ts b/src/migrations/1715699010371-UpdateBanner.ts new file mode 100644 index 0000000..5ce53a8 --- /dev/null +++ b/src/migrations/1715699010371-UpdateBanner.ts @@ -0,0 +1,43 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; +import { Banner } from "../entities/banner"; + +const banners = { + characters: { + name: "From Ashes Reborn", + start: "2024-05-14 18:00:00", + end: "2024-06-04 14:59:00", + id: 300065, + }, + weapons: { + name: "Epitome Invocation", + start: "2024-05-14 18:00:00", + end: "2024-06-04 14:59:00", + id: 400064, + }, +}; + +export class UpdateBanner1715699010371 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + const newCharacterBanner = banners.characters; + const characterBanner = new Banner(); + characterBanner.id = newCharacterBanner.id; + characterBanner.type = "characters"; + characterBanner.name = newCharacterBanner.name; + characterBanner.start = `${newCharacterBanner.start}+8`; + characterBanner.end = `${newCharacterBanner.end}+8`; + + const newWeaponBanner = banners.weapons; + const weaponBanner = new Banner(); + weaponBanner.id = newWeaponBanner.id; + weaponBanner.type = "weapons"; + weaponBanner.name = newWeaponBanner.name; + weaponBanner.start = `${newWeaponBanner.start}+8`; + weaponBanner.end = `${newWeaponBanner.end}+8`; + + await queryRunner.manager.save([characterBanner, weaponBanner]); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.manager.delete(Banner, [300065, 400064]); + } +} diff --git a/src/queue/tally.ts b/src/queue/tally.ts index d7f3ebd..7d27b82 100644 --- a/src/queue/tally.ts +++ b/src/queue/tally.ts @@ -306,8 +306,8 @@ async function calculateWishTally(job: Job): Promise { calculated[id] = result; } -const LATEST_CHARACTER_BANNER = 300064; -const LATEST_WEAPON_BANNER = 400063; +const LATEST_CHARACTER_BANNER = 300065; +const LATEST_WEAPON_BANNER = 400064; const LATEST_CHRONICLED_BANNER = 500001; const TOTAL_BANNER = LATEST_CHARACTER_BANNER - 300009; diff --git a/src/routes/wish.ts b/src/routes/wish.ts index b0ba941..df0378e 100644 --- a/src/routes/wish.ts +++ b/src/routes/wish.ts @@ -23,8 +23,8 @@ import { WishSummaryRequest } from '../types/wishSummaryRequest'; import { WishSummaryLuckRequest } from '../types/wishSummaryLuckRequest'; import { wishSummary, wishSummaryLuck4, wishSummaryLuck5, wishSummaryWinRateOff4, wishSummaryWinRateOff5 } from '../stores/wishSummary'; -const LATEST_CHARACTER_BANNER = 300064; -const LATEST_WEAPON_BANNER = 400063; +const LATEST_CHARACTER_BANNER = 300065; +const LATEST_WEAPON_BANNER = 400064; export default async function (server: FastifyInstance): Promise { server.get(