mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-06 18:26:33 +00:00
Change subtitles DisplayTitle behavior
This commit is contained in:
@@ -19,6 +19,7 @@ using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Diagnostics;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
@@ -69,6 +70,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
private readonly string _originalFFMpegPath;
|
||||
private readonly string _originalFFProbePath;
|
||||
private readonly int DefaultImageExtractionTimeoutMs;
|
||||
private readonly ILocalizationManager _localization;
|
||||
|
||||
public MediaEncoder(
|
||||
ILoggerFactory loggerFactory,
|
||||
@@ -88,7 +90,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
IHttpClient httpClient,
|
||||
IZipClient zipClient,
|
||||
IProcessFactory processFactory,
|
||||
int defaultImageExtractionTimeoutMs)
|
||||
int defaultImageExtractionTimeoutMs,
|
||||
ILocalizationManager localization)
|
||||
{
|
||||
_logger = loggerFactory.CreateLogger(nameof(MediaEncoder));
|
||||
_jsonSerializer = jsonSerializer;
|
||||
@@ -110,6 +113,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
_originalFFProbePath = ffProbePath;
|
||||
_originalFFMpegPath = ffMpegPath;
|
||||
_hasExternalEncoder = hasExternalEncoder;
|
||||
_localization = localization;
|
||||
}
|
||||
|
||||
public string EncoderLocationType
|
||||
@@ -537,7 +541,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
}
|
||||
|
||||
return new ProbeResultNormalizer(_logger, FileSystem).GetMediaInfo(result, videoType, isAudio, primaryPath, protocol);
|
||||
return new ProbeResultNormalizer(_logger, FileSystem, _localization).GetMediaInfo(result, videoType, isAudio, primaryPath, protocol);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -20,11 +21,13 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||
private readonly ILogger _logger;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ILocalizationManager _localization;
|
||||
|
||||
public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem)
|
||||
public ProbeResultNormalizer(ILogger logger, IFileSystem fileSystem, ILocalizationManager localization)
|
||||
{
|
||||
_logger = logger;
|
||||
_fileSystem = fileSystem;
|
||||
_localization = localization;
|
||||
}
|
||||
|
||||
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType? videoType, bool isAudio, string path, MediaProtocol protocol)
|
||||
@@ -599,6 +602,9 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
{
|
||||
stream.Type = MediaStreamType.Subtitle;
|
||||
stream.Codec = NormalizeSubtitleCodec(stream.Codec);
|
||||
stream.localizedUndefined = _localization.GetLocalizedString("Undefined");
|
||||
stream.localizedDefault = _localization.GetLocalizedString("Default");
|
||||
stream.localizedForced = _localization.GetLocalizedString("Forced");
|
||||
}
|
||||
else if (string.Equals(streamInfo.codec_type, "video", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user