Code cleanup

Co-authored-by: Bond-009 <bond.009@outlook.com>
This commit is contained in:
gnattu 2024-07-18 17:49:44 +08:00 committed by GitHub
parent ce7cbc1f64
commit cb7714a32e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -186,8 +186,12 @@ public class UniversalAudioController : BaseJellyfinApiController
var supportedHlsContainers = new[] { "ts", "mp4" };
// fallback to mpegts if device reports some weird value unsupported by hls
var requestedSegmentContainer = Array.Exists(supportedHlsContainers, element => element == transcodingContainer) ? transcodingContainer : "ts";
var segmentContainer = Array.Exists(supportedHlsContainers, element => element == mediaSource.TranscodingContainer) ? mediaSource.TranscodingContainer : requestedSegmentContainer;
var requestedSegmentContainer = Array.Exists(
supportedHlsContainers,
element => string.Equals(element, transcodingContainer, StringComparison.OrdinalIgnoreCase)) ? transcodingContainer : "ts";
var segmentContainer = Array.Exists(
supportedHlsContainers,
element => string.Equals(element, mediaSource.TranscodingContainer, StringComparison.OrdinalIgnoreCase)) ? mediaSource.TranscodingContainer : requestedSegmentContainer;
var dynamicHlsRequestDto = new HlsAudioRequestDto
{
Id = itemId,