[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.

feat(source): Make discover abortable

FoxxMD (Apr 2, 2026, 6:41 PM UTC) fb6f6a18 03f8b207

+5 -3
+5 -3
src/backend/sources/AbstractSource.ts
··· 265 265 return existing !== undefined; 266 266 } 267 267 268 - discover = async (plays: PlayObject[], options: { checkAll?: boolean, [key: string]: any } = {}): Promise<PlayObject[]> => { 268 + discover = async (plays: PlayObject[], options: { checkAll?: boolean, signal?: AbortSignal, [key: string]: any } = {}): Promise<PlayObject[]> => { 269 269 const newDiscoveredPlays: PlayObject[] = []; 270 270 271 271 for await(const play of pMapIterable(plays, this.staggerMappers.preCompare(async x => await this.transformPlay(x, TRANSFORM_HOOK.preCompare)), {concurrency: 2})) { 272 + options.signal?.throwIfAborted(); 272 273 if(!(await this.alreadyDiscovered(play, options))) { 274 + options.signal?.throwIfAborted() 273 275 this.addPlayToDiscovered(play); 274 276 newDiscoveredPlays.push(play); 275 277 } ··· 342 344 } catch (e) { 343 345 throw new Error('Error occurred while fetching backlogged plays', {cause: e}); 344 346 } 345 - const discovered = await this.discover(backlogPlays, {discoverLocation: 'backlog'}); 347 + const discovered = await this.discover(backlogPlays, {discoverLocation: 'backlog', signal}); 346 348 347 349 if (scrobbleBacklog) { 348 350 if (discovered.length > 0) { ··· 561 563 this.logger.info(`Potential plays were discovered close to polling interval! Delaying scrobble clients refresh by ${maxDelay} seconds so other clients have time to scrobble first`); 562 564 await sleep(maxDelay * 1000); 563 565 } 564 - newDiscovered = await this.discover(playObjs); 566 + newDiscovered = await this.discover(playObjs, {signal}); 565 567 signal.throwIfAborted(); 566 568 this.scrobble(newDiscovered, 567 569 {