remove some usage of ActiveService

This commit is contained in:
Luke Pulverenti 2015-03-12 10:59:08 -04:00
parent 7dc19a8262
commit 028a0a857a
3 changed files with 3 additions and 11 deletions

View File

@ -14,12 +14,6 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary>
public interface ILiveTvManager
{
/// <summary>
/// Gets the active service.
/// </summary>
/// <value>The active service.</value>
ILiveTvService ActiveService { get; }
/// <summary>
/// Gets the services.
/// </summary>

View File

@ -1843,15 +1843,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv
private bool IsLiveTvEnabled(User user)
{
return user.Policy.EnableLiveTvAccess && ActiveService != null;
return user.Policy.EnableLiveTvAccess && Services.Count > 0;
}
public IEnumerable<User> GetEnabledUsers()
{
var service = ActiveService;
return _userManager.Users
.Where(i => i.Policy.EnableLiveTvAccess && service != null);
.Where(IsLiveTvEnabled);
}
/// <summary>

View File

@ -52,7 +52,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
public bool IsHidden
{
get { return _liveTvManager.ActiveService == null; }
get { return _liveTvManager.Services.Count == 0; }
}
public bool IsEnabled