The Free Software Media System - Server Backend & API
install service with Emby name
Luke Pulverentid0c9273d679c
diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.csindex 2833e71677..a0a7fc90d5 100644--- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs+++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs@@ -277,7 +277,7 @@ namespace MediaBrowser.Model.Configuration{new ImageOption{- Limit = 3,+ Limit = 2,MinWidth = 1280,Type = ImageType.Backdrop},@@ -304,7 +304,7 @@ namespace MediaBrowser.Model.Configurationnew ImageOption{- Limit = 1,+ Limit = 0,Type = ImageType.Banner},@@ -374,7 +374,7 @@ namespace MediaBrowser.Model.Configuration{new ImageOption{- Limit = 1,+ Limit = 0,MinWidth = 1280,Type = ImageType.Backdrop},@@ -414,6 +414,14 @@ namespace MediaBrowser.Model.Configuration{Limit = 0,Type = ImageType.Art+ },++ // Don't download this by default+ // Generally not used+ new ImageOption+ {+ Limit = 0,+ Type = ImageType.Logo}}},diff --git a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs b/MediaBrowser.Providers/Music/FanArtAlbumProvider.csindex 734ee74b6e..0676d93d16 100644--- a/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs+++ b/MediaBrowser.Providers/Music/FanArtAlbumProvider.cs@@ -7,6 +7,7 @@ using MediaBrowser.Controller.Providers;using MediaBrowser.Model.Dto;using MediaBrowser.Model.Entities;using MediaBrowser.Model.Providers;+using MediaBrowser.Providers.TV;using System;using System.Collections.Generic;using System.Globalization;@@ -16,7 +17,6 @@ using System.Text;using System.Threading;using System.Threading.Tasks;using System.Xml;-using MediaBrowser.Providers.TV;namespace MediaBrowser.Providers.Music{diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.csindex 4d2ed067be..8a7d10bd74 100644--- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs+++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFMpegDownloadInfo.cs@@ -84,13 +84,13 @@ namespace MediaBrowser.Server.Startup.Common.FFMpegreturn new[]{"http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20150331-git-5cba529-win64-static.7z",- "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20150331-git-5cba529-win64-static.7z"+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20150331-git-5cba529-win64-static.7z"};case Architecture.X86:return new[]{"http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20150331-git-5cba529-win32-static.7z",- "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20150331-git-5cba529-win32-static.7z"+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20150331-git-5cba529-win32-static.7z"};}break;@@ -102,12 +102,12 @@ namespace MediaBrowser.Server.Startup.Common.FFMpegcase Architecture.X86_X64:return new[]{- "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/osx/ffmpeg-x64-2.5.3.7z"+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/osx/ffmpeg-x64-2.5.3.7z"};case Architecture.X86:return new[]{- "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/osx/ffmpeg-x86-2.5.3.7z"+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/osx/ffmpeg-x86-2.5.3.7z"};}break;@@ -119,12 +119,12 @@ namespace MediaBrowser.Server.Startup.Common.FFMpegcase Architecture.X86_X64:return new[]{- "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg-2.6.1-64bit-static.7z"+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-2.6.1-64bit-static.7z"};case Architecture.X86:return new[]{- "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg-2.6.1-32bit-static.7z"+ "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/linux/ffmpeg-2.6.1-32bit-static.7z"};}break;diff --git a/MediaBrowser.ServerApplication/App.config b/MediaBrowser.ServerApplication/App.configindex 94dd9ee733..14ce35a965 100644--- a/MediaBrowser.ServerApplication/App.config+++ b/MediaBrowser.ServerApplication/App.config@@ -13,7 +13,7 @@</nlog><appSettings><add key="DebugProgramDataPath" value="..\..\..\ProgramData-Server" />- <add key="ReleaseProgramDataPath" value="%ApplicationData%\MediaBrowser-Server" />+ <add key="ReleaseProgramDataPath" value=".." /><add key="ClientSettingsProvider.ServiceUri" value="" /></appSettings><startup useLegacyV2RuntimeActivationPolicy="true">diff --git a/MediaBrowser.ServerApplication/BackgroundService.cs b/MediaBrowser.ServerApplication/BackgroundService.csindex 019a11e1c0..da7537cd70 100644--- a/MediaBrowser.ServerApplication/BackgroundService.cs+++ b/MediaBrowser.ServerApplication/BackgroundService.cs@@ -1,4 +1,5 @@using MediaBrowser.Model.Logging;+using System.Linq;using System.ServiceProcess;namespace MediaBrowser.ServerApplication@@ -8,8 +9,25 @@ namespace MediaBrowser.ServerApplication/// </summary>public class BackgroundService : ServiceBase{- public static string Name = "MediaBrowser";- public static string DisplayName = "Media Browser";+ public static string Name = "Emby";+ public static string DisplayName = "Emby Server";++ public static string GetExistingServiceName()+ {+ try+ {+ if (ServiceController.GetServices().Any(s => s.ServiceName == "MediaBrowser"))+ {+ return "MediaBrowser";+ }+ }+ catch+ {+ return "MediaBrowser";+ }++ return Name;+ }private readonly ILogger _logger;@@ -24,7 +42,7 @@ namespace MediaBrowser.ServerApplicationCanStop = true;- ServiceName = Name;+ ServiceName = GetExistingServiceName();}/// <summary>diff --git a/MediaBrowser.ServerApplication/BackgroundServiceInstaller.cs b/MediaBrowser.ServerApplication/BackgroundServiceInstaller.csindex 15cab6c197..08c8a25b9d 100644--- a/MediaBrowser.ServerApplication/BackgroundServiceInstaller.cs+++ b/MediaBrowser.ServerApplication/BackgroundServiceInstaller.cs@@ -22,7 +22,7 @@ namespace MediaBrowser.ServerApplicationDelayedAutoStart = true,- Description = "The windows background service for Media Browser Server.",+ Description = "The windows background service for Emby Server.",// Will ensure the network is availableServicesDependedOn = new[] { "LanmanServer", "Tcpip" }diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.csindex 6e8774eea1..f918fc37cc 100644--- a/MediaBrowser.ServerApplication/MainStartup.cs+++ b/MediaBrowser.ServerApplication/MainStartup.cs@@ -370,7 +370,8 @@ namespace MediaBrowser.ServerApplicationprivate static void RunServiceInstallationIfNeeded(string applicationPath){- var ctl = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == BackgroundService.Name);+ var serviceName = BackgroundService.GetExistingServiceName();+ var ctl = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == serviceName);if (ctl == null){@@ -476,7 +477,7 @@ namespace MediaBrowser.ServerApplication// Update is there - execute updatetry{- var serviceName = _isRunningAsService ? BackgroundService.Name : string.Empty;+ var serviceName = _isRunningAsService ? BackgroundService.GetExistingServiceName() : string.Empty;new ApplicationUpdater().UpdateApplication(appPaths, updateArchive, logger, serviceName);// And just let the app exit so it can update@@ -539,7 +540,7 @@ namespace MediaBrowser.ServerApplicationprivate static void ShutdownWindowsService(){_logger.Info("Stopping background service");- var service = new ServiceController(BackgroundService.Name);+ var service = new ServiceController(BackgroundService.GetExistingServiceName());service.Refresh();diff --git a/MediaBrowser.ServerApplication/Native/Autorun.cs b/MediaBrowser.ServerApplication/Native/Autorun.csindex 593bb7955c..dd2a775655 100644--- a/MediaBrowser.ServerApplication/Native/Autorun.cs+++ b/MediaBrowser.ServerApplication/Native/Autorun.cs@@ -18,17 +18,32 @@ namespace MediaBrowser.ServerApplication.Native{var shortcutPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Media Browser 3", "Media Browser Server.lnk");+ if (!Directory.Exists(Path.GetDirectoryName(shortcutPath)))+ {+ shortcutPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Emby", "Emby Server.lnk");+ }+var startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);+ // Remove lnk from old name+ try+ {+ fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Media Browser Server.lnk"));+ }+ catch+ {++ }+if (autorun){//Copy our shortut into the startup folder for this user- File.Copy(shortcutPath, Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "MBstartup.lnk"), true);+ File.Copy(shortcutPath, Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Emby Server.lnk"), true);}else{//Remove our shortcut from the startup folder for this user- fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "MBstartup.lnk"));+ fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Emby Server.lnk"));}}}