2014-10-30 01:17:31 +00:00
|
|
|
|
using MediaBrowser.Model.Connect;
|
|
|
|
|
using MediaBrowser.Model.System;
|
2014-10-27 03:06:01 +00:00
|
|
|
|
using System;
|
2014-10-03 03:48:59 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Model.ApiClient
|
|
|
|
|
{
|
|
|
|
|
public class ServerInfo
|
|
|
|
|
{
|
|
|
|
|
public String Name { get; set; }
|
|
|
|
|
public String Id { get; set; }
|
|
|
|
|
public String LocalAddress { get; set; }
|
|
|
|
|
public String RemoteAddress { get; set; }
|
|
|
|
|
public String UserId { get; set; }
|
|
|
|
|
public String AccessToken { get; set; }
|
2014-10-04 01:42:38 +00:00
|
|
|
|
public List<WakeOnLanInfo> WakeOnLanInfos { get; set; }
|
2014-10-13 20:14:53 +00:00
|
|
|
|
public DateTime DateLastAccessed { get; set; }
|
2014-10-18 21:25:04 +00:00
|
|
|
|
public String ExchangeToken { get; set; }
|
2014-10-30 01:17:31 +00:00
|
|
|
|
public UserLinkType? UserLinkType { get; set; }
|
2014-10-03 03:48:59 +00:00
|
|
|
|
|
2014-11-14 06:27:10 +00:00
|
|
|
|
public bool IsLocalAddressFixed { get; set; }
|
|
|
|
|
|
2014-10-03 03:48:59 +00:00
|
|
|
|
public ServerInfo()
|
|
|
|
|
{
|
2014-10-04 01:42:38 +00:00
|
|
|
|
WakeOnLanInfos = new List<WakeOnLanInfo>();
|
2014-10-03 03:48:59 +00:00
|
|
|
|
}
|
2014-10-27 03:06:01 +00:00
|
|
|
|
|
|
|
|
|
public void ImportInfo(PublicSystemInfo systemInfo)
|
|
|
|
|
{
|
|
|
|
|
Name = systemInfo.ServerName;
|
|
|
|
|
Id = systemInfo.Id;
|
|
|
|
|
|
2014-11-14 06:27:10 +00:00
|
|
|
|
if (!IsLocalAddressFixed && !string.IsNullOrEmpty(systemInfo.LocalAddress))
|
2014-10-27 03:06:01 +00:00
|
|
|
|
{
|
|
|
|
|
LocalAddress = systemInfo.LocalAddress;
|
|
|
|
|
}
|
2014-11-14 06:27:10 +00:00
|
|
|
|
|
2014-10-27 03:06:01 +00:00
|
|
|
|
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
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-10-03 03:48:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|