mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-22 21:50:36 +02:00
grab more sat fields
This commit is contained in:
parent
de871b5d50
commit
e22a1a7857
|
@ -59,6 +59,12 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
/// <value>The clients.</value>
|
/// <value>The clients.</value>
|
||||||
public List<string> Clients { get; set; }
|
public List<string> Clients { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance can reset.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance can reset; otherwise, <c>false</c>.</value>
|
||||||
|
public bool CanReset { get; set; }
|
||||||
|
|
||||||
public LiveTvTunerInfo()
|
public LiveTvTunerInfo()
|
||||||
{
|
{
|
||||||
Clients = new List<string>();
|
Clients = new List<string>();
|
||||||
|
|
|
@ -64,6 +64,12 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
/// <value>The clients.</value>
|
/// <value>The clients.</value>
|
||||||
public List<string> Clients { get; set; }
|
public List<string> Clients { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance can reset.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance can reset; otherwise, <c>false</c>.</value>
|
||||||
|
public bool CanReset { get; set; }
|
||||||
|
|
||||||
public LiveTvTunerInfoDto()
|
public LiveTvTunerInfoDto()
|
||||||
{
|
{
|
||||||
Clients = new List<string>();
|
Clients = new List<string>();
|
||||||
|
|
|
@ -178,7 +178,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
SourceType = info.SourceType,
|
SourceType = info.SourceType,
|
||||||
Status = info.Status,
|
Status = info.Status,
|
||||||
ChannelName = channelName,
|
ChannelName = channelName,
|
||||||
Url = info.Url
|
Url = info.Url,
|
||||||
|
CanReset = info.CanReset
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.ChannelId))
|
if (!string.IsNullOrEmpty(info.ChannelId))
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -195,12 +196,31 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "friendlyName":
|
||||||
|
{
|
||||||
|
info.FriendlyName = reader.ReadElementContentAsString();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case "satip:X_SATIPCAP":
|
case "satip:X_SATIPCAP":
|
||||||
case "X_SATIPCAP":
|
case "X_SATIPCAP":
|
||||||
{
|
{
|
||||||
// <satip:X_SATIPCAP xmlns:satip="urn:ses-com:satip">DVBS2-2</satip:X_SATIPCAP>
|
// <satip:X_SATIPCAP xmlns:satip="urn:ses-com:satip">DVBS2-2</satip:X_SATIPCAP>
|
||||||
var value = reader.ReadElementContentAsString();
|
var value = reader.ReadElementContentAsString() ?? string.Empty;
|
||||||
// TODO
|
var parts = value.Split(new[] { '-' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
if (parts.Length == 2)
|
||||||
|
{
|
||||||
|
int intValue;
|
||||||
|
if (int.TryParse(parts[1], NumberStyles.Any, CultureInfo.InvariantCulture, out intValue))
|
||||||
|
{
|
||||||
|
info.TunersAvailable = intValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (int.TryParse(parts[0].Substring(parts[0].Length - 1), NumberStyles.Any, CultureInfo.InvariantCulture, out intValue))
|
||||||
|
{
|
||||||
|
info.Tuners = intValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,5 +246,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
|
||||||
public int Tuners { get; set; }
|
public int Tuners { get; set; }
|
||||||
public int TunersAvailable { get; set; }
|
public int TunersAvailable { get; set; }
|
||||||
public string M3UUrl { get; set; }
|
public string M3UUrl { get; set; }
|
||||||
|
public string FriendlyName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -140,17 +141,31 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.SatIp
|
||||||
public Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken)
|
public Task<List<LiveTvTunerInfo>> GetTunerInfos(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var list = GetTunerHosts()
|
var list = GetTunerHosts()
|
||||||
.Select(i => new LiveTvTunerInfo()
|
.SelectMany(i => GetTunerInfos(i, cancellationToken))
|
||||||
{
|
|
||||||
Name = Name,
|
|
||||||
SourceType = Type,
|
|
||||||
Status = LiveTvTunerStatus.Available,
|
|
||||||
Id = i.Url.GetMD5().ToString("N"),
|
|
||||||
Url = i.Url
|
|
||||||
})
|
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
return Task.FromResult(list);
|
return Task.FromResult(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<LiveTvTunerInfo> GetTunerInfos(TunerHostInfo info, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var satInfo = (SatIpTunerHostInfo) info;
|
||||||
|
|
||||||
|
var list = new List<LiveTvTunerInfo>();
|
||||||
|
|
||||||
|
for (var i = 0; i < satInfo.Tuners; i++)
|
||||||
|
{
|
||||||
|
list.Add(new LiveTvTunerInfo
|
||||||
|
{
|
||||||
|
Name = satInfo.FriendlyName ?? Name,
|
||||||
|
SourceType = Type,
|
||||||
|
Status = LiveTvTunerStatus.Available,
|
||||||
|
Id = info.Url.GetMD5().ToString("N") + i.ToString(CultureInfo.InvariantCulture),
|
||||||
|
Url = info.Url
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue