|
@@ -1,4 +1,5 @@
|
|
|
using System;
|
|
|
+using System.Collections.Specialized;
|
|
|
using System.IO;
|
|
|
using System.Linq;
|
|
|
using System.Text.Json;
|
|
@@ -19,65 +20,69 @@ namespace Jellyfin.MediaBrowser.Model.Tests
|
|
|
[Theory]
|
|
|
// Chrome
|
|
|
[InlineData("Chrome", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Chrome", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Chrome", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectStream
|
|
|
- [InlineData("Chrome", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, true)]
|
|
|
- [InlineData("Chrome", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, true)]
|
|
|
- [InlineData("Chrome", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be 'false'
|
|
|
- [InlineData("Chrome", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be 'false'
|
|
|
+ [InlineData("Chrome", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Chrome", "mp4-h264-ac3-aacDef-srt-2600k", PlayMethod.Transcode, TranscodeReason.SecondaryAudioNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Chrome", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectStream
|
|
|
+ [InlineData("Chrome", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Chrome", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Chrome", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
+ [InlineData("Chrome", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
[InlineData("Chrome", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
// Firefox
|
|
|
[InlineData("Firefox", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Firefox", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Firefox", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectStream
|
|
|
- [InlineData("Firefox", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, true)]
|
|
|
- [InlineData("Firefox", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, true)]
|
|
|
- [InlineData("Firefox", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be 'false'
|
|
|
- [InlineData("Firefox", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be 'false'
|
|
|
+ [InlineData("Firefox", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Firefox", "mp4-h264-ac3-aacDef-srt-2600k", PlayMethod.Transcode, TranscodeReason.SecondaryAudioNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Firefox", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectStream
|
|
|
+ [InlineData("Firefox", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Firefox", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Firefox", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
+ [InlineData("Firefox", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
[InlineData("Firefox", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
// Safari
|
|
|
[InlineData("SafariNext", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("SafariNext", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("SafariNext", "mp4-h264-ac3-aacDef-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("SafariNext", "mp4-h264-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("SafariNext", "mp4-hevc-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should probably be DirectPlay
|
|
|
[InlineData("SafariNext", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should probably be DirectPlay
|
|
|
// AndroidPixel
|
|
|
[InlineData("AndroidPixel", "mp4-h264-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("AndroidPixel", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("AndroidPixel", "mp4-h264-ac3-aacDef-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("AndroidPixel", "mp4-h264-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("AndroidPixel", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, true)]
|
|
|
- [InlineData("AndroidPixel", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, true)]
|
|
|
+ [InlineData("AndroidPixel", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")]
|
|
|
+ [InlineData("AndroidPixel", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")]
|
|
|
// Yatse
|
|
|
[InlineData("Yatse", "mp4-h264-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Yatse", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Yatse", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, true)]
|
|
|
+ [InlineData("Yatse", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Yatse", "mp4-h264-ac3-aacDef-srt-2600k", PlayMethod.Transcode, TranscodeReason.SecondaryAudioNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Yatse", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")]
|
|
|
[InlineData("Yatse", "mp4-hevc-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Yatse", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Yatse", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
// RokuSSPlus
|
|
|
[InlineData("RokuSSPlus", "mp4-h264-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("RokuSSPlus", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("RokuSSPlus", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectStream
|
|
|
+ [InlineData("RokuSSPlus", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-h264-ac3-aacDef-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectStream
|
|
|
[InlineData("RokuSSPlus", "mp4-hevc-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("RokuSSPlus", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("RokuSSPlus", "mp4-hevc-ac3-srt-15200k", PlayMethod.Transcode, true)] // #6450 should be DirectStream
|
|
|
+ [InlineData("RokuSSPlus", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-hevc-ac3-srt-15200k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectStream
|
|
|
// JellyfinMediaPlayer
|
|
|
[InlineData("JellyfinMediaPlayer", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("JellyfinMediaPlayer", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("JellyfinMediaPlayer", "mp4-h264-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
- [InlineData("JellyfinMediaPlayer", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("JellyfinMediaPlayer", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit)] // #6450 should be DirectPlay
|
|
|
[InlineData("JellyfinMediaPlayer", "mkv-vp9-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("JellyfinMediaPlayer", "mkv-vp9-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("JellyfinMediaPlayer", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
// TranscodeMedia
|
|
|
- [InlineData("TranscodeMedia", "mp4-h264-aac-vtt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("TranscodeMedia", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("TranscodeMedia", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("TranscodeMedia", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("TranscodeMedia", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("TranscodeMedia", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("TranscodeMedia", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("TranscodeMedia", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mp4-h264-aac-vtt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("TranscodeMedia", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerNotSupported | TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
// DirectMedia
|
|
|
[InlineData("DirectMedia", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("DirectMedia", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
@@ -88,27 +93,120 @@ namespace Jellyfin.MediaBrowser.Model.Tests
|
|
|
[InlineData("DirectMedia", "mkv-vp9-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
[InlineData("DirectMedia", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
// LowBandwidth
|
|
|
- [InlineData("LowBandwidth", "mp4-h264-aac-vtt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("LowBandwidth", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("LowBandwidth", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode)] // #6450 should be DirectPlay
|
|
|
- [InlineData("LowBandwidth", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("LowBandwidth", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("LowBandwidth", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("LowBandwidth", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
- [InlineData("LowBandwidth", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.Transcode, true)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mp4-h264-aac-vtt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("LowBandwidth", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")] // #6450 should be DirectPlay
|
|
|
// Null
|
|
|
- [InlineData("Null", "mp4-h264-aac-vtt-2600k", null)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Null", "mp4-h264-ac3-aac-srt-2600k", null)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Null", "mp4-h264-ac3-srt-2600k", null)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Null", "mp4-hevc-aac-srt-15200k", null)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Null", "mp4-hevc-ac3-aac-srt-15200k", null)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Null", "mkv-vp9-aac-srt-2600k", null)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Null", "mkv-vp9-ac3-srt-2600k", null)] // #6450 should be DirectPlay
|
|
|
- [InlineData("Null", "mkv-vp9-vorbis-vtt-2600k", null)] // #6450 should be DirectPlay
|
|
|
- public async Task BuildVideoItemSimple(string deviceName, string mediaSource, PlayMethod? playMethod, bool fullTranscode = false)
|
|
|
+ [InlineData("Null", "mp4-h264-aac-vtt-2600k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Null", "mp4-h264-ac3-aac-srt-2600k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Null", "mp4-h264-ac3-srt-2600k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Null", "mp4-hevc-aac-srt-15200k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Null", "mp4-hevc-ac3-aac-srt-15200k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Null", "mkv-vp9-aac-srt-2600k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Null", "mkv-vp9-ac3-srt-2600k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Null", "mkv-vp9-vorbis-vtt-2600k", null, TranscodeReason.ContainerBitrateExceedsLimit | TranscodeReason.SubtitleCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ public async Task BuildVideoItemSimple(string deviceName, string mediaSource, PlayMethod? playMethod, TranscodeReason why = TranscodeReason.None, string transcodeMode = "DirectStream", string transcodeProtocol = "")
|
|
|
{
|
|
|
- var builder = GetStreamBuilder();
|
|
|
var options = await GetVideoOptions(deviceName, mediaSource);
|
|
|
+ BuildVideoItemSimpleTest(options, playMethod, why, transcodeMode, transcodeProtocol);
|
|
|
+ }
|
|
|
+
|
|
|
+ [Theory]
|
|
|
+ // Chrome
|
|
|
+ [InlineData("Chrome", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Chrome", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Chrome", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectStream
|
|
|
+ [InlineData("Chrome", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Chrome", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Chrome", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
+ [InlineData("Chrome", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
+ [InlineData("Chrome", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ // Firefox
|
|
|
+ [InlineData("Firefox", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Firefox", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Firefox", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectStream
|
|
|
+ [InlineData("Firefox", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Firefox", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported | TranscodeReason.AudioCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Firefox", "mkv-vp9-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
+ [InlineData("Firefox", "mkv-vp9-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be 'false'
|
|
|
+ [InlineData("Firefox", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ // Safari
|
|
|
+ [InlineData("SafariNext", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("SafariNext", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("SafariNext", "mp4-h264-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("SafariNext", "mp4-hevc-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should probably be DirectPlay
|
|
|
+ [InlineData("SafariNext", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should probably be DirectPlay
|
|
|
+ // AndroidPixel
|
|
|
+ [InlineData("AndroidPixel", "mp4-h264-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("AndroidPixel", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("AndroidPixel", "mp4-h264-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("AndroidPixel", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")]
|
|
|
+ [InlineData("AndroidPixel", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit, "Transcode")]
|
|
|
+ // Yatse
|
|
|
+ [InlineData("Yatse", "mp4-h264-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Yatse", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Yatse", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")]
|
|
|
+ [InlineData("Yatse", "mp4-hevc-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Yatse", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ // RokuSSPlus
|
|
|
+ [InlineData("RokuSSPlus", "mp4-h264-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-h264-ac3-srt-2600k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported)] // #6450 should be DirectStream
|
|
|
+ [InlineData("RokuSSPlus", "mp4-hevc-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-hevc-ac3-srt-15200k", PlayMethod.Transcode, TranscodeReason.AudioCodecNotSupported, "Transcode")] // #6450 should be DirectStream
|
|
|
+ // JellyfinMediaPlayer
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mp4-h264-aac-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mp4-h264-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mp4-hevc-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.ContainerBitrateExceedsLimit)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mkv-vp9-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mkv-vp9-ac3-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("JellyfinMediaPlayer", "mkv-vp9-vorbis-vtt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ public async Task BuildVideoItemWithFirstExplicitStream(string deviceName, string mediaSource, PlayMethod?playMethod, TranscodeReason why = TranscodeReason.None, string transcodeMode = "DirectStream", string transcodeProtocol = "")
|
|
|
+ {
|
|
|
+ var options = await GetVideoOptions(deviceName, mediaSource);
|
|
|
+ options.AudioStreamIndex = 1;
|
|
|
+ options.SubtitleStreamIndex = options.MediaSources[0].MediaStreams.Count() - 1;
|
|
|
+ BuildVideoItemSimpleTest(options, playMethod, why, transcodeMode, transcodeProtocol);
|
|
|
+ }
|
|
|
+
|
|
|
+ [Theory]
|
|
|
+ // Chrome
|
|
|
+ [InlineData("Chrome", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.SecondaryAudioNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Chrome", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported, "Transcode")] // #6450 should have container & profile video reasons?
|
|
|
+ // Firefox
|
|
|
+ [InlineData("Firefox", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.SecondaryAudioNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Firefox", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.VideoCodecNotSupported, "Transcode")] // #6450 should have container & profile video reasons?
|
|
|
+ // Yatse
|
|
|
+ [InlineData("Yatse", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.Transcode, TranscodeReason.SecondaryAudioNotSupported)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("Yatse", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.Transcode, TranscodeReason.SecondaryAudioNotSupported, "Transcode")] // #6450 should be DirectPlay
|
|
|
+ // RokuSSPlus
|
|
|
+ [InlineData("RokuSSPlus", "mp4-h264-ac3-aac-srt-2600k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ [InlineData("RokuSSPlus", "mp4-hevc-ac3-aac-srt-15200k", PlayMethod.DirectStream)] // #6450 should be DirectPlay
|
|
|
+ public async Task BuildVideoItemWithDirectPlayExplicitStreams(string deviceName, string mediaSource, PlayMethod playMethod, TranscodeReason why = TranscodeReason.None, string transcodeMode = "DirectStream", string transcodeProtocol = "")
|
|
|
+ {
|
|
|
+ var options = await GetVideoOptions(deviceName, mediaSource);
|
|
|
+ var streamCount = options.MediaSources[0].MediaStreams.Count();
|
|
|
+ options.AudioStreamIndex = streamCount - 2;
|
|
|
+ options.SubtitleStreamIndex = streamCount - 1;
|
|
|
+ BuildVideoItemSimpleTest(options, playMethod, why, transcodeMode, transcodeProtocol);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void BuildVideoItemSimpleTest(VideoOptions options, PlayMethod? playMethod, TranscodeReason why, string transcodeMode, string transcodeProtocol)
|
|
|
+ {
|
|
|
+ if (string.IsNullOrEmpty(transcodeProtocol))
|
|
|
+ {
|
|
|
+ transcodeProtocol = playMethod == PlayMethod.DirectStream ? "http" : "hls";
|
|
|
+ }
|
|
|
+
|
|
|
+ var builder = GetStreamBuilder();
|
|
|
|
|
|
var val = builder.BuildVideoItem(options);
|
|
|
Assert.NotNull(val);
|
|
@@ -118,63 +216,130 @@ namespace Jellyfin.MediaBrowser.Model.Tests
|
|
|
Assert.Equal(playMethod, val.PlayMethod);
|
|
|
}
|
|
|
|
|
|
- var videoStreams = options.MediaSources.SelectMany(source => source.MediaStreams).Where(stream => stream.Type == MediaStreamType.Video);
|
|
|
- var audioStreams = options.MediaSources.SelectMany(source => source.MediaStreams).Where(stream => stream.Type == MediaStreamType.Audio);
|
|
|
+ Assert.Equal(why, val.TranscodeReasons);
|
|
|
+
|
|
|
+ var audioStreamIndexInput = options.AudioStreamIndex;
|
|
|
+ var targetVideoStream = val.TargetVideoStream;
|
|
|
+ var targetAudioStream = val.TargetAudioStream;
|
|
|
|
|
|
- var url = new UriBuilder(val.ToUrl("https://server/", "ACCESSTOKEN"));
|
|
|
- var query = System.Web.HttpUtility.ParseQueryString(url.Query);
|
|
|
+ var mediaSource = options.MediaSources.First(source => source.Id == val.MediaSourceId);
|
|
|
+ Assert.NotNull(mediaSource);
|
|
|
+ var videoStreams = mediaSource.MediaStreams.Where(stream => stream.Type == MediaStreamType.Video);
|
|
|
+ var audioStreams = mediaSource.MediaStreams.Where(stream => stream.Type == MediaStreamType.Audio);
|
|
|
+ // TODO: check AudioStreamIndex vs options.AudioStreamIndex
|
|
|
+ var inputAudioStream = mediaSource.GetDefaultAudioStream(audioStreamIndexInput ?? mediaSource.DefaultAudioStreamIndex);
|
|
|
+
|
|
|
+ var uri = ParseUri(val);
|
|
|
|
|
|
if (playMethod == PlayMethod.DirectPlay)
|
|
|
{
|
|
|
- // Assert.Contains(query.Get("VidoeCodec"), videoStreams.Select(stream => stream.Codec));
|
|
|
- // Assert.Contains(query.Get("AudioCodec"), audioStreams.Select(stream => stream.Codec));
|
|
|
- Assert.Contains(
|
|
|
- videoStreams,
|
|
|
- stream => val.TargetVideoCodec.Contains(stream.Codec));
|
|
|
- Assert.Contains(
|
|
|
- audioStreams,
|
|
|
- stream => val.TargetAudioCodec.Contains(stream.Codec));
|
|
|
- }
|
|
|
+ // check expected container
|
|
|
+ var containers = ContainerProfile.SplitValue(mediaSource.Container);
|
|
|
+ Assert.Contains(uri.Extension, containers);
|
|
|
|
|
|
- if (playMethod == PlayMethod.DirectStream)
|
|
|
- {
|
|
|
- Assert.Matches("stream[.][^.]+$", url.Path);
|
|
|
- }
|
|
|
+ // check expected video codec (1)
|
|
|
+ Assert.Contains(targetVideoStream.Codec, val.TargetVideoCodec);
|
|
|
+ Assert.Single(val.TargetVideoCodec);
|
|
|
+
|
|
|
+ // check expected audio codecs (1)
|
|
|
+ Assert.Contains(targetAudioStream.Codec, val.TargetAudioCodec);
|
|
|
+ Assert.Single(val.AudioCodecs);
|
|
|
|
|
|
- if (playMethod == PlayMethod.Transcode)
|
|
|
+ // TODO: validate transcoding options as well
|
|
|
+ }
|
|
|
+ else if (playMethod == PlayMethod.DirectStream || playMethod == PlayMethod.Transcode)
|
|
|
{
|
|
|
- if (fullTranscode)
|
|
|
+ Assert.NotNull(val.Container);
|
|
|
+ // Assert.NotEmpty(val.VideoCodecs);
|
|
|
+ // Assert.NotEmpty(val.AudioCodecs);
|
|
|
+
|
|
|
+ // check expected container (todo: this could be a test param)
|
|
|
+ if (transcodeProtocol == "http")
|
|
|
{
|
|
|
+ // Assert.Equal("webm", val.Container);
|
|
|
+ Assert.Equal(val.Container, uri.Extension);
|
|
|
+ Assert.Equal("stream", uri.Filename);
|
|
|
+ // Assert.Equal("http", val.SubProtocol);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Assert.Equal("ts", val.Container);
|
|
|
+ Assert.Equal("m3u8", uri.Extension);
|
|
|
+ Assert.Equal("master", uri.Filename);
|
|
|
Assert.Equal("hls", val.SubProtocol);
|
|
|
- Assert.EndsWith("master.m3u8", url.Path, StringComparison.InvariantCulture);
|
|
|
+ }
|
|
|
+
|
|
|
+ // Full transcode
|
|
|
+ if (transcodeMode == "Transcode")
|
|
|
+ {
|
|
|
+ // TODO: what else to validate here
|
|
|
+ if ((val.TranscodeReasons & TranscodeReason.ContainerReasons) == TranscodeReason.None)
|
|
|
+ {
|
|
|
+ // Assert.All(
|
|
|
+ // videoStreams,
|
|
|
+ // stream => Assert.DoesNotContain(stream.Codec, val.VideoCodecs));
|
|
|
+ }
|
|
|
|
|
|
- // Assert.All(
|
|
|
- // videoStreams,
|
|
|
- // stream => Assert.DoesNotContain(stream.Codec, val.TargetVideoCodec));
|
|
|
+ // todo: fill out tests here
|
|
|
}
|
|
|
+
|
|
|
+ // DirectStream and Remux
|
|
|
else
|
|
|
{
|
|
|
- Assert.Equal("hls", val.SubProtocol);
|
|
|
- Assert.EndsWith("master.m3u8", url.Path, StringComparison.InvariantCulture);
|
|
|
+ // check expected video codec (1)
|
|
|
+ Assert.Contains(targetVideoStream.Codec, val.TargetVideoCodec);
|
|
|
+ Assert.Single(val.TargetVideoCodec);
|
|
|
|
|
|
- Assert.Contains(
|
|
|
- videoStreams,
|
|
|
- stream => val.TargetVideoCodec.Contains(stream.Codec));
|
|
|
- // Assert.All(
|
|
|
- // audioStreams,
|
|
|
- // stream => Assert.DoesNotContain(stream.Codec, val.TargetAudioCodec));
|
|
|
+ if (transcodeMode == "DirectStream")
|
|
|
+ {
|
|
|
+ if (!targetAudioStream.IsExternal)
|
|
|
+ {
|
|
|
+ // check expected audio codecs (1)
|
|
|
+ // Assert.DoesNotContain(targetAudioStream.Codec, val.AudioCodecs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (transcodeMode == "Remux")
|
|
|
+ {
|
|
|
+ // check expected audio codecs (1)
|
|
|
+ Assert.Contains(targetAudioStream.Codec, val.AudioCodecs);
|
|
|
+ Assert.Single(val.AudioCodecs);
|
|
|
+ }
|
|
|
|
|
|
+ // video details
|
|
|
+ var videoStream = targetVideoStream;
|
|
|
Assert.False(val.EstimateContentLength);
|
|
|
Assert.Equal(TranscodeSeekInfo.Auto, val.TranscodeSeekInfo);
|
|
|
- // Assert.True(val.CopyTimestamps);
|
|
|
-
|
|
|
- var videoStream = videoStreams.First(stream => val.TargetVideoCodec.Contains(stream.Codec));
|
|
|
-
|
|
|
- Assert.Contains(videoStream.Codec, val.TargetVideoCodec);
|
|
|
- // Assert.Contains(videoStream.Profile.ToLowerInvariant(), val.TargetVideoProfile.Split(","));
|
|
|
+ // Assert.Contains(videoStream.Profile?.ToLowerInvariant() ?? string.Empty, val.TargetVideoProfile?.Split(",").Select(s => s.ToLowerInvariant()) ?? new string[0]);
|
|
|
// Assert.Equal(videoStream.Level, val.TargetVideoLevel);
|
|
|
// Assert.Equal(videoStream.BitDepth, val.TargetVideoBitDepth);
|
|
|
- // Assert.Equal(videoStream.BitRate, val.VideoBitrate);
|
|
|
+ // Assert.InRange(val.VideoBitrate.GetValueOrDefault(), videoStream.BitRate.GetValueOrDefault(), int.MaxValue);
|
|
|
+
|
|
|
+ // audio codec not supported
|
|
|
+ if ((why & TranscodeReason.AudioCodecNotSupported) != TranscodeReason.None)
|
|
|
+ {
|
|
|
+ // audio stream specified
|
|
|
+ if (options.AudioStreamIndex >= 0)
|
|
|
+ {
|
|
|
+ // TODO:fixme
|
|
|
+ if (!targetAudioStream.IsExternal)
|
|
|
+ {
|
|
|
+ Assert.DoesNotContain(targetAudioStream.Codec, val.AudioCodecs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // audio stream not specified
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // TODO:fixme
|
|
|
+ Assert.All(audioStreams, stream =>
|
|
|
+ {
|
|
|
+ if (!stream.IsExternal)
|
|
|
+ {
|
|
|
+ // Assert.DoesNotContain(stream.Codec, val.AudioCodecs);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -182,7 +347,7 @@ namespace Jellyfin.MediaBrowser.Model.Tests
|
|
|
{
|
|
|
// what should the actual result be here?
|
|
|
Assert.Null(val.SubProtocol);
|
|
|
- Assert.EndsWith("/stream", url.Path, StringComparison.InvariantCulture);
|
|
|
+ Assert.EndsWith("/stream", uri.Path, StringComparison.InvariantCulture);
|
|
|
|
|
|
Assert.False(val.EstimateContentLength);
|
|
|
Assert.Equal(TranscodeSeekInfo.Auto, val.TranscodeSeekInfo);
|
|
@@ -231,5 +396,23 @@ namespace Jellyfin.MediaBrowser.Model.Tests
|
|
|
Profile = dp,
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
+ private static (string Path, NameValueCollection Query, string Filename, string Extension) ParseUri(StreamInfo val)
|
|
|
+ {
|
|
|
+ var href = val.ToUrl("media:", "ACCESSTOKEN").Split("?", 2);
|
|
|
+ var path = href[0];
|
|
|
+
|
|
|
+ var queryString = href.ElementAtOrDefault(1);
|
|
|
+ var query = string.IsNullOrEmpty(queryString) ? System.Web.HttpUtility.ParseQueryString(queryString ?? string.Empty) : new NameValueCollection();
|
|
|
+
|
|
|
+ var filename = System.IO.Path.GetFileNameWithoutExtension(path);
|
|
|
+ var extension = System.IO.Path.GetExtension(path);
|
|
|
+ if (extension.Length > 0)
|
|
|
+ {
|
|
|
+ extension = extension.Substring(1);
|
|
|
+ }
|
|
|
+
|
|
|
+ return (path, query, filename, extension);
|
|
|
+ }
|
|
|
}
|
|
|
}
|