Merge branch 'dev' into code-cleanup

This commit is contained in:
Erwin de Haan
2019-01-11 12:50:36 +01:00
345 changed files with 2991 additions and 3236 deletions

View File

@@ -46,7 +46,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
private readonly ILogger _logger;
private readonly IMediaSourceManager _mediaSourceManager;
public EncodingJob(ILogger logger, IMediaSourceManager mediaSourceManager) :
public EncodingJob(ILogger logger, IMediaSourceManager mediaSourceManager) :
base(logger, mediaSourceManager, TranscodingJobType.Progressive)
{
_logger = logger;

View File

@@ -25,7 +25,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
private readonly IMediaEncoder _mediaEncoder;
protected static readonly CultureInfo UsCulture = new CultureInfo("en-US");
public EncodingJobFactory(ILogger logger, ILibraryManager libraryManager, IMediaSourceManager mediaSourceManager, IConfigurationManager config, IMediaEncoder mediaEncoder)
{
_logger = logger;
@@ -255,7 +255,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
if (profile == null)
{
// Don't use settings from the default profile.
// Don't use settings from the default profile.
// Only use a specific profile if it was requested.
return;
}

View File

@@ -149,7 +149,7 @@ namespace MediaBrowser.MediaEncoding.Probing
/// </summary>
/// <value>The bits_per_raw_sample.</value>
public int bits_per_raw_sample { get; set; }
/// <summary>
/// Gets or sets the r_frame_rate.
/// </summary>

View File

@@ -132,7 +132,7 @@ namespace MediaBrowser.MediaEncoding.Probing
if (!string.IsNullOrWhiteSpace(iTunEXTC))
{
var parts = iTunEXTC.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
// Example
// Example
// mpaa|G|100|For crude humor
if (parts.Length > 1)
{
@@ -423,7 +423,7 @@ namespace MediaBrowser.MediaEncoding.Probing
Type = PersonType.Writer
});
}
}
else if (string.Equals(key, "producers", StringComparison.OrdinalIgnoreCase))
{
@@ -619,7 +619,7 @@ namespace MediaBrowser.MediaEncoding.Probing
else if (string.Equals(stream.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase))
{
// How to differentiate between video and embedded image?
// The only difference I've seen thus far is presence of codec tag, also embedded images have high (unusual) framerates
// The only difference I've seen thus far is presence of codec tag, also embedded images have high (unusual) framerates
if (!string.IsNullOrWhiteSpace(stream.CodecTag))
{
stream.Type = MediaStreamType.Video;
@@ -1054,7 +1054,7 @@ namespace MediaBrowser.MediaEncoding.Probing
/// <returns>System.String[][].</returns>
private IEnumerable<string> Split(string val, bool allowCommaDelimiter)
{
// Only use the comma as a delimeter if there are no slashes or pipes.
// Only use the comma as a delimeter if there are no slashes or pipes.
// We want to be careful not to split names that have commas in them
var delimeter = !allowCommaDelimiter || _nameDelimiters.Any(i => val.IndexOf(i) != -1) ?
_nameDelimiters :

View File

@@ -2,7 +2,7 @@ using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MediaBrowser.MediaEncoding")]

View File

@@ -29,7 +29,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
while ((line = reader.ReadLine()) != null)
{
cancellationToken.ThrowIfCancellationRequested();
if (string.IsNullOrWhiteSpace(line))
{
continue;
@@ -49,7 +49,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
RemoteNativeFormatting(subEvent);
subEvent.Text = subEvent.Text.Replace("\\n", ParserValues.NewLine, StringComparison.OrdinalIgnoreCase);
subEvent.Text = Regex.Replace(subEvent.Text, @"\{(\\[\w]+\(?([\w\d]+,?)+\)?)+\}", string.Empty, RegexOptions.IgnoreCase);
trackEvents.Add(subEvent);

View File

@@ -46,7 +46,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
_config.NamedConfigurationUpdating += _config_NamedConfigurationUpdating;
Utilities.HttpClient = httpClient;
OpenSubtitles.SetUserAgent("mediabrowser.tv");
OpenSubtitles.SetUserAgent("jellyfin");
}
private const string PasswordHashPrefix = "h:";

View File

@@ -43,7 +43,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
continue;
}
var time = Regex.Split(line, @"[\t ]*-->[\t ]*");
if (time.Length < 2)
@@ -85,7 +85,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
TimeSpan span;
return TimeSpan.TryParseExact(time, @"hh\:mm\:ss\.fff", _usCulture, out span)
? span.Ticks
: (TimeSpan.TryParseExact(time, @"hh\:mm\:ss\,fff", _usCulture, out span)
: (TimeSpan.TryParseExact(time, @"hh\:mm\:ss\,fff", _usCulture, out span)
? span.Ticks : 0);
}
}

View File

@@ -129,8 +129,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
}
}
}
//if (header.Length > 0)
//subtitle.Header = header.ToString();

View File

@@ -45,7 +45,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
writer.WriteLine("</div>");
writer.WriteLine("</body>");
writer.WriteLine("</tt>");
}
}