Merge pull request #2183 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-09-21 13:14:11 -04:00 committed by GitHub
commit 22fa3eca16
6 changed files with 56 additions and 30 deletions

View File

@ -367,6 +367,8 @@ namespace MediaBrowser.Api.Playback
{ {
param += " -crf 23"; param += " -crf 23";
} }
param += " -tune zerolatency";
} }
else if (string.Equals(videoEncoder, "libx265", StringComparison.OrdinalIgnoreCase)) else if (string.Equals(videoEncoder, "libx265", StringComparison.OrdinalIgnoreCase))
@ -1232,7 +1234,7 @@ namespace MediaBrowser.Api.Playback
private void StartThrottler(StreamState state, TranscodingJob transcodingJob) private void StartThrottler(StreamState state, TranscodingJob transcodingJob)
{ {
if (EnableThrottling(state) && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) if (EnableThrottling(state))
{ {
transcodingJob.TranscodingThrottler = state.TranscodingThrottler = new TranscodingThrottler(transcodingJob, Logger, ServerConfigurationManager); transcodingJob.TranscodingThrottler = state.TranscodingThrottler = new TranscodingThrottler(transcodingJob, Logger, ServerConfigurationManager);
state.TranscodingThrottler.Start(); state.TranscodingThrottler.Start();

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities namespace MediaBrowser.Controller.Entities
{ {
@ -62,5 +63,6 @@ namespace MediaBrowser.Controller.Entities
int? GetInheritedParentalRatingValue(); int? GetInheritedParentalRatingValue();
int InheritedParentalRatingValue { get; set; } int InheritedParentalRatingValue { get; set; }
List<string> GetInheritedTags();
} }
} }

View File

@ -108,11 +108,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
{ {
get get
{ {
if (_hasExternalEncoder)
{
return "External";
}
if (string.IsNullOrWhiteSpace(FFMpegPath)) if (string.IsNullOrWhiteSpace(FFMpegPath))
{ {
return null; return null;
@ -177,12 +172,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
{ {
ConfigureEncoderPaths(); ConfigureEncoderPaths();
if (_hasExternalEncoder)
{
LogPaths();
return;
}
// If the path was passed in, save it into config now. // If the path was passed in, save it into config now.
var encodingOptions = GetEncodingOptions(); var encodingOptions = GetEncodingOptions();
var appPath = encodingOptions.EncoderAppPath; var appPath = encodingOptions.EncoderAppPath;
@ -207,11 +196,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
public async Task UpdateEncoderPath(string path, string pathType) public async Task UpdateEncoderPath(string path, string pathType)
{ {
if (_hasExternalEncoder)
{
return;
}
Tuple<string, string> newPaths; Tuple<string, string> newPaths;
if (string.Equals(pathType, "system", StringComparison.OrdinalIgnoreCase)) if (string.Equals(pathType, "system", StringComparison.OrdinalIgnoreCase))
@ -256,11 +240,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
private void ConfigureEncoderPaths() private void ConfigureEncoderPaths()
{ {
if (_hasExternalEncoder)
{
return;
}
var appPath = GetEncodingOptions().EncoderAppPath; var appPath = GetEncodingOptions().EncoderAppPath;
if (string.IsNullOrWhiteSpace(appPath)) if (string.IsNullOrWhiteSpace(appPath))

View File

@ -843,6 +843,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
if (recordingEndDate <= DateTime.UtcNow) if (recordingEndDate <= DateTime.UtcNow)
{ {
_logger.Warn("Recording timer fired for timer {0}, Id: {1}, but the program has already ended.", timer.Name, timer.Id); _logger.Warn("Recording timer fired for timer {0}, Id: {1}, but the program has already ended.", timer.Name, timer.Id);
_timerProvider.Delete(timer);
return; return;
} }
@ -1273,6 +1274,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
writer.WriteElementString("rating", timer.CommunityRating.Value.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("rating", timer.CommunityRating.Value.ToString(CultureInfo.InvariantCulture));
} }
if (timer.IsSports)
{
AddGenre(timer.Genres, "Sports");
}
if (timer.IsKids)
{
AddGenre(timer.Genres, "Kids");
}
foreach (var genre in timer.Genres) foreach (var genre in timer.Genres)
{ {
writer.WriteElementString("genre", genre); writer.WriteElementString("genre", genre);
@ -1294,6 +1304,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
} }
} }
private void AddGenre(List<string> genres, string genre)
{
if (!genres.Contains(genre, StringComparer.OrdinalIgnoreCase))
{
genres.Add(genre);
}
}
private ProgramInfo GetProgramInfoFromCache(string channelId, string programId) private ProgramInfo GetProgramInfoFromCache(string channelId, string programId)
{ {
var epgData = GetEpgDataForChannel(channelId); var epgData = GetEpgDataForChannel(channelId);

View File

@ -339,13 +339,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
channelNumber = channelNumber.TrimStart('0'); channelNumber = channelNumber.TrimStart('0');
_logger.Debug("Found channel: " + channelNumber + " in Schedules Direct"); _logger.Debug("Found channel: " + channelNumber + " in Schedules Direct");
if (root.stations != null)
var schChannel = (root.stations ?? new List<ScheduleDirect.Station>()).FirstOrDefault(item => string.Equals(item.stationID, map.stationID, StringComparison.OrdinalIgnoreCase));
if (schChannel != null)
{ {
var schChannel = root.stations.FirstOrDefault(item => string.Equals(item.stationID, map.stationID, StringComparison.OrdinalIgnoreCase)); AddToChannelPairCache(listingsId, channelNumber, schChannel);
if (schChannel != null) }
else
{
AddToChannelPairCache(listingsId, channelNumber, new ScheduleDirect.Station
{ {
AddToChannelPairCache(listingsId, channelNumber, schChannel); stationID = map.stationID
} });
} }
} }
_logger.Info("Added " + GetChannelPairCacheCount(listingsId) + " channels to the dictionary"); _logger.Info("Added " + GetChannelPairCacheCount(listingsId) + " channels to the dictionary");
@ -361,8 +366,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
channel.ImageUrl = station.logo.URL; channel.ImageUrl = station.logo.URL;
channel.HasImage = true; channel.HasImage = true;
} }
string channelName = station.name;
channel.Name = channelName; if (!string.IsNullOrWhiteSpace(station.name))
{
channel.Name = station.name;
}
} }
else else
{ {
@ -993,7 +1001,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
var name = channelNumber; var name = channelNumber;
var station = GetStation(listingsId, channelNumber, null); var station = GetStation(listingsId, channelNumber, null);
if (station != null) if (station != null && !string.IsNullOrWhiteSpace(station.name))
{ {
name = station.name; name = station.name;
} }

View File

@ -870,6 +870,23 @@ namespace MediaBrowser.Server.Startup.Common
{ {
CertificatePath = GetCertificatePath(true); CertificatePath = GetCertificatePath(true);
try
{
ServerManager.Start(GetUrlPrefixes(), CertificatePath);
return;
}
catch (Exception ex)
{
Logger.ErrorException("Error starting http server", ex);
if (HttpPort == 8096)
{
throw;
}
}
HttpPort = 8096;
try try
{ {
ServerManager.Start(GetUrlPrefixes(), CertificatePath); ServerManager.Start(GetUrlPrefixes(), CertificatePath);