diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-26 23:06:01 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-10-26 23:06:01 -0400 |
| commit | 3ccb6bddef8980569e95a189fe0f63b0750e5e41 (patch) | |
| tree | 6b71ccfbc8dc7e7f2723c81a9ed26a276af8665a /MediaBrowser.Model/ApiClient | |
| parent | b5212f94a9a090384b4a2deb5fe2b98dae8a509c (diff) | |
connect updates
Diffstat (limited to 'MediaBrowser.Model/ApiClient')
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IApiClient.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IConnectionManager.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/ApiClient/ServerInfo.cs | 34 |
3 files changed, 41 insertions, 2 deletions
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 /// <param name="password">The password.</param> /// <returns>Task.</returns> /// <exception cref="ArgumentNullException">userId</exception> - Task<AuthenticationResult> AuthenticateUserAsync(string username, string password); + Task<AuthenticationResult> AuthenticateUserAsync(string username, + string password); /// <summary> /// 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 @@ -40,6 +40,12 @@ namespace MediaBrowser.Model.ApiClient ConnectUser ConnectUser { get; } /// <summary> + /// Gets or sets a value indicating whether [save local credentials]. + /// </summary> + /// <value><c>true</c> if [save local credentials]; otherwise, <c>false</c>.</value> + bool SaveLocalCredentials { get; set; } + + /// <summary> /// Gets the API client. /// </summary> /// <param name="item">The item.</param> 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<WakeOnLanInfo>(); } + + 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<WakeOnLanInfo>(); + + if (!string.IsNullOrEmpty(fullSystemInfo.MacAddress)) + { + WakeOnLanInfos.Add(new WakeOnLanInfo + { + MacAddress = fullSystemInfo.MacAddress + }); + } + } + } + } } |
