From 0956413bbc1905040bd560fee96f87a537641763 Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Wed, 17 Jul 2024 15:13:58 +0800 Subject: [PATCH] Update banner --- src/data/banners.ts | 22 ++++++++++ src/migrations/1721200362432-UpdateBanner.ts | 43 ++++++++++++++++++++ src/queue/tally.ts | 4 +- src/routes/wish.ts | 4 +- 4 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 src/migrations/1721200362432-UpdateBanner.ts diff --git a/src/data/banners.ts b/src/data/banners.ts index 147334f..ad32b93 100644 --- a/src/data/banners.ts +++ b/src/data/banners.ts @@ -722,6 +722,17 @@ export const banners: { [key: number]: Banner } = { featured: ['sigewinne', 'furina'], featuredRare: ['noelle', 'gaming', 'rosaria'], }, + 300068: { + name: 'In the Name of the Rosula', + image: 2, + shortName: 'Navia', + start: '2024-07-17 06:00:00', + end: '2024-08-06 17:59:00', + color: '#fadbf8', + featured: ['navia', 'nilou'], + featuredRare: ['kirara', 'kaveh', 'ningguang'], + timezoneDependent: true, + }, 400001: { name: 'Epitome Invocation', @@ -1520,6 +1531,17 @@ export const banners: { [key: number]: Banner } = { featured: ['silvershower_heartstrings', 'splendor_of_tranquil_waters'], featuredRare: ['lithic_blade', 'lions_roar', 'favonius_lance', 'favonius_codex', 'sacrificial_bow'], }, + 400067: { + name: 'Epitome Invocation', + image: 67, + shortName: 'Verdict', + start: '2024-07-17 06:00:00', + end: '2024-08-06 17:59:00', + color: '#eae5e1', + featured: ['verdict', 'key_of_khaj-nisut'], + featuredRare: ['xiphos_moonlight', 'the_bell', 'dragons_bane', 'eye_of_perception', 'rust'], + timezoneDependent: true, + }, 500001: { name: 'Ode to the Dawn Breeze', diff --git a/src/migrations/1721200362432-UpdateBanner.ts b/src/migrations/1721200362432-UpdateBanner.ts new file mode 100644 index 0000000..141ddc2 --- /dev/null +++ b/src/migrations/1721200362432-UpdateBanner.ts @@ -0,0 +1,43 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; +import { Banner } from '../entities/banner'; + +const banners = { + characters: { + name: 'In the Name of the Rosula', + start: '2024-06-05 06:00:00', + end: '2024-06-25 17:59:00', + id: 300068, + }, + weapons: { + name: 'Epitome Invocation', + start: '2024-06-05 06:00:00', + end: '2024-06-25 17:59:00', + id: 400067, + }, +}; + +export class UpdateBanner1721200362432 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, [300068, 400067]); + } +} diff --git a/src/queue/tally.ts b/src/queue/tally.ts index f59e678..c8e220b 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 = 300067; -const LATEST_WEAPON_BANNER = 400066; +const LATEST_CHARACTER_BANNER = 300068; +const LATEST_WEAPON_BANNER = 400067; 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 81440fb..c299dbc 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 = 300067; -const LATEST_WEAPON_BANNER = 400066; +const LATEST_CHARACTER_BANNER = 300068; +const LATEST_WEAPON_BANNER = 400067; export default async function (server: FastifyInstance): Promise { server.get(