add stream loop option for m3u

This commit is contained in:
Luke Pulverenti 2017-06-24 14:32:22 -04:00
parent f57dfc6a61
commit 6b2445aa2c
4 changed files with 14 additions and 10 deletions

View File

@ -4297,12 +4297,9 @@ namespace Emby.Server.Implementations.Data
}
}
if (query.HasDeadParentId.HasValue)
if (query.HasDeadParentId.HasValue && query.HasDeadParentId.Value)
{
if (query.HasDeadParentId.Value)
{
whereClauses.Add("ParentId NOT NULL AND ParentId NOT IN (select guid from TypedBaseItems)");
}
whereClauses.Add("ParentId NOT NULL AND ParentId NOT IN (select guid from TypedBaseItems)");
}
if (query.Years.Length == 1)

View File

@ -49,8 +49,13 @@ namespace Emby.Server.Implementations.LiveTv.Listings
get { return "xmltv"; }
}
private string GetLanguage()
private string GetLanguage(ListingsProviderInfo info)
{
if (!string.IsNullOrWhiteSpace(info.PreferredLanguage))
{
return info.PreferredLanguage;
}
return _config.Configuration.PreferredMetadataLanguage;
}
@ -152,7 +157,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
_logger.Debug("Getting xmltv programs for channel {0}", channelId);
var path = await GetXml(info.Path, cancellationToken).ConfigureAwait(false);
var reader = new XmlTvReader(path, GetLanguage());
var reader = new XmlTvReader(path, GetLanguage(info));
var results = reader.GetProgrammes(channelId, startDateUtc, endDateUtc, cancellationToken);
return results.Select(p => GetProgramInfo(p, info));
@ -254,7 +259,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{
// In theory this should never be called because there is always only one lineup
var path = await GetXml(info.Path, CancellationToken.None).ConfigureAwait(false);
var reader = new XmlTvReader(path, GetLanguage());
var reader = new XmlTvReader(path, GetLanguage(info));
var results = reader.GetChannels();
// Should this method be async?
@ -265,7 +270,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{
// In theory this should never be called because there is always only one lineup
var path = await GetXml(info.Path, cancellationToken).ConfigureAwait(false);
var reader = new XmlTvReader(path, GetLanguage());
var reader = new XmlTvReader(path, GetLanguage(info));
var results = reader.GetChannels();
// Should this method be async?

View File

@ -148,7 +148,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
},
RequiresOpening = true,
RequiresClosing = true,
RequiresLooping = true,
RequiresLooping = info.EnableStreamLooping,
ReadAtNativeFramerate = false,

View File

@ -47,6 +47,7 @@ namespace MediaBrowser.Model.LiveTv
public bool ImportFavoritesOnly { get; set; }
public bool AllowHWTranscoding { get; set; }
public bool EnableTvgId { get; set; }
public bool EnableStreamLooping { get; set; }
public TunerHostInfo()
{
@ -74,6 +75,7 @@ namespace MediaBrowser.Model.LiveTv
public NameValuePair[] ChannelMappings { get; set; }
public string MoviePrefix { get; set; }
public bool EnableNewProgramIds { get; set; }
public string PreferredLanguage { get; set; }
public ListingsProviderInfo()
{