From 20e46bd05483790225516147d76df1e00ffb4b86 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Tue, 29 Sep 2026 19:54:24 +0000 Subject: [PATCH] feat(tuneshine): Prevent now playing when no artwork in play --- src/backend/scrobblers/TuneshineScrobbler.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/backend/scrobblers/TuneshineScrobbler.ts b/src/backend/scrobblers/TuneshineScrobbler.ts index c73a8a0f..8cefc65e 100644 --- a/src/backend/scrobblers/TuneshineScrobbler.ts +++ b/src/backend/scrobblers/TuneshineScrobbler.ts @@ -1,4 +1,4 @@ -import { childLogger, type Logger } from "@foxxmd/logging"; +import { childLogger, type Logger, type LogLevel } from "@foxxmd/logging"; import type EventEmitter from "events"; import {type PlayMatchResult, type PlayObject, type SourcePlayerObj} from "../../core/Atomic.ts"; import type {FormatPlayObjectOptions} from "../common/infrastructure/Atomic.ts"; @@ -70,4 +70,22 @@ export default class TuneshineScrobbler extends AbstractScrobbleClient { throw e; } } + + shouldUpdatePlayingNowPlatformSpecific = async (data: SourcePlayerObj): Promise<[boolean, string?, LogLevel?]> => { + if(data === undefined || data.play === undefined) { + return [true]; + } + let artUrl: string | undefined = undefined; + if (data.play.meta?.art?.track !== undefined) { + artUrl = data.play.meta?.art?.track; + } else if (data.play.meta?.art?.album !== undefined) { + artUrl = data.play.meta?.art?.album; + } else if (data.play.meta?.art?.artist !== undefined) { + artUrl = data.play.meta?.art?.artist; + } + if (artUrl === undefined) { + return [false, 'Play does not contain artwork']; + } + return [true]; + } } \ No newline at end of file -- 2.54.0