From 8a252c8ad6c9ab2ccc4017571ddd2cff1a05928c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 26 Jan 2017 23:15:05 -0500 Subject: [PATCH] remove dead code --- .../Library/LibraryManager.cs | 12 ------ .../Playback/BaseStreamingService.cs | 38 ++++++++++--------- .../Configuration/PathSubstitution.cs | 8 ---- .../Configuration/ServerConfiguration.cs | 3 -- MediaBrowser.Model/MediaBrowser.Model.csproj | 1 - 5 files changed, 20 insertions(+), 42 deletions(-) delete mode 100644 MediaBrowser.Model/Configuration/PathSubstitution.cs diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 57c9551d55..de029cd220 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/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; } diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 120c00a143..0e05c79ca8 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/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; } /// diff --git a/MediaBrowser.Model/Configuration/PathSubstitution.cs b/MediaBrowser.Model/Configuration/PathSubstitution.cs deleted file mode 100644 index 576dd2d5ae..0000000000 --- a/MediaBrowser.Model/Configuration/PathSubstitution.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace MediaBrowser.Model.Configuration -{ - public class PathSubstitution - { - public string From { get; set; } - public string To { get; set; } - } -} \ No newline at end of file diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 50837292d2..3144e84699 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/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"; diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 4457c6dc2b..c50ee984ee 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -198,7 +198,6 @@ -