Option to choose between which service shows the poster in large image (#411)

This commit is contained in:
SerStars 2025-09-22 18:26:03 +02:00 • committed by GitHub
parent 5c6b7f5519
commit 7bc6cfb53a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -87,6 +87,14 @@ const settings = definePluginSettings({
type: OptionType.BOOLEAN,
default: true,
},
posterSource: {
description: "Choose which poster to display in Rich Presence",
type: OptionType.SELECT,
options: [
{ label: "Jellyfin", value: "jellyfin", default: true },
{ label: "TheMovieDB", value: "tmdb" },
],
},
overrideRichPresenceType: {
description: "Override the rich presence type",
type: OptionType.SELECT,
@ -310,7 +318,14 @@ export default definePlugin({
}
const assets: ActivityAssets = {
large_image: tmdbData?.posterPath ? await getApplicationAsset(tmdbData.posterPath) : mediaData.imageUrl ? await getApplicationAsset(mediaData.imageUrl) : undefined,
large_image:
settings.store.posterSource === "tmdb"
? (tmdbData?.posterPath
? await getApplicationAsset(tmdbData.posterPath)
: undefined)
: (mediaData.imageUrl
? await getApplicationAsset(mediaData.imageUrl)
: undefined),
large_text: mediaData.seriesName || mediaData.album || undefined,
};