aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs')
-rw-r--r--MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs93
1 files changed, 10 insertions, 83 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs
index 6a37626b7..37dd06da9 100644
--- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs
+++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs
@@ -1,5 +1,6 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
+using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -17,56 +18,22 @@ namespace MediaBrowser.Controller.MediaEncoding
/// Gets the input argument.
/// </summary>
/// <param name="videoPath">The video path.</param>
- /// <param name="isRemote">if set to <c>true</c> [is remote].</param>
- /// <param name="videoType">Type of the video.</param>
- /// <param name="isoType">Type of the iso.</param>
+ /// <param name="protocol">The protocol.</param>
/// <param name="isoMount">The iso mount.</param>
/// <param name="playableStreamFileNames">The playable stream file names.</param>
- /// <param name="type">The type.</param>
/// <returns>System.String[][].</returns>
- public static string[] GetInputArgument(string videoPath, bool isRemote, VideoType videoType, IsoType? isoType, IIsoMount isoMount, IEnumerable<string> playableStreamFileNames, out InputType type)
+ public static string[] GetInputArgument(string videoPath, MediaProtocol protocol, IIsoMount isoMount, List<string> playableStreamFileNames)
{
- var inputPath = isoMount == null ? new[] { videoPath } : new[] { isoMount.MountedPath };
-
- type = InputType.File;
-
- switch (videoType)
+ if (playableStreamFileNames.Count > 0)
{
- case VideoType.BluRay:
- type = InputType.Bluray;
- inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
- break;
- case VideoType.Dvd:
- type = InputType.Dvd;
- inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
- break;
- case VideoType.Iso:
- if (isoType.HasValue)
- {
- switch (isoType.Value)
- {
- case IsoType.BluRay:
- type = InputType.Bluray;
- inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
- break;
- case IsoType.Dvd:
- type = InputType.Dvd;
- inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray();
- break;
- }
- }
- break;
- case VideoType.VideoFile:
- {
- if (isRemote)
- {
- type = InputType.Url;
- }
- break;
- }
+ if (isoMount == null)
+ {
+ return GetPlayableStreamFiles(videoPath, playableStreamFileNames).ToArray();
+ }
+ return GetPlayableStreamFiles(isoMount.MountedPath, playableStreamFileNames).ToArray();
}
- return inputPath;
+ return new[] {videoPath};
}
public static List<string> GetPlayableStreamFiles(string rootPath, IEnumerable<string> filenames)
@@ -80,46 +47,6 @@ namespace MediaBrowser.Controller.MediaEncoding
.ToList();
}
- /// <summary>
- /// Gets the type of the input.
- /// </summary>
- /// <param name="videoType">Type of the video.</param>
- /// <param name="isoType">Type of the iso.</param>
- /// <returns>InputType.</returns>
- public static InputType GetInputType(VideoType? videoType, IsoType? isoType)
- {
- var type = InputType.File;
-
- if (videoType.HasValue)
- {
- switch (videoType.Value)
- {
- case VideoType.BluRay:
- type = InputType.Bluray;
- break;
- case VideoType.Dvd:
- type = InputType.Dvd;
- break;
- case VideoType.Iso:
- if (isoType.HasValue)
- {
- switch (isoType.Value)
- {
- case IsoType.BluRay:
- type = InputType.Bluray;
- break;
- case IsoType.Dvd:
- type = InputType.Dvd;
- break;
- }
- }
- break;
- }
- }
-
- return type;
- }
-
public static MediaInfo GetMediaInfo(InternalMediaInfoResult data)
{
var internalStreams = data.streams ?? new MediaStreamInfo[] { };