From 0eb6ac97711893edad69af8777c585b0d38a6a9d Mon Sep 17 00:00:00 2001 From: Christian Benincasa Date: Tue, 4 Jun 2024 17:25:22 -0400 Subject: [PATCH] Hotfix for audio stream index selection --- server/src/stream/plex/PlexStreamDetails.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/server/src/stream/plex/PlexStreamDetails.ts b/server/src/stream/plex/PlexStreamDetails.ts index f8b716367..28c7ac488 100644 --- a/server/src/stream/plex/PlexStreamDetails.ts +++ b/server/src/stream/plex/PlexStreamDetails.ts @@ -6,15 +6,7 @@ import { PlexMovie, PlexMusicTrack, } from '@tunarr/types/plex'; -import { - find, - first, - indexOf, - isNull, - isUndefined, - replace, - trimEnd, -} from 'lodash-es'; +import { find, first, isNull, isUndefined, replace, trimEnd } from 'lodash-es'; import { PlexServerSettings } from '../../dao/entities/PlexServerSettings'; import { Plex, @@ -258,9 +250,7 @@ export class PlexStreamDetails { if (!isUndefined(audioStream)) { streamDetails.audioChannels = audioStream.channels; streamDetails.audioCodec = audioStream.codec; - // TODO: I dont love calling indexOf when we already searched for this - // stream in the list in the first place - streamDetails.audioIndex = indexOf(firstStream, audioStream)?.toString(); + streamDetails.audioIndex = audioStream?.index.toString() ?? 'a'; } if (isUndefined(videoStream) && isUndefined(audioStream)) {