[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

fix(client): Fix dead to queued queueName constraint in the wrong part of the query

Was setting all failed states to dead queue when it should have been a where condition ON dead queue name

#588

FoxxMD (May 8, 2026, 1:30 PM UTC) 90f0bdb5 640d944b

+7 -9
+7 -9
src/backend/common/database/drizzle/repositories/QueueRepository.ts
··· 1 - import { Logger, eq, and, lte, inArray } from "drizzle-orm"; 1 + import { eq, and, lte, inArray } from "drizzle-orm"; 2 2 import { DrizzleBaseRepository, DrizzleRepositoryOpts } from "./BaseRepository.js"; 3 3 import { getDb } from "../drizzleUtils.js"; 4 - import { ComponentNew, ComponentSelect, FindWhere, QueueStateSelect } from "../drizzleTypes.js"; 5 - import { components, queueStates } from "../schema/schema.js"; 6 - import { generateComponentEntity } from "../entityUtils.js"; 4 + import { QueueStateSelect } from "../drizzleTypes.js"; 5 + import { queueStates } from "../schema/schema.js"; 7 6 import { CLIENT_DEAD_QUEUE } from "../../../../../core/Atomic.js"; 8 - 9 7 export class DrizzleQueueRepository extends DrizzleBaseRepository<'queueStates'> { 10 8 11 9 constructor(db: ReturnType<typeof getDb>, opts: DrizzleRepositoryOpts = {}) { ··· 15 13 public deadFailedToQueue = async (componentId: number, retries: number): Promise<void> => { 16 14 await this.db.update(queueStates).set({ 17 15 queueStatus: 'queued', 18 - queueName: CLIENT_DEAD_QUEUE 19 16 }).where(and( 20 17 eq(queueStates.componentId, componentId), 21 18 lte(queueStates.retries, retries), 22 - eq(queueStates.queueStatus, 'failed') 19 + eq(queueStates.queueStatus, 'failed'), 20 + eq(queueStates.queueName, CLIENT_DEAD_QUEUE) 23 21 )); 24 22 } 25 23 26 24 public failedQueueToCompleted = async (componentId: number): Promise<void> => { 27 25 await this.db.update(queueStates).set({ 28 26 queueStatus: 'completed', 29 - queueName: CLIENT_DEAD_QUEUE 30 27 }).where(and( 31 28 eq(queueStates.componentId, componentId), 32 - eq(queueStates.queueStatus, 'queued') 29 + eq(queueStates.queueStatus, 'queued'), 30 + eq(queueStates.queueName, CLIENT_DEAD_QUEUE) 33 31 )); 34 32 } 35 33