diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 32c258961..5fb88c4fe 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -131,6 +131,7 @@ namespace MediaBrowser.WebDashboard.Api /// The user manager. /// The app host. /// The library manager. + /// The server configuration manager. public DashboardService(ITaskManager taskManager, IUserManager userManager, IServerApplicationHost appHost, ILibraryManager libraryManager, IServerConfigurationManager serverConfigurationManager) { _taskManager = taskManager; @@ -320,47 +321,6 @@ namespace MediaBrowser.WebDashboard.Api private Stream GetRawResourceStream(string path) { return new FileStream(GetDashboardResourcePath(path), FileMode.Open, FileAccess.Read, FileShare.ReadWrite, StreamDefaults.DefaultFileStreamBufferSize, true); - - // This code is used when the files are embedded resources - //return GetType().Assembly.GetManifestResourceStream("MediaBrowser.WebDashboard.Html." + ConvertUrlToResourcePath(path)); - } - - /// - /// Converts the URL to a manifest resource path. - /// - /// The URL. - /// System.String. - private string ConvertUrlToResourcePath(string url) - { - var parts = url.Split('/'); - var normalizedParts = new string[parts.Length]; - - for (var i = 0; i < parts.Length; i++) - { - // We have to do some tricky string replacements for all parts of the path except the last - if (i < parts.Length - 1) - { - // Find the index of the first period as well as the first dash - var periodIndex = parts[i].IndexOf('.'); - var slashIndex = parts[i].IndexOf('-'); - - // Replace all periods with "._" and dashes with "_" - normalizedParts[i] = parts[i].Replace(".", "._").Replace("-", "_"); - - // If the first period occurred before the first slash, change it back from "._" to just "." - if (periodIndex < slashIndex) - { - var regex = new Regex("\\._"); - normalizedParts[i] = regex.Replace(normalizedParts[i], ".", 1); - } - } - else - { - normalizedParts[i] = parts[i]; - } - } - - return string.Join(".", normalizedParts); } ///