support secondary public server URL

This commit is contained in:
jeffvli
2025-12-30 21:05:38 -08:00
parent 7aeadb531f
commit 72d0fca28b
16 changed files with 244 additions and 68 deletions
@@ -41,6 +41,7 @@ export const useDiscordRpc = () => {
imageUrl: currentSong?.imageUrl,
itemType: LibraryItem.SONG,
type: 'table',
useRemoteUrl: true,
});
const imageUrlRef = useRef<null | string | undefined>(imageUrl);
@@ -194,14 +195,13 @@ export const useDiscordRpc = () => {
}
if (discordSettings.showServerImage && song) {
// Use imageUrl from useItemImageUrl hook if available and song matches current song
if (song._uniqueId === currentSong?._uniqueId && imageUrlRef.current) {
activity.largeImageKey = imageUrlRef.current;
} else {
// Fallback to old logic if song doesn't match (shouldn't happen in normal flow)
if (song._serverType === ServerType.JELLYFIN && song.imageUrl) {
activity.largeImageKey = song.imageUrl;
} else if (song._serverType === ServerType.NAVIDROME) {
activity.largeImageKey = imageUrlRef.current;
} else if (
song._serverType === ServerType.NAVIDROME ||
song._serverType === ServerType.SUBSONIC
) {
try {
const info = await api.controller.getAlbumInfo({
apiClientProps: { serverId: song._serverId },