From 329e7205a1c861ade2dfb694e7cc53d3bcd02ad3 Mon Sep 17 00:00:00 2001 From: sevenrats Date: Wed, 12 Jul 2023 13:34:25 -0400 Subject: [PATCH 1/2] dont crash when unplayed strms exist in season --- components/tvshows/TVListDetails.brs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/tvshows/TVListDetails.brs b/components/tvshows/TVListDetails.brs index a3d64638..98245011 100644 --- a/components/tvshows/TVListDetails.brs +++ b/components/tvshows/TVListDetails.brs @@ -97,9 +97,11 @@ sub itemContentChanged() if isValid(itemData.MediaSources) for i = 0 to itemData.MediaSources.Count() - 1 if item.selectedVideoStreamId = itemData.MediaSources[i].id - m.videoCodec.text = tr("Video") + ": " + itemData.MediaSources[i].MediaStreams[0].DisplayTitle - SetupAudioDisplay(itemData.MediaSources[i].MediaStreams, item.selectedAudioStreamIndex) - exit for + if isValid(itemData.MediaSources[i].MediaStreams[0]) and isValid(m.videoCodec) + m.videoCodec.text = tr("Video") + ": " + itemData.MediaSources[i].MediaStreams[0].DisplayTitle + SetupAudioDisplay(itemData.MediaSources[i].MediaStreams, item.selectedAudioStreamIndex) + exit for + end if end if end for m.videoCodec.visible = true From 958620ee649b29d4fc94071ce99cf7fe02457b80 Mon Sep 17 00:00:00 2001 From: sevenrats Date: Wed, 12 Jul 2023 18:39:54 -0400 Subject: [PATCH 2/2] remove superfluous check --- components/tvshows/TVListDetails.brs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/tvshows/TVListDetails.brs b/components/tvshows/TVListDetails.brs index 98245011..3b29b3bf 100644 --- a/components/tvshows/TVListDetails.brs +++ b/components/tvshows/TVListDetails.brs @@ -96,12 +96,10 @@ sub itemContentChanged() m.videoCodec.visible = false if isValid(itemData.MediaSources) for i = 0 to itemData.MediaSources.Count() - 1 - if item.selectedVideoStreamId = itemData.MediaSources[i].id - if isValid(itemData.MediaSources[i].MediaStreams[0]) and isValid(m.videoCodec) - m.videoCodec.text = tr("Video") + ": " + itemData.MediaSources[i].MediaStreams[0].DisplayTitle - SetupAudioDisplay(itemData.MediaSources[i].MediaStreams, item.selectedAudioStreamIndex) - exit for - end if + if item.selectedVideoStreamId = itemData.MediaSources[i].id and isValid(itemData.MediaSources[i].MediaStreams[0]) + m.videoCodec.text = tr("Video") + ": " + itemData.MediaSources[i].MediaStreams[0].DisplayTitle + SetupAudioDisplay(itemData.MediaSources[i].MediaStreams, item.selectedAudioStreamIndex) + exit for end if end for m.videoCodec.visible = true