diff options
Diffstat (limited to 'MediaBrowser.ServerApplication')
13 files changed, 305 insertions, 312 deletions
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index e93785bac2..1b5bd84409 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -9,10 +9,12 @@ using MediaBrowser.Common.IO; using MediaBrowser.Common.Net; using MediaBrowser.Common.Progress; using MediaBrowser.Controller; +using MediaBrowser.Controller.Activity; using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Chapters; using MediaBrowser.Controller.Collections; using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Connect; using MediaBrowser.Controller.Dlna; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Dto; @@ -26,6 +28,7 @@ using MediaBrowser.Controller.Net; using MediaBrowser.Controller.News; using MediaBrowser.Controller.Notifications; using MediaBrowser.Controller.Persistence; +using MediaBrowser.Controller.Playlists; using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Resolvers; @@ -33,14 +36,17 @@ using MediaBrowser.Controller.Security; using MediaBrowser.Controller.Session; using MediaBrowser.Controller.Sorting; using MediaBrowser.Controller.Subtitles; +using MediaBrowser.Controller.Sync; using MediaBrowser.Controller.Themes; using MediaBrowser.Dlna; using MediaBrowser.Dlna.ConnectionManager; using MediaBrowser.Dlna.ContentDirectory; using MediaBrowser.Dlna.Main; +using MediaBrowser.LocalMetadata.Providers; using MediaBrowser.MediaEncoding.BdInfo; using MediaBrowser.MediaEncoding.Encoder; using MediaBrowser.MediaEncoding.Subtitles; +using MediaBrowser.Model.FileOrganization; using MediaBrowser.Model.Logging; using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.System; @@ -49,14 +55,17 @@ using MediaBrowser.Providers.Chapters; using MediaBrowser.Providers.Manager; using MediaBrowser.Providers.Subtitles; using MediaBrowser.Server.Implementations; +using MediaBrowser.Server.Implementations.Activity; using MediaBrowser.Server.Implementations.Channels; using MediaBrowser.Server.Implementations.Collections; using MediaBrowser.Server.Implementations.Configuration; +using MediaBrowser.Server.Implementations.Connect; using MediaBrowser.Server.Implementations.Drawing; using MediaBrowser.Server.Implementations.Dto; using MediaBrowser.Server.Implementations.EntryPoints; using MediaBrowser.Server.Implementations.FileOrganization; using MediaBrowser.Server.Implementations.HttpServer; +using MediaBrowser.Server.Implementations.HttpServer.Security; using MediaBrowser.Server.Implementations.IO; using MediaBrowser.Server.Implementations.Library; using MediaBrowser.Server.Implementations.LiveTv; @@ -64,17 +73,18 @@ using MediaBrowser.Server.Implementations.Localization; using MediaBrowser.Server.Implementations.MediaEncoder; using MediaBrowser.Server.Implementations.Notifications; using MediaBrowser.Server.Implementations.Persistence; +using MediaBrowser.Server.Implementations.Playlists; using MediaBrowser.Server.Implementations.Security; using MediaBrowser.Server.Implementations.ServerManager; using MediaBrowser.Server.Implementations.Session; +using MediaBrowser.Server.Implementations.Sync; using MediaBrowser.Server.Implementations.Themes; -using MediaBrowser.Server.Implementations.WebSocket; -using MediaBrowser.ServerApplication.EntryPoints; using MediaBrowser.ServerApplication.FFMpeg; using MediaBrowser.ServerApplication.IO; using MediaBrowser.ServerApplication.Native; using MediaBrowser.ServerApplication.Networking; using MediaBrowser.WebDashboard.Api; +using MediaBrowser.XbmcMetadata.Providers; using System; using System.Collections.Generic; using System.Globalization; @@ -176,6 +186,7 @@ namespace MediaBrowser.ServerApplication /// <value>The media encoder.</value> private IMediaEncoder MediaEncoder { get; set; } + private IConnectManager ConnectManager { get; set; } private ISessionManager SessionManager { get; set; } private ILiveTvManager LiveTvManager { get; set; } @@ -184,6 +195,7 @@ namespace MediaBrowser.ServerApplication private IEncodingManager EncodingManager { get; set; } private IChannelManager ChannelManager { get; set; } + private ISyncManager SyncManager { get; set; } /// <summary> /// Gets or sets the user data repository. @@ -203,11 +215,15 @@ namespace MediaBrowser.ServerApplication private IUserViewManager UserViewManager { get; set; } + private IAuthenticationRepository AuthenticationRepository { get; set; } + private ISyncRepository SyncRepository { get; set; } + /// <summary> - /// Initializes a new instance of the <see cref="ApplicationHost"/> class. + /// Initializes a new instance of the <see cref="ApplicationHost" /> class. /// </summary> /// <param name="applicationPaths">The application paths.</param> /// <param name="logManager">The log manager.</param> + /// <param name="isRunningAsService">if set to <c>true</c> [is running as service].</param> public ApplicationHost(ServerApplicationPaths applicationPaths, ILogManager logManager, bool isRunningAsService) : base(applicationPaths, logManager) { @@ -271,11 +287,49 @@ namespace MediaBrowser.ServerApplication LogManager.RemoveConsoleOutput(); } - public override Task Init(IProgress<double> progress) + public override async Task Init(IProgress<double> progress) + { + PerformVersionMigration(); + + await base.Init(progress).ConfigureAwait(false); + + MigrateModularConfigurations(); + } + + private void PerformVersionMigration() { DeleteDeprecatedModules(); + } + + private void MigrateModularConfigurations() + { + var saveConfig = false; - return base.Init(progress); + if (ServerConfigurationManager.Configuration.DlnaOptions != null) + { + ServerConfigurationManager.SaveConfiguration("dlna", ServerConfigurationManager.Configuration.DlnaOptions); + ServerConfigurationManager.Configuration.DlnaOptions = null; + saveConfig = true; + } + + if (ServerConfigurationManager.Configuration.LiveTvOptions != null) + { + ServerConfigurationManager.SaveConfiguration("livetv", ServerConfigurationManager.Configuration.LiveTvOptions); + ServerConfigurationManager.Configuration.LiveTvOptions = null; + saveConfig = true; + } + + if (ServerConfigurationManager.Configuration.TvFileOrganizationOptions != null) + { + ServerConfigurationManager.SaveConfiguration("autoorganize", new AutoOrganizeOptions { TvOptions = ServerConfigurationManager.Configuration.TvFileOrganizationOptions }); + ServerConfigurationManager.Configuration.TvFileOrganizationOptions = null; + saveConfig = true; + } + + if (saveConfig) + { + ServerConfigurationManager.SaveConfiguration(); + } } private void DeleteDeprecatedModules() @@ -297,116 +351,14 @@ namespace MediaBrowser.ServerApplication // Not there, no big deal } - Task.Run(() => + try { - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "remote-images"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "chapter-images"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "extracted-video-images"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "extracted-audio-images"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-tv"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-collections"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-movies"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-movies"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-music"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "fanart-tv"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tmdb-people"), true); - } - catch (IOException) - { - // Not there, no big deal - } - - try - { - Directory.Delete(Path.Combine(ApplicationPaths.DataPath, "tvdb-v3"), true); - } - catch (IOException) - { - // Not there, no big deal - } - }); + File.Delete(Path.Combine(ApplicationPaths.PluginsPath, "MediaBrowser.Plugins.XbmcMetadata.dll")); + } + catch (IOException) + { + // Not there, no big deal + } } private void MigrateUserFolders() @@ -440,8 +392,6 @@ namespace MediaBrowser.ServerApplication LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer); RegisterSingleInstance(LocalizationManager); - RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger)); - RegisterSingleInstance<IBlurayExaminer>(() => new BdInfoExaminer()); UserDataManager = new UserDataManager(LogManager); @@ -462,7 +412,13 @@ namespace MediaBrowser.ServerApplication FileOrganizationRepository = await GetFileOrganizationRepository().ConfigureAwait(false); RegisterSingleInstance(FileOrganizationRepository); - UserManager = new UserManager(LogManager.GetLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer); + AuthenticationRepository = await GetAuthenticationRepository().ConfigureAwait(false); + RegisterSingleInstance(AuthenticationRepository); + + //SyncRepository = await GetSyncRepository().ConfigureAwait(false); + //RegisterSingleInstance(SyncRepository); + + UserManager = new UserManager(LogManager.GetLogger("UserManager"), ServerConfigurationManager, UserRepository, XmlSerializer, NetworkManager, () => ImageProcessor, () => DtoService); RegisterSingleInstance(UserManager); LibraryManager = new LibraryManager(Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => LibraryMonitor, FileSystemManager, () => ProviderManager); @@ -482,7 +438,7 @@ namespace MediaBrowser.ServerApplication RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LogManager, LibraryManager, UserManager)); - HttpServer = ServerFactory.CreateServer(this, LogManager, "Media Browser", "mediabrowser", "dashboard/index.html"); + HttpServer = ServerFactory.CreateServer(this, LogManager, "Media Browser", WebApplicationName, "dashboard/index.html"); RegisterSingleInstance(HttpServer, false); progress.Report(10); @@ -498,10 +454,19 @@ namespace MediaBrowser.ServerApplication ImageProcessor = new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, MediaEncoder); RegisterSingleInstance(ImageProcessor); - DtoService = new DtoService(Logger, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager); + SyncManager = new SyncManager(LibraryManager, SyncRepository, ImageProcessor, LogManager.GetLogger("SyncManager")); + RegisterSingleInstance(SyncManager); + + DtoService = new DtoService(Logger, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, SyncManager); RegisterSingleInstance(DtoService); - SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository, LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, ItemRepository, JsonSerializer, this, HttpClient); + var encryptionManager = new EncryptionManager(); + RegisterSingleInstance<IEncryptionManager>(encryptionManager); + + ConnectManager = new ConnectManager(LogManager.GetLogger("Connect"), ApplicationPaths, JsonSerializer, encryptionManager, HttpClient, this, ServerConfigurationManager); + RegisterSingleInstance(ConnectManager); + + SessionManager = new SessionManager(UserDataManager, ServerConfigurationManager, Logger, UserRepository, LibraryManager, UserManager, musicManager, DtoService, ImageProcessor, ItemRepository, JsonSerializer, this, HttpClient, AuthenticationRepository); RegisterSingleInstance(SessionManager); var newsService = new Server.Implementations.News.NewsService(ApplicationPaths, JsonSerializer); @@ -521,26 +486,27 @@ namespace MediaBrowser.ServerApplication var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LogManager.GetLogger("Dlna"), JsonSerializer); RegisterSingleInstance<IDlnaManager>(dlnaManager); - var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient); - RegisterSingleInstance<IContentDirectory>(contentDirectory); - var connectionManager = new ConnectionManager(dlnaManager, ServerConfigurationManager, LogManager.GetLogger("UpnpConnectionManager"), HttpClient); RegisterSingleInstance<IConnectionManager>(connectionManager); - var collectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor); + var collectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager")); RegisterSingleInstance<ICollectionManager>(collectionManager); - LiveTvManager = new LiveTvManager(ServerConfigurationManager, FileSystemManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, JsonSerializer, LocalizationManager); + var playlistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager); + RegisterSingleInstance<IPlaylistManager>(playlistManager); + + LiveTvManager = new LiveTvManager(ServerConfigurationManager, FileSystemManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer); RegisterSingleInstance(LiveTvManager); - UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, FileSystemManager, UserManager, ChannelManager, LiveTvManager); + UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, FileSystemManager, UserManager, ChannelManager, LiveTvManager, ApplicationPaths, playlistManager); RegisterSingleInstance(UserViewManager); + var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, UserViewManager, ChannelManager); + RegisterSingleInstance<IContentDirectory>(contentDirectory); + NotificationManager = new NotificationManager(LogManager, UserManager, ServerConfigurationManager); RegisterSingleInstance(NotificationManager); - RegisterSingleInstance<IEncryptionManager>(new EncryptionManager()); - SubtitleManager = new SubtitleManager(LogManager.GetLogger("SubtitleManager"), FileSystemManager, LibraryMonitor, LibraryManager, ItemRepository); RegisterSingleInstance(SubtitleManager); @@ -551,7 +517,16 @@ namespace MediaBrowser.ServerApplication MediaEncoder, ChapterManager); RegisterSingleInstance(EncodingManager); - RegisterSingleInstance<ISubtitleEncoder>(new SubtitleEncoder(LibraryManager, LogManager.GetLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder)); + var activityLogRepo = await GetActivityLogRepository().ConfigureAwait(false); + RegisterSingleInstance(activityLogRepo); + RegisterSingleInstance<IActivityManager>(new ActivityManager(LogManager.GetLogger("ActivityManager"), activityLogRepo)); + + var authContext = new AuthorizationContext(); + RegisterSingleInstance<IAuthorizationContext>(authContext); + RegisterSingleInstance<ISessionContext>(new SessionContext(UserManager, authContext, SessionManager)); + RegisterSingleInstance<IAuthService>(new AuthService(UserManager, SessionManager, authContext, ServerConfigurationManager)); + + RegisterSingleInstance<ISubtitleEncoder>(new SubtitleEncoder(LibraryManager, LogManager.GetLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder, JsonSerializer)); var displayPreferencesTask = Task.Run(async () => await ConfigureDisplayPreferencesRepositories().ConfigureAwait(false)); var itemsTask = Task.Run(async () => await ConfigureItemRepositories().ConfigureAwait(false)); @@ -570,9 +545,9 @@ namespace MediaBrowser.ServerApplication SetKernelProperties(); } - protected override INetworkManager CreateNetworkManager() + protected override INetworkManager CreateNetworkManager(ILogger logger) { - return new NetworkManager(); + return new NetworkManager(logger); } protected override IFileSystem CreateFileSystemManager() @@ -588,7 +563,7 @@ namespace MediaBrowser.ServerApplication { var info = await new FFMpegDownloader(Logger, ApplicationPaths, HttpClient, ZipClient, FileSystemManager).GetFFMpegInfo(progress).ConfigureAwait(false); - MediaEncoder = new MediaEncoder(LogManager.GetLogger("MediaEncoder"), ApplicationPaths, JsonSerializer, info.EncoderPath, info.ProbePath, info.Version, FileSystemManager); + MediaEncoder = new MediaEncoder(LogManager.GetLogger("MediaEncoder"), JsonSerializer, info.EncoderPath, info.ProbePath, info.Version); RegisterSingleInstance(MediaEncoder); } @@ -626,6 +601,33 @@ namespace MediaBrowser.ServerApplication return repo; } + private async Task<IAuthenticationRepository> GetAuthenticationRepository() + { + var repo = new AuthenticationRepository(LogManager.GetLogger("AuthenticationRepository"), ServerConfigurationManager.ApplicationPaths); + + await repo.Initialize().ConfigureAwait(false); + + return repo; + } + + private async Task<IActivityRepository> GetActivityLogRepository() + { + var repo = new ActivityRepository(LogManager.GetLogger("ActivityRepository"), ServerConfigurationManager.ApplicationPaths); + + await repo.Initialize().ConfigureAwait(false); + + return repo; + } + + private async Task<ISyncRepository> GetSyncRepository() + { + var repo = new SyncRepository(LogManager.GetLogger("SyncRepository"), ServerConfigurationManager.ApplicationPaths); + + await repo.Initialize().ConfigureAwait(false); + + return repo; + } + /// <summary> /// Configures the repositories. /// </summary> @@ -695,6 +697,8 @@ namespace MediaBrowser.ServerApplication BaseItem.FileSystem = FileSystemManager; BaseItem.UserDataManager = UserDataManager; ChannelVideoItem.ChannelManager = ChannelManager; + BaseItem.LiveTvManager = LiveTvManager; + UserView.UserViewManager = UserViewManager; } /// <summary> @@ -745,6 +749,7 @@ namespace MediaBrowser.ServerApplication ChannelManager.AddParts(GetExports<IChannel>(), GetExports<IChannelFactory>()); NotificationManager.AddParts(GetExports<INotificationService>(), GetExports<INotificationTypeFactory>()); + SyncManager.AddParts(GetExports<ISyncProvider>()); } /// <summary> @@ -755,7 +760,7 @@ namespace MediaBrowser.ServerApplication { try { - ServerManager.Start(HttpServerUrlPrefixes, ServerConfigurationManager.Configuration.EnableHttpLevelLogging); + ServerManager.Start(HttpServerUrlPrefixes); } catch (Exception ex) { @@ -772,8 +777,6 @@ namespace MediaBrowser.ServerApplication throw; } } - - ServerManager.StartWebSocketServer(); } /// <summary> @@ -785,17 +788,10 @@ namespace MediaBrowser.ServerApplication { base.OnConfigurationUpdated(sender, e); - HttpServer.EnableHttpRequestLogging = ServerConfigurationManager.Configuration.EnableHttpLevelLogging; - if (!HttpServer.UrlPrefixes.SequenceEqual(HttpServerUrlPrefixes, StringComparer.OrdinalIgnoreCase)) { NotifyPendingRestart(); } - - else if (!ServerManager.SupportsNativeWebSocket && ServerManager.WebSocketPortNumber != ServerConfigurationManager.Configuration.LegacyWebSocketPortNumber) - { - NotifyPendingRestart(); - } } /// <summary> @@ -881,6 +877,12 @@ namespace MediaBrowser.ServerApplication // Dlna list.Add(typeof(DlnaEntryPoint).Assembly); + // Local metadata + list.Add(typeof(AlbumXmlProvider).Assembly); + + // Xbmc + list.Add(typeof(ArtistNfoProvider).Assembly); + list.AddRange(Assemblies.GetAssembliesWithParts()); // Include composable parts in the running assembly @@ -910,6 +912,11 @@ namespace MediaBrowser.ServerApplication private readonly string _systemId = Environment.MachineName.GetMD5().ToString(); + public string ServerId + { + get { return _systemId; } + } + /// <summary> /// Gets the system status. /// </summary> @@ -921,12 +928,12 @@ namespace MediaBrowser.ServerApplication HasPendingRestart = HasPendingRestart, Version = ApplicationVersion.ToString(), IsNetworkDeployed = CanSelfUpdate, - WebSocketPortNumber = ServerManager.WebSocketPortNumber, - SupportsNativeWebSocket = ServerManager.SupportsNativeWebSocket, + WebSocketPortNumber = HttpServerPort, + SupportsNativeWebSocket = true, FailedPluginAssemblies = FailedAssemblies.ToList(), InProgressInstallations = InstallationManager.CurrentInstallations.Select(i => i.Item1).ToList(), CompletedInstallations = InstallationManager.CompletedInstallations.ToList(), - Id = _systemId, + Id = ServerId, ProgramDataPath = ApplicationPaths.ProgramDataPath, LogPath = ApplicationPaths.LogDirectoryPath, ItemsByNamePath = ApplicationPaths.ItemsByNamePath, @@ -937,42 +944,57 @@ namespace MediaBrowser.ServerApplication OperatingSystem = Environment.OSVersion.ToString(), CanSelfRestart = CanSelfRestart, CanSelfUpdate = CanSelfUpdate, - WanAddress = GetWanAddress(), + WanAddress = ConnectManager.WanApiAddress, HasUpdateAvailable = HasUpdateAvailable, SupportsAutoRunAtStartup = SupportsAutoRunAtStartup, TranscodingTempPath = ApplicationPaths.TranscodingTempPath, IsRunningAsService = IsRunningAsService, - ServerName = string.IsNullOrWhiteSpace(ServerConfigurationManager.Configuration.ServerName) ? Environment.MachineName : ServerConfigurationManager.Configuration.ServerName + ServerName = FriendlyName, + LocalAddress = GetLocalIpAddress() }; } - public int HttpServerPort + /// <summary> + /// Gets the local ip address. + /// </summary> + /// <returns>System.String.</returns> + private string GetLocalIpAddress() { - get { return ServerConfigurationManager.Configuration.HttpServerPortNumber; } - } + var localAddresses = NetworkManager.GetLocalIpAddresses().ToList(); - private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - private string GetWanAddress() - { - var ip = ServerConfigurationManager.Configuration.WanDdns; + // Cross-check the local ip addresses with addresses that have been received on with the http server + var matchedAddress = HttpServer.LocalEndPoints + .ToList() + .Select(i => i.Split(':').FirstOrDefault()) + .Where(i => !string.IsNullOrEmpty(i)) + .FirstOrDefault(i => localAddresses.Contains(i, StringComparer.OrdinalIgnoreCase)); + + // Return the first matched address, if found, or the first known local address + var address = matchedAddress ?? localAddresses.FirstOrDefault(); - if (string.IsNullOrWhiteSpace(ip)) + if (!string.IsNullOrWhiteSpace(address)) { - ip = WanAddressEntryPoint.WanAddress; + address = string.Format("http://{0}:{1}", + address, + ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(CultureInfo.InvariantCulture)); } - if (!string.IsNullOrEmpty(ip)) - { - if (!ip.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && - !ip.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) - { - ip = "http://" + ip; - } + return address; + } - return ip + ":" + ServerConfigurationManager.Configuration.HttpServerPortNumber.ToString(_usCulture); + public string FriendlyName + { + get + { + return string.IsNullOrWhiteSpace(ServerConfigurationManager.Configuration.ServerName) + ? Environment.MachineName + : ServerConfigurationManager.Configuration.ServerName; } + } - return null; + public int HttpServerPort + { + get { return ServerConfigurationManager.Configuration.HttpServerPortNumber; } } /// <summary> @@ -1021,7 +1043,6 @@ namespace MediaBrowser.ServerApplication ServerAuthorization.AuthorizeServer( ServerConfigurationManager.Configuration.HttpServerPortNumber, HttpServerUrlPrefixes.First(), - ServerConfigurationManager.Configuration.LegacyWebSocketPortNumber, UdpServerEntryPoint.PortNumber, ConfigurationManager.CommonApplicationPaths.TempDirectory); } @@ -1058,15 +1079,18 @@ namespace MediaBrowser.ServerApplication /// <returns>Task{CheckForUpdateResult}.</returns> public override async Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress) { - var availablePackages = await InstallationManager.GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false); + var result = await NativeApp.CheckForApplicationUpdate(ApplicationVersion, + ConfigurationManager.CommonConfiguration.SystemUpdateLevel, InstallationManager, + cancellationToken, progress).ConfigureAwait(false); - var version = InstallationManager.GetLatestCompatibleVersion(availablePackages, "MBServer", null, ApplicationVersion, - ConfigurationManager.CommonConfiguration.SystemUpdateLevel); + HasUpdateAvailable = result.IsUpdateAvailable; - HasUpdateAvailable = version != null && version.version >= ApplicationVersion; + if (result.IsUpdateAvailable) + { + Logger.Info("New application version is available: {0}", result.AvailableVersion); + } - return version != null ? new CheckForUpdateResult { AvailableVersion = version.version, IsUpdateAvailable = version.version > ApplicationVersion, Package = version } : - new CheckForUpdateResult { AvailableVersion = ApplicationVersion, IsUpdateAvailable = false }; + return result; } /// <summary> diff --git a/MediaBrowser.ServerApplication/EntryPoints/WanAddressEntryPoint.cs b/MediaBrowser.ServerApplication/EntryPoints/WanAddressEntryPoint.cs deleted file mode 100644 index 7b2a1314e0..0000000000 --- a/MediaBrowser.ServerApplication/EntryPoints/WanAddressEntryPoint.cs +++ /dev/null @@ -1,55 +0,0 @@ -using MediaBrowser.Common.Net; -using MediaBrowser.Controller.Plugins; -using System; -using System.IO; -using System.Threading; - -namespace MediaBrowser.ServerApplication.EntryPoints -{ - public class WanAddressEntryPoint : IServerEntryPoint - { - public static string WanAddress; - private Timer _timer; - private readonly IHttpClient _httpClient; - - public WanAddressEntryPoint(IHttpClient httpClient) - { - _httpClient = httpClient; - } - - public void Run() - { - _timer = new Timer(TimerCallback, null, TimeSpan.FromMinutes(1), TimeSpan.FromHours(24)); - } - - private async void TimerCallback(object state) - { - try - { - using (var stream = await _httpClient.Get(new HttpRequestOptions - { - Url = "http://bot.whatismyipaddress.com/" - - }).ConfigureAwait(false)) - { - using (var reader = new StreamReader(stream)) - { - WanAddress = await reader.ReadToEndAsync().ConfigureAwait(false); - } - } - } - catch - { - } - } - - public void Dispose() - { - if (_timer != null) - { - _timer.Dispose(); - _timer = null; - } - } - } -} diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs index b8566ee510..738650df77 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloadInfo.cs @@ -14,6 +14,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg // Windows builds: http://ffmpeg.zeranoe.com/builds/ // Linux builds: http://ffmpeg.gusari.org/static/ // OS X builds: http://ffmpegmac.net/ + // OS X x64: http://www.evermeet.cx/ffmpeg/ public static string Version = ffmpegOsType("Version"); @@ -34,7 +35,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": - return "20140612"; + return "20140827"; case "FFMpegFilename": return "ffmpeg.exe"; case "FFProbeFilename": @@ -52,6 +53,21 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (arg) { case "Version": + return "20140827"; + case "FFMpegFilename": + return "ffmpeg"; + case "FFProbeFilename": + return "ffprobe"; + case "ArchiveType": + return "gz"; + } + break; + } + if (PlatformDetection.IsX86) + { + switch (arg) + { + case "Version": return "20131121"; case "FFMpegFilename": return "ffmpeg"; @@ -110,18 +126,35 @@ namespace MediaBrowser.ServerApplication.FFMpeg switch (pid) { case PlatformID.Win32NT: + if (PlatformDetection.IsX86_64) + { + return new[] + { + "http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20140827-git-9e8ab36-win64-static.7z", + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20140827-git-9e8ab36-win64-static.7z" + }; + } + return new[] { - "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140612-git-3a1c895-win32-static.7z", - "https://www.dropbox.com/s/lllit55bynbz6zc/ffmpeg-20140612-git-3a1c895-win32-static.7z?dl=1" + "http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140827-git-9e8ab36-win32-static.7z", + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20140827-git-9e8ab36-win32-static.7z" }; case PlatformID.Unix: + if (PlatformDetection.IsMac && PlatformDetection.IsX86) + { + return new[] + { + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/osx/ffmpeg-osx-20131121.gz" + }; + } + if (PlatformDetection.IsMac && PlatformDetection.IsX86_64) { return new[] { - "https://www.dropbox.com/s/n188rxbulqem8ry/ffmpeg-osx-20131121.gz?dl=1" + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/osx/ffmpeg-x64-2.3.3.7z" }; } @@ -132,7 +165,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg return new[] { "http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.latest.tar.gz", - "https://www.dropbox.com/s/k9s02pv5to6slfb/ffmpeg.static.32bit.2014-05-06.tar.gz?dl=1" + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.32bit.2014-05-06.tar.gz" }; } @@ -141,13 +174,13 @@ namespace MediaBrowser.ServerApplication.FFMpeg return new[] { "http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz", - "https://www.dropbox.com/s/onuregwghywnzjo/ffmpeg.static.64bit.2014-05-05.tar.gz?dl=1" + "https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.64bit.2014-05-05.tar.gz" }; } } - //No Unix version available + // No Unix version available return new string[] { }; default: @@ -213,4 +246,4 @@ namespace MediaBrowser.ServerApplication.FFMpeg public string sysname = string.Empty; public string machine = string.Empty; } -} +}
\ No newline at end of file diff --git a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs index c550cb27fb..4f94ebd67c 100644 --- a/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs +++ b/MediaBrowser.ServerApplication/FFMpeg/FFMpegDownloader.cs @@ -1,12 +1,10 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Common.IO; using MediaBrowser.Common.Net; -using MediaBrowser.Common.Progress; using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Net; using System; -using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -26,10 +24,10 @@ namespace MediaBrowser.ServerApplication.FFMpeg private readonly IZipClient _zipClient; private readonly IFileSystem _fileSystem; - private readonly string[] _fontUrls = new[] - { - "https://www.dropbox.com/s/pj847twf7riq0j7/ARIALUNI.7z?dl=1" - }; + private readonly string[] _fontUrls = + { + "https://www.dropbox.com/s/pj847twf7riq0j7/ARIALUNI.7z?dl=1" + }; public FFMpegDownloader(ILogger logger, IApplicationPaths appPaths, IHttpClient httpClient, IZipClient zipClient, IFileSystem fileSystem) { @@ -101,7 +99,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg { EncoderPath = encoder, ProbePath = probe, - Version = Path.GetFileNameWithoutExtension(Path.GetDirectoryName(probe)) + Version = Path.GetFileName(Path.GetDirectoryName(probe)) }; } } @@ -140,13 +138,9 @@ namespace MediaBrowser.ServerApplication.FFMpeg ExtractFFMpeg(tempFile, directory); return; } - catch (HttpException ex) - { - _logger.ErrorException("Error downloading {0}", ex, url); - } catch (Exception ex) { - _logger.ErrorException("Error unpacking {0}", ex, url); + _logger.ErrorException("Error downloading {0}", ex, url); } } @@ -251,6 +245,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg Task.Run(async () => { await DownloadFontFile(fontsDirectory, fontFilename, new Progress<double>()).ConfigureAwait(false); + await WriteFontConfigFile(fontsDirectory).ConfigureAwait(false); }); } diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 3ea45bc4fb..81c04060a3 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -1,5 +1,4 @@ using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Constants; using MediaBrowser.Common.Implementations.Logging; using MediaBrowser.Model.Logging; using MediaBrowser.Server.Implementations; @@ -195,13 +194,7 @@ namespace MediaBrowser.ServerApplication private static void BeginLog(ILogger logger, IApplicationPaths appPaths) { logger.Info("Media Browser Server started"); - logger.Info("Command line: {0}", string.Join(" ", Environment.GetCommandLineArgs())); - - logger.Info("Server: {0}", Environment.MachineName); - logger.Info("Operating system: {0}", Environment.OSVersion.ToString()); - logger.Info("Program data path: {0}", appPaths.ProgramDataPath); - - logger.Info("Application Path: {0}", appPaths.ApplicationPath); + ApplicationHost.LogEnvironmentInfo(logger, appPaths); } private static readonly TaskCompletionSource<bool> ApplicationTaskCompletionSource = new TaskCompletionSource<bool>(); @@ -227,14 +220,9 @@ namespace MediaBrowser.ServerApplication ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX); } - var task = _appHost.Init(initProgress); - Task.WaitAll(task); - - task = _appHost.RunStartupTasks(); - Task.WaitAll(task); - SystemEvents.SessionEnding += SystemEvents_SessionEnding; - SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; + var task = _appHost.Init(initProgress); + task = task.ContinueWith(new Action<Task>(a => _appHost.RunStartupTasks())); if (runService) { @@ -242,6 +230,11 @@ namespace MediaBrowser.ServerApplication } else { + Task.WaitAll(task); + + SystemEvents.SessionEnding += SystemEvents_SessionEnding; + SystemEvents.SessionSwitch += SystemEvents_SessionSwitch; + HideSplashScreen(); ShowTrayIcon(); diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index 7657fc091e..2e33ee2d5f 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -61,14 +61,14 @@ </PropertyGroup> <ItemGroup> <Reference Include="MediaBrowser.IsoMounter"> - <HintPath>..\packages\MediaBrowser.IsoMounting.3.0.68\lib\net45\MediaBrowser.IsoMounter.dll</HintPath> + <HintPath>..\packages\MediaBrowser.IsoMounting.3.0.69\lib\net45\MediaBrowser.IsoMounter.dll</HintPath> </Reference> - <Reference Include="NLog, Version=3.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <Reference Include="NLog, Version=3.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\NLog.3.0.0.0\lib\net45\NLog.dll</HintPath> + <HintPath>..\packages\NLog.3.1.0.0\lib\net45\NLog.dll</HintPath> </Reference> <Reference Include="pfmclrapi"> - <HintPath>..\packages\MediaBrowser.IsoMounting.3.0.68\lib\net45\pfmclrapi.dll</HintPath> + <HintPath>..\packages\MediaBrowser.IsoMounting.3.0.69\lib\net45\pfmclrapi.dll</HintPath> </Reference> <Reference Include="ServiceStack.Interfaces"> <HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath> @@ -100,7 +100,6 @@ <Compile Include="EntryPoints\KeepServerAwake.cs" /> <Compile Include="EntryPoints\ResourceEntryPoint.cs" /> <Compile Include="EntryPoints\StartupWizard.cs" /> - <Compile Include="EntryPoints\WanAddressEntryPoint.cs" /> <Compile Include="FFMpeg\FFMpegDownloader.cs" /> <Compile Include="FFMpeg\FFMpegDownloadInfo.cs" /> <Compile Include="FFMpeg\FFMpegInfo.cs" /> @@ -198,6 +197,10 @@ <Project>{734098eb-6dc1-4dd0-a1ca-3140dcd2737c}</Project> <Name>MediaBrowser.Dlna</Name> </ProjectReference> + <ProjectReference Include="..\MediaBrowser.LocalMetadata\MediaBrowser.LocalMetadata.csproj"> + <Project>{7ef9f3e0-697d-42f3-a08f-19deb5f84392}</Project> + <Name>MediaBrowser.LocalMetadata</Name> + </ProjectReference> <ProjectReference Include="..\MediaBrowser.MediaEncoding\MediaBrowser.MediaEncoding.csproj"> <Project>{0bd82fa6-eb8a-4452-8af5-74f9c3849451}</Project> <Name>MediaBrowser.MediaEncoding</Name> @@ -218,6 +221,10 @@ <Project>{5624b7b5-b5a7-41d8-9f10-cc5611109619}</Project> <Name>MediaBrowser.WebDashboard</Name> </ProjectReference> + <ProjectReference Include="..\MediaBrowser.XbmcMetadata\MediaBrowser.XbmcMetadata.csproj"> + <Project>{23499896-b135-4527-8574-c26e926ea99e}</Project> + <Name>MediaBrowser.XbmcMetadata</Name> + </ProjectReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> diff --git a/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs b/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs index 77a543ad7f..c2c64ea4d4 100644 --- a/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs +++ b/MediaBrowser.ServerApplication/Native/BrowserLauncher.cs @@ -25,7 +25,7 @@ namespace MediaBrowser.ServerApplication.Native public static void OpenDashboardPage(string page, User loggedInUser, IServerConfigurationManager configurationManager, IServerApplicationHost appHost, ILogger logger) { var url = "http://localhost:" + configurationManager.Configuration.HttpServerPortNumber + "/" + - appHost.WebApplicationName + "/dashboard/" + page; + appHost.WebApplicationName + "/web/" + page; OpenUrl(url, logger); } @@ -87,18 +87,6 @@ namespace MediaBrowser.ServerApplication.Native } /// <summary> - /// Opens the standard API documentation. - /// </summary> - /// <param name="configurationManager">The configuration manager.</param> - /// <param name="appHost">The app host.</param> - /// <param name="logger">The logger.</param> - public static void OpenStandardApiDocumentation(IServerConfigurationManager configurationManager, IServerApplicationHost appHost, ILogger logger) - { - OpenUrl("http://localhost:" + configurationManager.Configuration.HttpServerPortNumber + "/" + - appHost.WebApplicationName + "/metadata", logger); - } - - /// <summary> /// Opens the URL. /// </summary> /// <param name="url">The URL.</param> diff --git a/MediaBrowser.ServerApplication/Native/NativeApp.cs b/MediaBrowser.ServerApplication/Native/NativeApp.cs index 2388b610b7..0e7dc50a9f 100644 --- a/MediaBrowser.ServerApplication/Native/NativeApp.cs +++ b/MediaBrowser.ServerApplication/Native/NativeApp.cs @@ -1,4 +1,10 @@ -using System.Runtime.InteropServices; +using System; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Common.Updates; +using MediaBrowser.Model.Logging; +using MediaBrowser.Model.Updates; namespace MediaBrowser.ServerApplication.Native { @@ -84,5 +90,24 @@ namespace MediaBrowser.ServerApplication.Native EXECUTION_STATE es = SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED); } } + + public static async Task<CheckForUpdateResult> CheckForApplicationUpdate(Version currentVersion, + PackageVersionClass updateLevel, + IInstallationManager installationManager, + CancellationToken cancellationToken, + IProgress<double> progress) + { + var availablePackages = await installationManager.GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false); + + var version = installationManager.GetLatestCompatibleVersion(availablePackages, "MBServer", null, currentVersion, updateLevel); + + var versionObject = version == null || string.IsNullOrWhiteSpace(version.versionStr) ? null : new Version(version.versionStr); + + var isUpdateAvailable = versionObject != null && versionObject > currentVersion; + + return versionObject != null ? + new CheckForUpdateResult { AvailableVersion = versionObject.ToString(), IsUpdateAvailable = isUpdateAvailable, Package = version } : + new CheckForUpdateResult { AvailableVersion = currentVersion.ToString(), IsUpdateAvailable = false }; + } } } diff --git a/MediaBrowser.ServerApplication/Native/RegisterServer.bat b/MediaBrowser.ServerApplication/Native/RegisterServer.bat index d762dfaf76..3504123444 100644 --- a/MediaBrowser.ServerApplication/Native/RegisterServer.bat +++ b/MediaBrowser.ServerApplication/Native/RegisterServer.bat @@ -1,7 +1,6 @@ rem %1 = http server port rem %2 = http server url rem %3 = udp server port -rem %4 = tcp server port (web socket) if [%1]==[] GOTO DONE @@ -18,11 +17,6 @@ if [%3]==[] GOTO DONE netsh advfirewall firewall delete rule name="Port %3" protocol=UDP localport=%3 netsh advfirewall firewall add rule name="Port %3" dir=in action=allow protocol=UDP localport=%3 -if [%4]==[] GOTO DONE - -netsh advfirewall firewall delete rule name="Port %4" protocol=TCP localport=%4 -netsh advfirewall firewall add rule name="Port %4" dir=in action=allow protocol=TCP localport=%4 - :DONE Exit
\ No newline at end of file diff --git a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs b/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs index d2e5425367..e5989db3bf 100644 --- a/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs +++ b/MediaBrowser.ServerApplication/Native/ServerAuthorization.cs @@ -15,10 +15,9 @@ namespace MediaBrowser.ServerApplication.Native /// </summary> /// <param name="httpServerPort">The HTTP server port.</param> /// <param name="httpServerUrlPrefix">The HTTP server URL prefix.</param> - /// <param name="webSocketPort">The web socket port.</param> /// <param name="udpPort">The UDP port.</param> /// <param name="tempDirectory">The temp directory.</param> - public static void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int webSocketPort, int udpPort, string tempDirectory) + public static void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory) { Directory.CreateDirectory(tempDirectory); @@ -38,10 +37,9 @@ namespace MediaBrowser.ServerApplication.Native { FileName = tmpFile, - Arguments = string.Format("{0} {1} {2} {3}", httpServerPort, + Arguments = string.Format("{0} {1} {2}", httpServerPort, httpServerUrlPrefix, - udpPort, - webSocketPort), + udpPort), CreateNoWindow = true, WindowStyle = ProcessWindowStyle.Hidden, diff --git a/MediaBrowser.ServerApplication/Networking/NetworkManager.cs b/MediaBrowser.ServerApplication/Networking/NetworkManager.cs index e80c8ff3f4..fc4d263636 100644 --- a/MediaBrowser.ServerApplication/Networking/NetworkManager.cs +++ b/MediaBrowser.ServerApplication/Networking/NetworkManager.cs @@ -1,11 +1,12 @@ -using System.Globalization; -using System.IO; -using MediaBrowser.Common.Implementations.Networking; +using MediaBrowser.Common.Implementations.Networking; using MediaBrowser.Common.Net; using MediaBrowser.Model.IO; +using MediaBrowser.Model.Logging; using MediaBrowser.Model.Net; using System; using System.Collections.Generic; +using System.Globalization; +using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -16,6 +17,11 @@ namespace MediaBrowser.ServerApplication.Networking /// </summary> public class NetworkManager : BaseNetworkManager, INetworkManager { + public NetworkManager(ILogger logger) + : base(logger) + { + } + /// <summary> /// Gets the network shares. /// </summary> diff --git a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs b/MediaBrowser.ServerApplication/ServerNotifyIcon.cs index f5f9434e7d..47a4be8e36 100644 --- a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs +++ b/MediaBrowser.ServerApplication/ServerNotifyIcon.cs @@ -29,7 +29,6 @@ namespace MediaBrowser.ServerApplication private System.Windows.Forms.ToolStripMenuItem cmdLogWindow; private System.Windows.Forms.ToolStripMenuItem cmdCommunity; private System.Windows.Forms.ToolStripMenuItem cmdApiDocs; - private System.Windows.Forms.ToolStripMenuItem cmdStandardDocs; private System.Windows.Forms.ToolStripMenuItem cmdSwagger; private System.Windows.Forms.ToolStripMenuItem cmdGtihub; @@ -90,7 +89,6 @@ namespace MediaBrowser.ServerApplication cmdConfigure = new System.Windows.Forms.ToolStripMenuItem(); cmdBrowse = new System.Windows.Forms.ToolStripMenuItem(); cmdApiDocs = new System.Windows.Forms.ToolStripMenuItem(); - cmdStandardDocs = new System.Windows.Forms.ToolStripMenuItem(); cmdSwagger = new System.Windows.Forms.ToolStripMenuItem(); cmdGtihub = new System.Windows.Forms.ToolStripMenuItem(); @@ -169,17 +167,11 @@ namespace MediaBrowser.ServerApplication // cmdApiDocs // cmdApiDocs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - cmdStandardDocs, cmdSwagger, cmdGtihub}); cmdApiDocs.Name = "cmdApiDocs"; cmdApiDocs.Size = new System.Drawing.Size(208, 22); // - // cmdStandardDocs - // - cmdStandardDocs.Name = "cmdStandardDocs"; - cmdStandardDocs.Size = new System.Drawing.Size(136, 22); - // // cmdSwagger // cmdSwagger.Name = "cmdSwagger"; @@ -199,7 +191,6 @@ namespace MediaBrowser.ServerApplication cmdLibraryExplorer.Click += cmdLibraryExplorer_Click; cmdSwagger.Click += cmdSwagger_Click; - cmdStandardDocs.Click += cmdStandardDocs_Click; cmdGtihub.Click += cmdGtihub_Click; LoadLogWindow(null, EventArgs.Empty); @@ -224,7 +215,6 @@ namespace MediaBrowser.ServerApplication cmdCommunity.Text = _localization.GetLocalizedString("LabelVisitCommunity"); cmdGtihub.Text = _localization.GetLocalizedString("LabelGithubWiki"); cmdSwagger.Text = _localization.GetLocalizedString("LabelSwagger"); - cmdStandardDocs.Text = _localization.GetLocalizedString("LabelStandard"); cmdApiDocs.Text = _localization.GetLocalizedString("LabelViewApiDocumentation"); cmdBrowse.Text = _localization.GetLocalizedString("LabelBrowseLibrary"); cmdConfigure.Text = _localization.GetLocalizedString("LabelConfigureMediaBrowser"); @@ -346,11 +336,6 @@ namespace MediaBrowser.ServerApplication BrowserLauncher.OpenGithub(_logger); } - void cmdStandardDocs_Click(object sender, EventArgs e) - { - BrowserLauncher.OpenStandardApiDocumentation(_configurationManager, _appHost, _logger); - } - void cmdSwagger_Click(object sender, EventArgs e) { BrowserLauncher.OpenSwagger(_configurationManager, _appHost, _logger); diff --git a/MediaBrowser.ServerApplication/packages.config b/MediaBrowser.ServerApplication/packages.config index 87bd11bd45..8de487fb50 100644 --- a/MediaBrowser.ServerApplication/packages.config +++ b/MediaBrowser.ServerApplication/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="MediaBrowser.IsoMounting" version="3.0.68" targetFramework="net45" /> - <package id="NLog" version="3.0.0.0" targetFramework="net45" /> + <package id="MediaBrowser.IsoMounting" version="3.0.69" targetFramework="net45" /> + <package id="NLog" version="3.1.0.0" targetFramework="net45" /> </packages>
\ No newline at end of file |
