aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model')
-rw-r--r--MediaBrowser.Model/Channels/ChannelFeatures.cs13
-rw-r--r--MediaBrowser.Model/Configuration/MetadataPluginType.cs4
-rw-r--r--MediaBrowser.Model/Configuration/TypeOptions.cs16
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs15
-rw-r--r--MediaBrowser.Model/Globalization/ILocalizationManager.cs9
-rw-r--r--MediaBrowser.Model/Querying/QueryFilters.cs11
6 files changed, 53 insertions, 15 deletions
diff --git a/MediaBrowser.Model/Channels/ChannelFeatures.cs b/MediaBrowser.Model/Channels/ChannelFeatures.cs
index 1ca8e80a6f..57803c9765 100644
--- a/MediaBrowser.Model/Channels/ChannelFeatures.cs
+++ b/MediaBrowser.Model/Channels/ChannelFeatures.cs
@@ -1,6 +1,7 @@
#pragma warning disable CS1591
using System;
+using System.Collections.Generic;
namespace MediaBrowser.Model.Channels
{
@@ -8,9 +9,9 @@ namespace MediaBrowser.Model.Channels
{
public ChannelFeatures(string name, Guid id)
{
- MediaTypes = Array.Empty<ChannelMediaType>();
- ContentTypes = Array.Empty<ChannelMediaContentType>();
- DefaultSortFields = Array.Empty<ChannelItemSortField>();
+ MediaTypes = [];
+ ContentTypes = [];
+ DefaultSortFields = [];
Name = name;
Id = id;
@@ -38,13 +39,13 @@ namespace MediaBrowser.Model.Channels
/// Gets or sets the media types.
/// </summary>
/// <value>The media types.</value>
- public ChannelMediaType[] MediaTypes { get; set; }
+ public IReadOnlyList<ChannelMediaType> MediaTypes { get; set; }
/// <summary>
/// Gets or sets the content types.
/// </summary>
/// <value>The content types.</value>
- public ChannelMediaContentType[] ContentTypes { get; set; }
+ public IReadOnlyList<ChannelMediaContentType> ContentTypes { get; set; }
/// <summary>
/// Gets or sets the maximum number of records the channel allows retrieving at a time.
@@ -61,7 +62,7 @@ namespace MediaBrowser.Model.Channels
/// Gets or sets the default sort orders.
/// </summary>
/// <value>The default sort orders.</value>
- public ChannelItemSortField[] DefaultSortFields { get; set; }
+ public IReadOnlyList<ChannelItemSortField> DefaultSortFields { get; set; }
/// <summary>
/// Gets or sets a value indicating whether a sort ascending/descending toggle is supported.
diff --git a/MediaBrowser.Model/Configuration/MetadataPluginType.cs b/MediaBrowser.Model/Configuration/MetadataPluginType.cs
index 670d6e3837..476060ceef 100644
--- a/MediaBrowser.Model/Configuration/MetadataPluginType.cs
+++ b/MediaBrowser.Model/Configuration/MetadataPluginType.cs
@@ -15,6 +15,8 @@ namespace MediaBrowser.Model.Configuration
MetadataSaver,
SubtitleFetcher,
LyricFetcher,
- MediaSegmentProvider
+ MediaSegmentProvider,
+ LocalSimilarityProvider,
+ SimilarityProvider
}
}
diff --git a/MediaBrowser.Model/Configuration/TypeOptions.cs b/MediaBrowser.Model/Configuration/TypeOptions.cs
index d0179e5aab..3aa85034e5 100644
--- a/MediaBrowser.Model/Configuration/TypeOptions.cs
+++ b/MediaBrowser.Model/Configuration/TypeOptions.cs
@@ -304,11 +304,13 @@ namespace MediaBrowser.Model.Configuration
public TypeOptions()
{
- MetadataFetchers = Array.Empty<string>();
- MetadataFetcherOrder = Array.Empty<string>();
- ImageFetchers = Array.Empty<string>();
- ImageFetcherOrder = Array.Empty<string>();
- ImageOptions = Array.Empty<ImageOption>();
+ MetadataFetchers = [];
+ MetadataFetcherOrder = [];
+ ImageFetchers = [];
+ ImageFetcherOrder = [];
+ ImageOptions = [];
+ SimilarItemProviders = [];
+ SimilarItemProviderOrder = [];
}
public string Type { get; set; }
@@ -323,6 +325,10 @@ namespace MediaBrowser.Model.Configuration
public ImageOption[] ImageOptions { get; set; }
+ public string[] SimilarItemProviders { get; set; }
+
+ public string[] SimilarItemProviderOrder { get; set; }
+
public ImageOption GetImageOptions(ImageType type)
{
foreach (var i in ImageOptions)
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index 44697837ca..2ccd2a6c28 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -1451,7 +1451,7 @@ namespace MediaBrowser.Model.Dlna
string? outputContainer,
MediaStreamProtocol? transcodingSubProtocol)
{
- if (!subtitleStream.IsExternal && (playMethod != PlayMethod.Transcode || transcodingSubProtocol != MediaStreamProtocol.hls))
+ if (CanConsiderEmbedSubtitle(subtitleStream, playMethod, transcodingSubProtocol, outputContainer))
{
// Look for supported embedded subs of the same format
foreach (var profile in subtitleProfiles)
@@ -1540,6 +1540,19 @@ namespace MediaBrowser.Model.Dlna
return false;
}
+ private static bool CanConsiderEmbedSubtitle(MediaStream subtitleStream, PlayMethod playMethod, MediaStreamProtocol? transcodingSubProtocol, string? outputContainer)
+ {
+ if (subtitleStream.IsExternal)
+ {
+ return playMethod == PlayMethod.Transcode
+ && transcodingSubProtocol != MediaStreamProtocol.hls
+ && IsSubtitleEmbedSupported(outputContainer);
+ }
+
+ return playMethod != PlayMethod.Transcode
+ || transcodingSubProtocol != MediaStreamProtocol.hls;
+ }
+
private static SubtitleProfile? GetExternalSubtitleProfile(MediaSourceInfo mediaSource, MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, ITranscoderSupport transcoderSupport, bool allowConversion)
{
foreach (var profile in subtitleProfiles)
diff --git a/MediaBrowser.Model/Globalization/ILocalizationManager.cs b/MediaBrowser.Model/Globalization/ILocalizationManager.cs
index f6e65028e4..7ad240abfb 100644
--- a/MediaBrowser.Model/Globalization/ILocalizationManager.cs
+++ b/MediaBrowser.Model/Globalization/ILocalizationManager.cs
@@ -51,6 +51,15 @@ public interface ILocalizationManager
string GetLocalizedString(string phrase);
/// <summary>
+ /// Gets the localized string using the server's configured UICulture,
+ /// ignoring the current request's culture. Use this for data that is
+ /// persisted (e.g. activity log entries) rather than returned per-request.
+ /// </summary>
+ /// <param name="phrase">The phrase.</param>
+ /// <returns>System.String.</returns>
+ string GetServerLocalizedString(string phrase);
+
+ /// <summary>
/// Gets the localization options.
/// </summary>
/// <returns><see cref="IEnumerable{LocalizationOption}" />.</returns>
diff --git a/MediaBrowser.Model/Querying/QueryFilters.cs b/MediaBrowser.Model/Querying/QueryFilters.cs
index 73b27a7b06..095f460923 100644
--- a/MediaBrowser.Model/Querying/QueryFilters.cs
+++ b/MediaBrowser.Model/Querying/QueryFilters.cs
@@ -2,6 +2,7 @@
#pragma warning disable CS1591
using System;
+using System.Collections.Generic;
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Model.Querying
@@ -12,10 +13,16 @@ namespace MediaBrowser.Model.Querying
{
Tags = Array.Empty<string>();
Genres = Array.Empty<NameGuidPair>();
+ AudioLanguages = Array.Empty<NameValuePair>();
+ SubtitleLanguages = Array.Empty<NameValuePair>();
}
- public NameGuidPair[] Genres { get; set; }
+ public IReadOnlyList<NameGuidPair> Genres { get; set; }
- public string[] Tags { get; set; }
+ public IReadOnlyList<string> Tags { get; set; }
+
+ public IReadOnlyList<NameValuePair> AudioLanguages { get; set; }
+
+ public IReadOnlyList<NameValuePair> SubtitleLanguages { get; set; }
}
}