From ff200c085ac4e4227c4dc9999234d56d1686b570 Mon Sep 17 00:00:00 2001 From: bendevnull Date: Sat, 3 Aug 2024 04:11:58 +0000 Subject: [PATCH] fix: matthew's rescuing this --- src/lib/riitag/neo/std/Covers.ts | 46 +++++--------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) diff --git a/src/lib/riitag/neo/std/Covers.ts b/src/lib/riitag/neo/std/Covers.ts index 4ab3d35..5cd21cf 100644 --- a/src/lib/riitag/neo/std/Covers.ts +++ b/src/lib/riitag/neo/std/Covers.ts @@ -199,8 +199,12 @@ export default class Covers extends ModuleBase { } }, select: { - game_pk: true, - playlog_id: true + game: { + select: { + game_id: true, + console: true + } + } }, orderBy: { played_on: 'desc' @@ -214,45 +218,9 @@ export default class Covers extends ModuleBase { return [] } - for (const entry of playlog) { - const doesntmatter = await prisma.game.findFirst({ - where: { - game_pk: entry.game_pk - } - }) - if (!doesntmatter || doesntmatter.console === CONSOLE.THREEDS) { - await prisma.playlog.delete({ - where: { - playlog_id: entry.playlog_id - } - }) - } - } - - const otherPlaylog = await prisma.playlog.findMany({ - where: { - user: { - id: user.id - } - }, - select: { - game: { - select: { - console: true, - game_id: true - } - } - }, - orderBy: { - played_on: 'desc' - }, - distinct: ['game_pk'], - take: this.max - }) - const coverPaths = [] - for (const logEntry of otherPlaylog) { + for (const logEntry of playlog) { coverPaths.push(this.getCover( logEntry.game.console, user.cover_type,