remove tuner host enabled property

This commit is contained in:
Luke Pulverenti 2017-03-13 00:56:41 -04:00
parent f05dc08c06
commit 2ff7608b7a
6 changed files with 5 additions and 13 deletions

View File

@ -2750,7 +2750,7 @@ namespace Emby.Server.Implementations.LiveTv
private bool IsLiveTvEnabled(User user) private bool IsLiveTvEnabled(User user)
{ {
return user.Policy.EnableLiveTvAccess && (Services.Count > 1 || GetConfiguration().TunerHosts.Count(i => i.IsEnabled) > 0); return user.Policy.EnableLiveTvAccess && (Services.Count > 1 || GetConfiguration().TunerHosts.Count > 0);
} }
public IEnumerable<User> GetEnabledUsers() public IEnumerable<User> GetEnabledUsers()
@ -2988,7 +2988,7 @@ namespace Emby.Server.Implementations.LiveTv
if (string.Equals(feature, "dvr-l", StringComparison.OrdinalIgnoreCase)) if (string.Equals(feature, "dvr-l", StringComparison.OrdinalIgnoreCase))
{ {
var config = GetConfiguration(); var config = GetConfiguration();
if (config.TunerHosts.Count(i => i.IsEnabled) > 0 && if (config.TunerHosts.Count > 0 &&
config.ListingProviders.Count(i => (i.EnableAllTuners || i.EnabledTuners.Length > 0) && string.Equals(i.Type, SchedulesDirect.TypeName, StringComparison.OrdinalIgnoreCase)) > 0) config.ListingProviders.Count(i => (i.EnableAllTuners || i.EnabledTuners.Length > 0) && string.Equals(i.Type, SchedulesDirect.TypeName, StringComparison.OrdinalIgnoreCase)) > 0)
{ {
return Task.FromResult(new MBRegistrationRecord return Task.FromResult(new MBRegistrationRecord

View File

@ -62,7 +62,7 @@ namespace Emby.Server.Implementations.LiveTv
public bool IsHidden public bool IsHidden
{ {
get { return _liveTvManager.Services.Count == 1 && GetConfiguration().TunerHosts.Count(i => i.IsEnabled) == 0; } get { return _liveTvManager.Services.Count == 1 && GetConfiguration().TunerHosts.Count == 0; }
} }
public bool IsEnabled public bool IsEnabled

View File

@ -69,7 +69,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
protected virtual List<TunerHostInfo> GetTunerHosts() protected virtual List<TunerHostInfo> GetTunerHosts()
{ {
return GetConfiguration().TunerHosts return GetConfiguration().TunerHosts
.Where(i => i.IsEnabled && string.Equals(i.Type, Type, StringComparison.OrdinalIgnoreCase)) .Where(i => string.Equals(i.Type, Type, StringComparison.OrdinalIgnoreCase))
.ToList(); .ToList();
} }

View File

@ -215,7 +215,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
var list = new List<LiveTvTunerInfo>(); var list = new List<LiveTvTunerInfo>();
foreach (var host in GetConfiguration().TunerHosts foreach (var host in GetConfiguration().TunerHosts
.Where(i => i.IsEnabled && string.Equals(i.Type, Type, StringComparison.OrdinalIgnoreCase))) .Where(i => string.Equals(i.Type, Type, StringComparison.OrdinalIgnoreCase)))
{ {
try try
{ {
@ -605,11 +605,6 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
public async Task Validate(TunerHostInfo info) public async Task Validate(TunerHostInfo info)
{ {
if (!info.IsEnabled)
{
return;
}
lock (_modelCache) lock (_modelCache)
{ {
_modelCache.Clear(); _modelCache.Clear();

View File

@ -188,7 +188,6 @@ namespace MediaBrowser.Api
// Add tuner // Add tuner
await _liveTvManager.SaveTunerHost(new TunerHostInfo await _liveTvManager.SaveTunerHost(new TunerHostInfo
{ {
IsEnabled = true,
Type = request.LiveTvTunerType, Type = request.LiveTvTunerType,
Url = request.LiveTvTunerPath Url = request.LiveTvTunerPath

View File

@ -48,12 +48,10 @@ namespace MediaBrowser.Model.LiveTv
public string DeviceId { get; set; } public string DeviceId { get; set; }
public bool ImportFavoritesOnly { get; set; } public bool ImportFavoritesOnly { get; set; }
public bool AllowHWTranscoding { get; set; } public bool AllowHWTranscoding { get; set; }
public bool IsEnabled { get; set; }
public bool EnableTvgId { get; set; } public bool EnableTvgId { get; set; }
public TunerHostInfo() public TunerHostInfo()
{ {
IsEnabled = true;
AllowHWTranscoding = true; AllowHWTranscoding = true;
} }
} }