diff --git a/src/backend/common/infrastructure/config/source/deezer.ts b/src/backend/common/infrastructure/config/source/deezer.ts index a8708389..42b3020d 100644 --- a/src/backend/common/infrastructure/config/source/deezer.ts +++ b/src/backend/common/infrastructure/config/source/deezer.ts @@ -81,6 +81,14 @@ export type DeezerInternalData = z.infer; export const deezerInternalSourceOptionsSchema = z.object({ ...commonSourceOptionsSchema.shape, + /** + * Set the heuristic level of duplicate/repeated track pruning from listening history. + * + * Some third party integrations (Sonos) cause Deezer to report the same track many times in listening history + * + * * `true` => detect plays with play times at exact, close to, or fuzzy (beginning/end of predicated play time + duration) + * * `aggressive` => above AND check for plays during previous play times that occurred during the track (50% +/- duration plus playedAt date) + */ fuzzyDiscoveryIgnore: z.union([z.boolean(), z.literal('aggressive')]).optional(), }); diff --git a/src/backend/sources/DeezerInternalSource.ts b/src/backend/sources/DeezerInternalSource.ts index 7cb2dc19..3f3ff099 100644 --- a/src/backend/sources/DeezerInternalSource.ts +++ b/src/backend/sources/DeezerInternalSource.ts @@ -333,7 +333,7 @@ export default class DeezerInternalSource extends MemorySource { protected getBackloggedPlays = async (options: RecentlyPlayedOptions = {}) => await this.getRecentlyPlayed({formatted: true, ...options}) - existingDiscovered = async (play: PlayObject, opts: {checkAll?: boolean} = {}): Promise => { + async existingDiscovered(play: PlayObject): Promise { const list: PlayObject[] = await this.getRecentlyDiscoveredPlays(); const candidate = await this.transformPlay(play, TRANSFORM_HOOK.candidate); const existing = await findAsync(list, async x => {