From 3ccb6bddef8980569e95a189fe0f63b0750e5e41 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 26 Oct 2014 23:06:01 -0400 Subject: connect updates --- MediaBrowser.Model/ApiClient/IApiClient.cs | 3 +- MediaBrowser.Model/ApiClient/IConnectionManager.cs | 6 ++++ MediaBrowser.Model/ApiClient/ServerInfo.cs | 34 +++++++++++++++++++++- 3 files changed, 41 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Model/ApiClient') diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index 8a777d3a2..bc909284b 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -718,7 +718,8 @@ namespace MediaBrowser.Model.ApiClient /// The password. /// Task. /// userId - Task AuthenticateUserAsync(string username, string password); + Task AuthenticateUserAsync(string username, + string password); /// /// Updates the server configuration async. diff --git a/MediaBrowser.Model/ApiClient/IConnectionManager.cs b/MediaBrowser.Model/ApiClient/IConnectionManager.cs index 339522b01..e4c67f3e3 100644 --- a/MediaBrowser.Model/ApiClient/IConnectionManager.cs +++ b/MediaBrowser.Model/ApiClient/IConnectionManager.cs @@ -39,6 +39,12 @@ namespace MediaBrowser.Model.ApiClient /// The connect user. ConnectUser ConnectUser { get; } + /// + /// Gets or sets a value indicating whether [save local credentials]. + /// + /// true if [save local credentials]; otherwise, false. + bool SaveLocalCredentials { get; set; } + /// /// Gets the API client. /// diff --git a/MediaBrowser.Model/ApiClient/ServerInfo.cs b/MediaBrowser.Model/ApiClient/ServerInfo.cs index cb1c1e094..299e3015c 100644 --- a/MediaBrowser.Model/ApiClient/ServerInfo.cs +++ b/MediaBrowser.Model/ApiClient/ServerInfo.cs @@ -1,4 +1,5 @@ -using System; +using MediaBrowser.Model.System; +using System; using System.Collections.Generic; namespace MediaBrowser.Model.ApiClient @@ -19,5 +20,36 @@ namespace MediaBrowser.Model.ApiClient { WakeOnLanInfos = new List(); } + + public void ImportInfo(PublicSystemInfo systemInfo) + { + Name = systemInfo.ServerName; + Id = systemInfo.Id; + + if (!string.IsNullOrEmpty(systemInfo.LocalAddress)) + { + LocalAddress = systemInfo.LocalAddress; + } + if (!string.IsNullOrEmpty(systemInfo.WanAddress)) + { + RemoteAddress = systemInfo.WanAddress; + } + + var fullSystemInfo = systemInfo as SystemInfo; + + if (fullSystemInfo != null) + { + WakeOnLanInfos = new List(); + + if (!string.IsNullOrEmpty(fullSystemInfo.MacAddress)) + { + WakeOnLanInfos.Add(new WakeOnLanInfo + { + MacAddress = fullSystemInfo.MacAddress + }); + } + } + } + } } -- cgit v1.2.3