Skip to content

Commit

Permalink
fix: matthew's rescuing this
Browse files Browse the repository at this point in the history
  • Loading branch information
bendevnull committed Aug 3, 2024
1 parent d4bf630 commit ff200c0
Showing 1 changed file with 7 additions and 39 deletions.
46 changes: 7 additions & 39 deletions src/lib/riitag/neo/std/Covers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
Expand Down

0 comments on commit ff200c0

Please sign in to comment.