mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
remove some usage of ActiveService
This commit is contained in:
parent
7dc19a8262
commit
028a0a857a
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user