Skip to content

Commit

Permalink
fix: Doubled up
Browse files Browse the repository at this point in the history
  • Loading branch information
matthe815 committed Aug 4, 2024
1 parent 2346bb4 commit 0466562
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 7 deletions.
125 changes: 125 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"next-connect": "0.13.0",
"next-seo": "5.15.0",
"nextjs-progressbar": "0.0.16",
"pg": "^8.12.0",
"pino": "8.8.0",
"pino-pretty": "^10.3.1",
"prop-types": "15.8.1",
Expand Down
Binary file added public/img/flag/flag_ct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/lib/constants/forms/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,10 @@ export const FLAGS = Object.freeze([
{
value: 'wiiu',
label: 'Wii U'
},
{
value: 'flag_ct',
label: 'CT'
}
])

Expand Down
8 changes: 1 addition & 7 deletions src/lib/riitag/neo/std/Covers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { user } from '@prisma/client'

const xml2js = require('xml2js')

const pg = require('pg');
const pg = require('pg')
const { Client } = pg
const client = new Client({
host: 'localhost',
Expand Down Expand Up @@ -197,22 +197,16 @@ export default class Covers extends ModuleBase {
}

async fix (userId: number) {
await client.connect()
const res = await client.query('SELECT * FROM playlog WHERE user_id=$1', [userId])
console.log(res.rows) // Hello world!

for (const row of res.rows) {
console.log(row)

const res = await client.query('SELECT * FROM game WHERE game_pk=$1', [row.game_pk])
if (res.rows.length === 0) {
console.log('No game found for game_pk', row.game_pk)
await client.query('DELETE FROM playlog WHERE game_pk=$1', [row.game_pk])
}
console.log(res.rows)
}

await client.end()
}

/**
Expand Down

0 comments on commit 0466562

Please sign in to comment.