mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-01 03:42:51 +01:00
Merge pull request #1090 from redSpoutnik/subtitle-display-title
Set DisplayTitle for subtitles
This commit is contained in:
@@ -770,7 +770,7 @@ namespace Emby.Server.Implementations
|
||||
var displayPreferencesRepo = new SqliteDisplayPreferencesRepository(LoggerFactory, JsonSerializer, ApplicationPaths, FileSystemManager);
|
||||
serviceCollection.AddSingleton<IDisplayPreferencesRepository>(displayPreferencesRepo);
|
||||
|
||||
ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory);
|
||||
ItemRepository = new SqliteItemRepository(ServerConfigurationManager, this, JsonSerializer, LoggerFactory, LocalizationManager);
|
||||
serviceCollection.AddSingleton<IItemRepository>(ItemRepository);
|
||||
|
||||
AuthenticationRepository = GetAuthenticationRepository();
|
||||
@@ -870,7 +870,8 @@ namespace Emby.Server.Implementations
|
||||
() => SubtitleEncoder,
|
||||
() => MediaSourceManager,
|
||||
ProcessFactory,
|
||||
5000);
|
||||
5000,
|
||||
LocalizationManager);
|
||||
serviceCollection.AddSingleton(MediaEncoder);
|
||||
|
||||
EncodingManager = new MediaEncoder.EncodingManager(FileSystemManager, LoggerFactory, MediaEncoder, ChapterManager, LibraryManager);
|
||||
|
||||
@@ -22,6 +22,7 @@ using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Controller.Playlists;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
using MediaBrowser.Model.LiveTv;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
@@ -55,6 +56,8 @@ namespace Emby.Server.Implementations.Data
|
||||
private readonly IServerConfigurationManager _config;
|
||||
private IServerApplicationHost _appHost;
|
||||
|
||||
private readonly ILocalizationManager _localization;
|
||||
|
||||
public IImageProcessor ImageProcessor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -64,7 +67,8 @@ namespace Emby.Server.Implementations.Data
|
||||
IServerConfigurationManager config,
|
||||
IServerApplicationHost appHost,
|
||||
IJsonSerializer jsonSerializer,
|
||||
ILoggerFactory loggerFactory)
|
||||
ILoggerFactory loggerFactory,
|
||||
ILocalizationManager localization)
|
||||
: base(loggerFactory.CreateLogger(nameof(SqliteItemRepository)))
|
||||
{
|
||||
if (config == null)
|
||||
@@ -81,6 +85,7 @@ namespace Emby.Server.Implementations.Data
|
||||
_config = config;
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_typeMapper = new TypeMapper();
|
||||
_localization = localization;
|
||||
|
||||
DbFilePath = Path.Combine(_config.ApplicationPaths.DataPath, "library.db");
|
||||
}
|
||||
@@ -6187,6 +6192,12 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
item.ColorTransfer = reader[34].ToString();
|
||||
}
|
||||
|
||||
if (item.Type == MediaStreamType.Subtitle){
|
||||
item.localizedUndefined = _localization.GetLocalizedString("Undefined");
|
||||
item.localizedDefault = _localization.GetLocalizedString("Default");
|
||||
item.localizedForced = _localization.GetLocalizedString("Forced");
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user