rework tuner setup

This commit is contained in:
Luke Pulverenti
2017-03-13 14:57:45 -04:00
parent 2ff7608b7a
commit a8fc480489
6 changed files with 36 additions and 158 deletions

View File

@@ -2553,7 +2553,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
private async Task ScanForTunerDeviceChanges(ITunerHost host, CancellationToken cancellationToken)
{
var discoveredDevices = await DiscoverDevices(host, 2000, cancellationToken).ConfigureAwait(false);
var discoveredDevices = await DiscoverDevices(host, 3000, cancellationToken).ConfigureAwait(false);
var configuredDevices = GetConfiguration().TunerHosts
.Where(i => string.Equals(i.Type, host.Type, StringComparison.OrdinalIgnoreCase))

View File

@@ -150,6 +150,16 @@ namespace Emby.Server.Implementations.LiveTv
get { return _listingProviders; }
}
public List<NameIdPair> GetTunerHostTypes()
{
return _tunerHosts.OrderBy(i => i.Name).Select(i => new NameIdPair
{
Name = i.Name,
Id = i.Type
}).ToList();
}
void service_DataSourceChanged(object sender, EventArgs e)
{
if (!_isDisposed)
@@ -3002,50 +3012,6 @@ namespace Emby.Server.Implementations.LiveTv
return _security.GetRegistrationStatus(feature);
}
public List<NameValuePair> GetSatIniMappings()
{
return new List<NameValuePair>();
//var names = GetType().Assembly.GetManifestResourceNames().Where(i => i.IndexOf("SatIp.ini", StringComparison.OrdinalIgnoreCase) != -1).ToList();
//return names.Select(GetSatIniMappings).Where(i => i != null).DistinctBy(i => i.Value.Split('|')[0]).ToList();
}
public NameValuePair GetSatIniMappings(string resource)
{
return new NameValuePair();
//using (var stream = GetType().Assembly.GetManifestResourceStream(resource))
//{
// using (var reader = new StreamReader(stream))
// {
// var parser = new StreamIniDataParser();
// IniData data = parser.ReadData(reader);
// var satType1 = data["SATTYPE"]["1"];
// var satType2 = data["SATTYPE"]["2"];
// if (string.IsNullOrWhiteSpace(satType2))
// {
// return null;
// }
// var srch = "SatIp.ini.";
// var filename = Path.GetFileName(resource);
// return new NameValuePair
// {
// Name = satType1 + " " + satType2,
// Value = satType2 + "|" + filename.Substring(filename.IndexOf(srch) + srch.Length)
// };
// }
//}
}
public Task<List<ChannelInfo>> GetSatChannelScanResult(TunerHostInfo info, CancellationToken cancellationToken)
{
return Task.FromResult(new List<ChannelInfo>());
//return new TunerHosts.SatIp.ChannelScan(_logger).Scan(info, cancellationToken);
}
public Task<List<ChannelInfo>> GetChannelsForListingsProvider(string id, CancellationToken cancellationToken)
{
var info = GetConfiguration().ListingProviders.First(i => string.Equals(i.Id, id, StringComparison.OrdinalIgnoreCase));