-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix/add-context-menu: format code && fix other minor things
- Loading branch information
Showing
41 changed files
with
275 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ out | |
*.log* | ||
.env | ||
.vite | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/migrations/1716776027208-alter_lastTimePlayed_to_datime.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Game } from "@main/entity"; | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class AlterLastTimePlayedToDatime1716776027208 | ||
implements MigrationInterface | ||
{ | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
// 2024-05-27 02:08:17 | ||
// Mon, 27 May 2024 02:08:17 GMT | ||
const updateLastTimePlayedValues = ` | ||
UPDATE game SET lastTimePlayed = (SELECT | ||
SUBSTR(lastTimePlayed, 13, 4) || '-' || -- Year | ||
CASE SUBSTR(lastTimePlayed, 9, 3) | ||
WHEN 'Jan' THEN '01' | ||
WHEN 'Feb' THEN '02' | ||
WHEN 'Mar' THEN '03' | ||
WHEN 'Apr' THEN '04' | ||
WHEN 'May' THEN '05' | ||
WHEN 'Jun' THEN '06' | ||
WHEN 'Jul' THEN '07' | ||
WHEN 'Aug' THEN '08' | ||
WHEN 'Sep' THEN '09' | ||
WHEN 'Oct' THEN '10' | ||
WHEN 'Nov' THEN '11' | ||
WHEN 'Dec' THEN '12' | ||
END || '-' || -- Month | ||
SUBSTR(lastTimePlayed, 6, 2) || ' ' || -- Day | ||
SUBSTR(lastTimePlayed, 18, 8) -- hh:mm:ss; | ||
FROM game) | ||
WHERE lastTimePlayed IS NOT NULL; | ||
`; | ||
|
||
await queryRunner.query(updateLastTimePlayedValues); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
const queryBuilder = queryRunner.manager.createQueryBuilder(Game, "game"); | ||
|
||
const result = await queryBuilder.getMany(); | ||
|
||
for (const game of result) { | ||
if (!game.lastTimePlayed) continue; | ||
await queryRunner.query( | ||
`UPDATE game set lastTimePlayed = ? WHERE id = ?;`, | ||
[game.lastTimePlayed.toUTCString(), game.id] | ||
); | ||
} | ||
} | ||
} |
Oops, something went wrong.