diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-17 13:23:00 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-01-17 13:23:00 -0500 |
| commit | 91e4f67139e30e8a1c873af802e7fa70d960671f (patch) | |
| tree | e3e48ae08c8919074d2043e520720f20f2a0f41a /MediaBrowser.Api/LiveTv/LiveTvService.cs | |
| parent | 43a806ad0265a537e7dc730d277cf4debe3e7dd5 (diff) | |
add more properties to LiveTvInfo
Diffstat (limited to 'MediaBrowser.Api/LiveTv/LiveTvService.cs')
| -rw-r--r-- | MediaBrowser.Api/LiveTv/LiveTvService.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/MediaBrowser.Api/LiveTv/LiveTvService.cs b/MediaBrowser.Api/LiveTv/LiveTvService.cs index 9f45df8e6..7ccb83bc8 100644 --- a/MediaBrowser.Api/LiveTv/LiveTvService.cs +++ b/MediaBrowser.Api/LiveTv/LiveTvService.cs @@ -295,11 +295,18 @@ namespace MediaBrowser.Api.LiveTv public object Get(GetLiveTvInfo request) { var services = _liveTvManager.GetServiceInfos(CancellationToken.None).Result; + var servicesList = services.ToList(); + + var activeServiceInfo = _liveTvManager.ActiveService == null ? null : + servicesList.FirstOrDefault(i => string.Equals(i.Name, _liveTvManager.ActiveService.Name, StringComparison.OrdinalIgnoreCase)); var info = new LiveTvInfo { - Services = services.ToList(), - ActiveServiceName = _liveTvManager.ActiveService == null ? null : _liveTvManager.ActiveService.Name + Services = servicesList.ToList(), + ActiveServiceName = activeServiceInfo == null ? null : activeServiceInfo.Name, + IsEnabled = _liveTvManager.ActiveService != null, + Status = activeServiceInfo == null ? LiveTvServiceStatus.Unavailable : activeServiceInfo.Status, + StatusMessage = activeServiceInfo == null ? null : activeServiceInfo.StatusMessage }; return ToOptimizedResult(info); |
