From f51fffa352ac469dbb68520b32f3377f086863ad Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Tue, 10 Dec 2024 15:25:02 +0800 Subject: [PATCH] Update banners --- src/data/banners.ts | 26 ++++++++++++ src/migrations/1733815438034-UpdateBanner.ts | 43 ++++++++++++++++++++ src/queue/tally.ts | 4 +- src/routes/wish.ts | 4 +- 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 src/migrations/1733815438034-UpdateBanner.ts diff --git a/src/data/banners.ts b/src/data/banners.ts index ee4958b..ba82a8b 100644 --- a/src/data/banners.ts +++ b/src/data/banners.ts @@ -796,6 +796,16 @@ export const banners: { [key: number]: Banner } = { featuredRare: ['ororon', 'sucrose', 'barbara'], timezoneDependent: true, }, + 300075: { + name: 'Decree of the Deeps', + image: 3, + shortName: 'Neuvillette', + start: '2024-12-10 18:00:00', + end: '2024-12-31 14:59:00', + color: '#72fefd', + featured: ['neuvillette', 'zhongli'], + featuredRare: ['shikanoin_heizou', 'fischl', 'yaoyao'], + }, 400001: { name: 'Epitome Invocation', @@ -1673,6 +1683,22 @@ export const banners: { [key: number]: Banner } = { featured: ['astral_vultures_crimson_plumage', 'the_first_great_magic'], featuredRare: ['waveriding_whirl', 'flower-wreathed_feathers', 'the_flute', 'the_bell', 'favonius_lance'], }, + 400074: { + name: 'Epitome Invocation', + image: 74, + shortName: 'Tome', + start: '2024-12-10 18:00:00', + end: '2024-12-31 14:59:00', + color: '#eae5e1', + featured: ['tome_of_the_eternal_flow', 'vortex_vanquisher'], + featuredRare: [ + 'mitternachts_waltz', + 'favonius_sword', + 'favonius_greatsword', + 'dragons_bane', + 'sacrificial_fragments', + ], + }, 500001: { name: 'Ode to the Dawn Breeze', diff --git a/src/migrations/1733815438034-UpdateBanner.ts b/src/migrations/1733815438034-UpdateBanner.ts new file mode 100644 index 0000000..50be9fb --- /dev/null +++ b/src/migrations/1733815438034-UpdateBanner.ts @@ -0,0 +1,43 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; +import { Banner } from '../entities/banner'; + +const banners = { + characters: { + name: "Piercing Shot's Crimson Wake", + start: '2024-12-10 18:00:00', + end: '2024-12-31 14:59:00', + id: 300075, + }, + weapons: { + name: 'Epitome Invocation', + start: '2024-12-10 18:00:00', + end: '2024-12-31 14:59:00', + id: 400074, + }, +}; + +export class UpdateBanner1733815438034 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, [300074, 400073]); + } +} diff --git a/src/queue/tally.ts b/src/queue/tally.ts index d376d72..c069e78 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 = 300074; -const LATEST_WEAPON_BANNER = 400073; +const LATEST_CHARACTER_BANNER = 300075; +const LATEST_WEAPON_BANNER = 400074; 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 0212868..6cddbfc 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 = 300074; -const LATEST_WEAPON_BANNER = 400073; +const LATEST_CHARACTER_BANNER = 300075; +const LATEST_WEAPON_BANNER = 400074; export default async function (server: FastifyInstance): Promise { server.get(