Ver Fonte

remove dead code

Luke Pulverenti há 8 anos atrás
pai
commit
8a252c8ad6

+ 0 - 12
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -2619,18 +2619,6 @@ namespace Emby.Server.Implementations.Library
                 }
             }
 
-            foreach (var map in ConfigurationManager.Configuration.PathSubstitutions)
-            {
-                if (!string.IsNullOrWhiteSpace(map.From))
-                {
-                    var substitutionResult = SubstitutePathInternal(path, map.From, map.To);
-                    if (substitutionResult.Item2)
-                    {
-                        return substitutionResult.Item1;
-                    }
-                }
-            }
-
             return path;
         }
 

+ 20 - 18
MediaBrowser.Api/Playback/BaseStreamingService.cs

@@ -2704,21 +2704,25 @@ namespace MediaBrowser.Api.Playback
                     //inputModifier += " -noaccurate_seek";
                 }
 
-                foreach (var stream in state.MediaSource.MediaStreams)
+                if (state.RunTimeTicks.HasValue)
                 {
-                    if (!stream.IsExternal && stream.Type != MediaStreamType.Subtitle)
+                    foreach (var stream in state.MediaSource.MediaStreams)
                     {
-                        if (!string.IsNullOrWhiteSpace(stream.Codec) && stream.Index != -1)
+                        if (!stream.IsExternal && stream.Type != MediaStreamType.Subtitle)
                         {
-                            var decoder = GetDecoderFromCodec(stream.Codec);
-
-                            if (!string.IsNullOrWhiteSpace(decoder))
+                            if (!string.IsNullOrWhiteSpace(stream.Codec) && stream.Index != -1)
                             {
-                                inputModifier += " -codec:" + stream.Index.ToString(UsCulture) + " " + decoder;
+                                var decoder = GetDecoderFromCodec(stream.Codec);
+
+                                if (!string.IsNullOrWhiteSpace(decoder))
+                                {
+                                    inputModifier += " -codec:" + stream.Index.ToString(UsCulture) + " " + decoder;
+                                }
                             }
                         }
                     }
                 }
+
                 //var videoStream = state.VideoStream;
                 //if (videoStream != null && !string.IsNullOrWhiteSpace(videoStream.Codec))
                 //{
@@ -2737,18 +2741,16 @@ namespace MediaBrowser.Api.Playback
 
         private string GetDecoderFromCodec(string codec)
         {
-            return null;
-
-            //if (string.Equals(codec, "mp2", StringComparison.OrdinalIgnoreCase))
-            //{
-            //    return null;
-            //}
-            //if (string.Equals(codec, "aac_latm", StringComparison.OrdinalIgnoreCase))
-            //{
-            //    return null;
-            //}
+            if (string.Equals(codec, "mp2", StringComparison.OrdinalIgnoreCase))
+            {
+                return null;
+            }
+            if (string.Equals(codec, "aac_latm", StringComparison.OrdinalIgnoreCase))
+            {
+                return null;
+            }
 
-            //return codec;
+            return codec;
         }
 
         /// <summary>

+ 0 - 8
MediaBrowser.Model/Configuration/PathSubstitution.cs

@@ -1,8 +0,0 @@
-namespace MediaBrowser.Model.Configuration
-{
-    public class PathSubstitution
-    {
-        public string From { get; set; }
-        public string To { get; set; }
-    }
-}

+ 0 - 3
MediaBrowser.Model/Configuration/ServerConfiguration.cs

@@ -163,8 +163,6 @@ namespace MediaBrowser.Model.Configuration
         public bool SkipDeserializationForPrograms { get; set; }
         public bool SkipDeserializationForAudio { get; set; }
 
-        public PathSubstitution[] PathSubstitutions { get; set; }
-
         public string ServerName { get; set; }
         public string WanDdns { get; set; }
 
@@ -229,7 +227,6 @@ namespace MediaBrowser.Model.Configuration
 
             LibraryMonitorDelay = 60;
 
-            PathSubstitutions = new PathSubstitution[] { };
             ContentTypes = new NameValuePair[] { };
 
             PreferredMetadataLanguage = "en";

+ 0 - 1
MediaBrowser.Model/MediaBrowser.Model.csproj

@@ -198,7 +198,6 @@
     <Compile Include="Notifications\NotificationOption.cs" />
     <Compile Include="Notifications\NotificationOptions.cs" />
     <Compile Include="Notifications\NotificationType.cs" />
-    <Compile Include="Configuration\PathSubstitution.cs" />
     <Compile Include="Notifications\SendToUserType.cs" />
     <Compile Include="Configuration\ServerConfiguration.cs" />
     <Compile Include="Playlists\PlaylistCreationRequest.cs" />