remove some usage of ActiveService
This commit is contained in:
parent
7dc19a8262
commit
028a0a857a
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user