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> /// </summary>
public interface ILiveTvManager public interface ILiveTvManager
{ {
/// <summary>
/// Gets the active service.
/// </summary>
/// <value>The active service.</value>
ILiveTvService ActiveService { get; }
/// <summary> /// <summary>
/// Gets the services. /// Gets the services.
/// </summary> /// </summary>

View file

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

View file

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