added default padding settings

This commit is contained in:
Luke Pulverenti 2015-08-23 22:08:20 -04:00
parent 733acb1966
commit 474cbbb87a
8 changed files with 33 additions and 12 deletions

View File

@ -11,7 +11,10 @@ namespace MediaBrowser.Model.LiveTv
public List<TunerHostInfo> TunerHosts { get; set; }
public List<ListingsProviderInfo> ListingProviders { get; set; }
public int PrePaddingSeconds { get; set; }
public int PostPaddingSeconds { get; set; }
public LiveTvOptions()
{
EnableMovieProviders = true;

View File

@ -937,7 +937,7 @@ namespace MediaBrowser.Server.Implementations.Library
(item as MusicArtist).IsAccessedByName = true;
}
var task = item.UpdateToRepository(ItemUpdateType.None, CancellationToken.None);
var task = CreateItem(item, CancellationToken.None);
Task.WaitAll(task);
}

View File

@ -483,7 +483,10 @@ namespace MediaBrowser.Server.Implementations.Library
var provider = _providers.FirstOrDefault(i => string.Equals(i.GetType().FullName.GetMD5().ToString("N"), keys[0], StringComparison.OrdinalIgnoreCase));
return new Tuple<IMediaSourceProvider, string>(provider, keys[1]);
var splitIndex = key.IndexOf(LiveStreamIdDelimeter);
var keyId = key.Substring(splitIndex + 1);
return new Tuple<IMediaSourceProvider, string>(provider, keyId);
}
private Timer _closeTimer;

View File

@ -339,10 +339,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
public Task<SeriesTimerInfo> GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null)
{
var config = GetConfiguration();
var defaults = new SeriesTimerInfo()
{
PostPaddingSeconds = 0,
PrePaddingSeconds = 0,
PostPaddingSeconds = Math.Max(config.PostPaddingSeconds, 0),
PrePaddingSeconds = Math.Max(config.PrePaddingSeconds, 0),
RecordAnyChannel = false,
RecordAnyTime = false,
RecordNewOnly = false

View File

@ -889,8 +889,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (query.Limit.HasValue)
{
programs = programs.Take(query.Limit.Value)
.OrderBy(i => i.StartDate);
programs = programs.Take(query.Limit.Value);
}
programList = programs.ToList();

View File

@ -125,7 +125,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
const bool isAudio = false;
var keys = openToken.Split(new[] { StreamIdDelimeter }, 3);
var mediaSourceId = keys.Length >= 3 ? keys[2] : null;
string mediaSourceId = null;
if (keys.Length >= 3)
{
mediaSourceId = openToken.Substring(keys[0].Length + keys[1].Length + 2);
}
if (string.Equals(keys[0], typeof(LiveTvChannel).Name, StringComparison.OrdinalIgnoreCase))
{

View File

@ -22,7 +22,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
private readonly IHttpClient _httpClient;
private readonly IJsonSerializer _jsonSerializer;
public HdHomerunHost(IConfigurationManager config, ILogger logger, IHttpClient httpClient, IJsonSerializer jsonSerializer) : base(config, logger)
public HdHomerunHost(IConfigurationManager config, ILogger logger, IHttpClient httpClient, IJsonSerializer jsonSerializer)
: base(config, logger)
{
_httpClient = httpClient;
_jsonSerializer = jsonSerializer;
@ -166,6 +167,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
{
var url = info.Url;
if (string.IsNullOrWhiteSpace(url))
{
throw new ArgumentException("Invalid tuner info");
}
if (!url.StartsWith("http", StringComparison.OrdinalIgnoreCase))
{
url = "http://" + url;
@ -382,7 +388,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
public async Task Validate(TunerHostInfo info)
{
await GetChannels(info, false, CancellationToken.None).ConfigureAwait(false);
if (info.IsEnabled)
{
await GetChannels(info, false, CancellationToken.None).ConfigureAwait(false);
}
}
protected override async Task<bool> IsAvailableInternal(TunerHostInfo tuner, string channelId, CancellationToken cancellationToken)

View File

@ -1,4 +1,4 @@
using System.Reflection;
//[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyVersion("3.0.5713.0")]
[assembly: AssemblyVersion("3.0.*")]
//[assembly: AssemblyVersion("3.0.5713.0")]