Skip to content

Commit

Permalink
Update banner
Browse files Browse the repository at this point in the history
  • Loading branch information
MadeBaruna committed May 2, 2023
1 parent 6ac7b86 commit cdb70b6
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
20 changes: 20 additions & 0 deletions src/data/banners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,16 @@ export const banners: { [key: number]: Banner } = {
featuredRare: ['kuki_shinobu', 'dori', 'layla'],
timezoneDependent: true,
},
300047: {
name: 'Immaculate Pulse',
image: 1,
shortName: 'Baizhu',
start: '2023-05-02 18:00:00',
end: '2023-05-23 14:59:59',
color: '#8fdaa0',
featured: ['baizhu', 'ganyu'],
featuredRare: ['kaveh', 'candace', 'fischl'],
},

400001: {
name: 'Epitome Invocation',
Expand Down Expand Up @@ -1056,4 +1066,14 @@ export const banners: { [key: number]: Banner } = {
],
timezoneDependent: true,
},
400046: {
name: 'Epitome Invocation',
image: 46,
shortName: 'jadefalls_splendor',
start: '2023-05-02 18:00:00',
end: '2023-05-23 14:59:59',
color: '#eae5e1',
featured: ['jadefalls_splendor', 'amos_bow'],
featuredRare: ['makhaira_aquamarine', 'wandering_evenstar', 'lions_roar', 'favonius_lance', 'sacrificial_bow'],
},
};
43 changes: 43 additions & 0 deletions src/migrations/1683035212316-UpdateBanner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { Banner } from '../entities/banner';

const banners = {
characters: {
name: 'Immaculate Pulse',
start: '2023-05-02 18:00:00',
end: '2023-05-23 14:59:59',
id: 300047,
},
weapons: {
name: 'Epitome Invocation',
start: '2023-05-02 18:00:00',
end: '2023-05-23 14:59:59',
id: 400046,
},
};

export class UpdateBanner1683035212316 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
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<void> {
await queryRunner.manager.delete(Banner, [300047, 400046]);
}
}
4 changes: 2 additions & 2 deletions src/queue/tally.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ async function calculateWishTally(job: Job<number>): Promise<void> {
calculated[id] = result;
}

const LATEST_CHARACTER_BANNER = 300046;
const LATEST_WEAPON_BANNER = 400045;
const LATEST_CHARACTER_BANNER = 300047;
const LATEST_WEAPON_BANNER = 400046;
const TOTAL_BANNER = LATEST_CHARACTER_BANNER - 300009;

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
4 changes: 2 additions & 2 deletions src/routes/wish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 300046;
const LATEST_WEAPON_BANNER = 400045;
const LATEST_CHARACTER_BANNER = 300047;
const LATEST_WEAPON_BANNER = 400046;

export default async function (server: FastifyInstance): Promise<void> {
server.get(
Expand Down

0 comments on commit cdb70b6

Please sign in to comment.