Skip to content

Commit

Permalink
Hotfix for audio stream index selection
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbenincasa committed Jun 4, 2024
1 parent ca8e8e7 commit 0eb6ac9
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions server/src/stream/plex/PlexStreamDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 0eb6ac9

Please sign in to comment.