From b298be3b6e963a225f79b0b8cd4a26fc6e714436 Mon Sep 17 00:00:00 2001 From: Christian Benincasa Date: Fri, 27 Dec 2024 08:23:30 -0500 Subject: [PATCH] fix: fix default audio stream sort for boolean --- server/src/stream/jellyfin/JellyfinStreamDetails.ts | 2 +- server/src/stream/plex/PlexStreamDetails.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/stream/jellyfin/JellyfinStreamDetails.ts b/server/src/stream/jellyfin/JellyfinStreamDetails.ts index 6ef345795..d3807442d 100644 --- a/server/src/stream/jellyfin/JellyfinStreamDetails.ts +++ b/server/src/stream/jellyfin/JellyfinStreamDetails.ts @@ -260,7 +260,7 @@ export class JellyfinStreamDetails { firstMediaSource?.MediaStreams, (stream) => stream.Type === 'Audio', ), - (stream) => [stream.Index ?? 0, !!stream.IsDefault], + (stream) => [stream.Index ?? 0, !stream.IsDefault], ), (audioStream) => { return { diff --git a/server/src/stream/plex/PlexStreamDetails.ts b/server/src/stream/plex/PlexStreamDetails.ts index 9656784d5..7dd10ad7a 100644 --- a/server/src/stream/plex/PlexStreamDetails.ts +++ b/server/src/stream/plex/PlexStreamDetails.ts @@ -309,7 +309,10 @@ export class PlexStreamDetails { filter(mediaStreams, (stream): stream is PlexMediaAudioStream => { return stream.streamType === 2; }), - (stream) => [stream.index, stream.selected ?? stream.default ?? false], + (stream) => [ + stream.index, + !(stream.selected ?? stream.default ?? false), + ], ), (audioStream) => { return {