From 68b3ca63837e572756e6670547ea2e27d995cbe3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 11 Nov 2016 00:43:57 -0500 Subject: update core project --- Emby.Server.Core/Browser/BrowserLauncher.cs | 75 ++++++++++++++++++++++ Emby.Server.Core/EntryPoints/StartupWizard.cs | 59 +++++++++++++++++ .../Browser/BrowserLauncher.cs | 75 ---------------------- .../EntryPoints/StartupWizard.cs | 59 ----------------- .../MediaBrowser.Server.Startup.Common.csproj | 2 - 5 files changed, 134 insertions(+), 136 deletions(-) create mode 100644 Emby.Server.Core/Browser/BrowserLauncher.cs create mode 100644 Emby.Server.Core/EntryPoints/StartupWizard.cs delete mode 100644 MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs delete mode 100644 MediaBrowser.Server.Startup.Common/EntryPoints/StartupWizard.cs diff --git a/Emby.Server.Core/Browser/BrowserLauncher.cs b/Emby.Server.Core/Browser/BrowserLauncher.cs new file mode 100644 index 000000000..4ccc41c30 --- /dev/null +++ b/Emby.Server.Core/Browser/BrowserLauncher.cs @@ -0,0 +1,75 @@ +using MediaBrowser.Controller; +using System; + +namespace Emby.Server.Core.Browser +{ + /// + /// Class BrowserLauncher + /// + public static class BrowserLauncher + { + /// + /// Opens the dashboard page. + /// + /// The page. + /// The app host. + public static void OpenDashboardPage(string page, IServerApplicationHost appHost) + { + var url = appHost.GetLocalApiUrl("localhost") + "/web/" + page; + + OpenUrl(appHost, url); + } + + /// + /// Opens the community. + /// + public static void OpenCommunity(IServerApplicationHost appHost) + { + OpenUrl(appHost, "http://emby.media/community"); + } + + public static void OpenEmbyPremiere(IServerApplicationHost appHost) + { + OpenDashboardPage("supporterkey.html", appHost); + } + + /// + /// Opens the web client. + /// + /// The app host. + public static void OpenWebClient(IServerApplicationHost appHost) + { + OpenDashboardPage("index.html", appHost); + } + + /// + /// Opens the dashboard. + /// + /// The app host. + public static void OpenDashboard(IServerApplicationHost appHost) + { + OpenDashboardPage("dashboard.html", appHost); + } + + /// + /// Opens the URL. + /// + /// The URL. + private static void OpenUrl(IServerApplicationHost appHost, string url) + { + try + { + appHost.LaunchUrl(url); + } + catch (NotImplementedException) + { + + } + catch (Exception ex) + { + Console.WriteLine("Error launching url: " + url); + Console.WriteLine(ex.Message); + } + } + } +} diff --git a/Emby.Server.Core/EntryPoints/StartupWizard.cs b/Emby.Server.Core/EntryPoints/StartupWizard.cs new file mode 100644 index 000000000..30ceca073 --- /dev/null +++ b/Emby.Server.Core/EntryPoints/StartupWizard.cs @@ -0,0 +1,59 @@ +using MediaBrowser.Controller; +using MediaBrowser.Controller.Plugins; +using MediaBrowser.Model.Logging; +using Emby.Server.Core.Browser; + +namespace Emby.Server.Core.EntryPoints +{ + /// + /// Class StartupWizard + /// + public class StartupWizard : IServerEntryPoint + { + /// + /// The _app host + /// + private readonly IServerApplicationHost _appHost; + /// + /// The _user manager + /// + private readonly ILogger _logger; + + /// + /// Initializes a new instance of the class. + /// + /// The app host. + /// The logger. + public StartupWizard(IServerApplicationHost appHost, ILogger logger) + { + _appHost = appHost; + _logger = logger; + } + + /// + /// Runs this instance. + /// + public void Run() + { + if (_appHost.IsFirstRun) + { + LaunchStartupWizard(); + } + } + + /// + /// Launches the startup wizard. + /// + private void LaunchStartupWizard() + { + BrowserLauncher.OpenDashboardPage("wizardstart.html", _appHost); + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public void Dispose() + { + } + } +} \ No newline at end of file diff --git a/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs b/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs deleted file mode 100644 index 1a0e2d973..000000000 --- a/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs +++ /dev/null @@ -1,75 +0,0 @@ -using MediaBrowser.Controller; -using System; - -namespace MediaBrowser.Server.Startup.Common.Browser -{ - /// - /// Class BrowserLauncher - /// - public static class BrowserLauncher - { - /// - /// Opens the dashboard page. - /// - /// The page. - /// The app host. - public static void OpenDashboardPage(string page, IServerApplicationHost appHost) - { - var url = appHost.GetLocalApiUrl("localhost") + "/web/" + page; - - OpenUrl(appHost, url); - } - - /// - /// Opens the community. - /// - public static void OpenCommunity(IServerApplicationHost appHost) - { - OpenUrl(appHost, "http://emby.media/community"); - } - - public static void OpenEmbyPremiere(IServerApplicationHost appHost) - { - OpenDashboardPage("supporterkey.html", appHost); - } - - /// - /// Opens the web client. - /// - /// The app host. - public static void OpenWebClient(IServerApplicationHost appHost) - { - OpenDashboardPage("index.html", appHost); - } - - /// - /// Opens the dashboard. - /// - /// The app host. - public static void OpenDashboard(IServerApplicationHost appHost) - { - OpenDashboardPage("dashboard.html", appHost); - } - - /// - /// Opens the URL. - /// - /// The URL. - private static void OpenUrl(IServerApplicationHost appHost, string url) - { - try - { - appHost.LaunchUrl(url); - } - catch (NotImplementedException) - { - - } - catch (Exception ex) - { - Console.WriteLine("Error launching url: " + url); - Console.WriteLine(ex.Message); - } - } - } -} diff --git a/MediaBrowser.Server.Startup.Common/EntryPoints/StartupWizard.cs b/MediaBrowser.Server.Startup.Common/EntryPoints/StartupWizard.cs deleted file mode 100644 index f9d173c59..000000000 --- a/MediaBrowser.Server.Startup.Common/EntryPoints/StartupWizard.cs +++ /dev/null @@ -1,59 +0,0 @@ -using MediaBrowser.Controller; -using MediaBrowser.Controller.Plugins; -using MediaBrowser.Model.Logging; -using MediaBrowser.Server.Startup.Common.Browser; - -namespace MediaBrowser.Server.Startup.Common.EntryPoints -{ - /// - /// Class StartupWizard - /// - public class StartupWizard : IServerEntryPoint - { - /// - /// The _app host - /// - private readonly IServerApplicationHost _appHost; - /// - /// The _user manager - /// - private readonly ILogger _logger; - - /// - /// Initializes a new instance of the class. - /// - /// The app host. - /// The logger. - public StartupWizard(IServerApplicationHost appHost, ILogger logger) - { - _appHost = appHost; - _logger = logger; - } - - /// - /// Runs this instance. - /// - public void Run() - { - if (_appHost.IsFirstRun) - { - LaunchStartupWizard(); - } - } - - /// - /// Launches the startup wizard. - /// - private void LaunchStartupWizard() - { - BrowserLauncher.OpenDashboardPage("wizardstart.html", _appHost); - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public void Dispose() - { - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index f5f561065..7d6df52c2 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -96,11 +96,9 @@ - - -- cgit v1.2.3