From 812841d01ef3d8cdf2f72d4b68bfe80c8b0cd0da Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 9 May 2022 15:24:09 +0200
Subject: Bump StyleCop.Analyzers from 1.2.0-beta.406 to 1.2.0-beta.435 (#7726)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
index 7c70d37a6..92c9fc1a0 100644
--- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
+++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
@@ -40,7 +40,7 @@
runtime; build; native; contentfiles; analyzers
-
+
--
cgit v1.2.3
From efcdab116f85a560c9362185a9e333c3fc9df41d Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Wed, 4 May 2022 08:20:48 -0600
Subject: Merge pull request #7529 from Shadowghost/strm-ffprobe-external-fix
(cherry picked from commit 60affd096595d68728506149d0ffce6e84b6b015)
Signed-off-by: crobibero
---
.../Data/SqliteItemRepository.cs | 6 +--
.../Library/MediaSourceManager.cs | 6 ++-
.../MediaEncoding/EncodingHelper.cs | 54 +++++++++++++++++-----
.../MediaEncoding/IMediaEncoder.cs | 7 +++
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 13 ++++++
.../Subtitles/SubtitleEncoder.cs | 19 ++++++--
.../MediaInfo/FFProbeVideoInfo.cs | 39 ++++++++++++----
7 files changed, 115 insertions(+), 29 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 5729a70ac..cdc14c260 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -5763,7 +5763,7 @@ AND Type = @InternalPersonType)");
{
var itemIdBlob = id.ToByteArray();
- // First delete chapters
+ // Delete existing mediastreams
db.Execute("delete from mediastreams where ItemId=@ItemId", itemIdBlob);
InsertMediaStreams(itemIdBlob, streams, db);
@@ -5867,10 +5867,10 @@ AND Type = @InternalPersonType)");
}
///
- /// Gets the chapter.
+ /// Gets the media stream.
///
/// The reader.
- /// ChapterInfo.
+ /// MediaStream.
private MediaStream GetMediaStream(IReadOnlyList reader)
{
var item = new MediaStream
diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs
index d9a1a5487..c0aef1899 100644
--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs
+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs
@@ -151,7 +151,11 @@ namespace Emby.Server.Implementations.Library
{
var mediaSources = GetStaticMediaSources(item, enablePathSubstitution, user);
- if (allowMediaProbe && mediaSources[0].Type != MediaSourceType.Placeholder && !mediaSources[0].MediaStreams.Any(i => i.Type == MediaStreamType.Audio || i.Type == MediaStreamType.Video))
+ // If file is strm or main media stream is missing, force a metadata refresh with remote probing
+ if (allowMediaProbe && mediaSources[0].Type != MediaSourceType.Placeholder
+ && (item.Path.EndsWith(".strm", StringComparison.OrdinalIgnoreCase)
+ || (item.MediaType == MediaType.Video && !mediaSources[0].MediaStreams.Any(i => i.Type == MediaStreamType.Video))
+ || (item.MediaType == MediaType.Audio && !mediaSources[0].MediaStreams.Any(i => i.Type == MediaStreamType.Audio))))
{
await item.RefreshMetadata(
new MetadataRefreshOptions(_directoryService)
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 006fd8861..1851a9f0c 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -2215,13 +2215,13 @@ namespace MediaBrowser.Controller.MediaEncoding
return state.IsInputVideo ? "-sn" : string.Empty;
}
- // We have media info, but we don't know the stream indexes
+ // We have media info, but we don't know the stream index
if (state.VideoStream != null && state.VideoStream.Index == -1)
{
return "-sn";
}
- // We have media info, but we don't know the stream indexes
+ // We have media info, but we don't know the stream index
if (state.AudioStream != null && state.AudioStream.Index == -1)
{
return state.IsInputVideo ? "-sn" : string.Empty;
@@ -2231,10 +2231,12 @@ namespace MediaBrowser.Controller.MediaEncoding
if (state.VideoStream != null)
{
+ int videoStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.VideoStream);
+
args += string.Format(
CultureInfo.InvariantCulture,
"-map 0:{0}",
- state.VideoStream.Index);
+ videoStreamIndex);
}
else
{
@@ -2244,24 +2246,24 @@ namespace MediaBrowser.Controller.MediaEncoding
if (state.AudioStream != null)
{
+ int audioStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.AudioStream);
if (state.AudioStream.IsExternal)
{
bool hasExternalGraphicsSubs = state.SubtitleStream != null && state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream;
int externalAudioMapIndex = hasExternalGraphicsSubs ? 2 : 1;
- int externalAudioStream = state.MediaSource.MediaStreams.Where(i => i.Path == state.AudioStream.Path).ToList().IndexOf(state.AudioStream);
args += string.Format(
CultureInfo.InvariantCulture,
" -map {0}:{1}",
externalAudioMapIndex,
- externalAudioStream);
+ audioStreamIndex);
}
else
{
args += string.Format(
CultureInfo.InvariantCulture,
" -map 0:{0}",
- state.AudioStream.Index);
+ audioStreamIndex);
}
}
else
@@ -2276,14 +2278,21 @@ namespace MediaBrowser.Controller.MediaEncoding
}
else if (subtitleMethod == SubtitleDeliveryMethod.Embed)
{
+ int subtitleStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.SubtitleStream);
+
args += string.Format(
CultureInfo.InvariantCulture,
" -map 0:{0}",
- state.SubtitleStream.Index);
+ subtitleStreamIndex);
}
else if (state.SubtitleStream.IsExternal && !state.SubtitleStream.IsTextSubtitleStream)
{
- args += " -map 1:0 -sn";
+ int externalSubtitleStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.SubtitleStream);
+
+ args += string.Format(
+ CultureInfo.InvariantCulture,
+ " -map 1:{0} -sn",
+ externalSubtitleStreamIndex);
}
return args;
@@ -4129,9 +4138,8 @@ namespace MediaBrowser.Controller.MediaEncoding
string.Join(',', overlayFilters));
var mapPrefix = Convert.ToInt32(state.SubtitleStream.IsExternal);
- var subtitleStreamIndex = state.SubtitleStream.IsExternal
- ? 0
- : state.SubtitleStream.Index;
+ var subtitleStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.SubtitleStream);
+ var videoStreamIndex = FindIndex(state.MediaSource.MediaStreams, state.VideoStream);
if (hasSubs)
{
@@ -4152,7 +4160,7 @@ namespace MediaBrowser.Controller.MediaEncoding
filterStr,
mapPrefix,
subtitleStreamIndex,
- state.VideoStream.Index,
+ videoStreamIndex,
mainStr,
subStr,
overlayStr);
@@ -5389,6 +5397,28 @@ namespace MediaBrowser.Controller.MediaEncoding
string.Empty).Trim();
}
+ public static int FindIndex(IReadOnlyList mediaStreams, MediaStream streamToFind)
+ {
+ var index = 0;
+ var length = mediaStreams.Count;
+
+ for (var i = 0; i < length; i++)
+ {
+ var currentMediaStream = mediaStreams[i];
+ if (currentMediaStream == streamToFind)
+ {
+ return index;
+ }
+
+ if (string.Equals(currentMediaStream.Path, streamToFind.Path, StringComparison.Ordinal))
+ {
+ index++;
+ }
+ }
+
+ return -1;
+ }
+
public static bool IsCopyCodec(string codec)
{
return string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase);
diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
index 6bf3e7b46..dae30cd8b 100644
--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
@@ -141,6 +141,13 @@ namespace MediaBrowser.Controller.MediaEncoding
/// System.String.
string GetInputArgument(string inputFile, MediaSourceInfo mediaSource);
+ ///
+ /// Gets the input argument for an external subtitle file.
+ ///
+ /// The input file.
+ /// System.String.
+ string GetExternalSubtitleInputArgument(string inputFile);
+
///
/// Gets the time parameter.
///
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index c796ee780..1bac4b187 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -411,6 +411,19 @@ namespace MediaBrowser.MediaEncoding.Encoder
return EncodingUtils.GetInputArgument(prefix, inputFile, mediaSource.Protocol);
}
+ ///
+ /// Gets the input argument for an external subtitle file.
+ ///
+ /// The input file.
+ /// System.String.
+ /// Unrecognized InputType.
+ public string GetExternalSubtitleInputArgument(string inputFile)
+ {
+ const string Prefix = "file";
+
+ return EncodingUtils.GetInputArgument(Prefix, inputFile, MediaProtocol.File);
+ }
+
///
/// Gets the media info internal.
///
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index f4842d368..f6b7efb1e 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -195,7 +195,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
MediaStream subtitleStream,
CancellationToken cancellationToken)
{
- if (!subtitleStream.IsExternal)
+ if (!subtitleStream.IsExternal || subtitleStream.Path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase))
{
string outputFormat;
string outputCodec;
@@ -224,7 +224,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
// Extract
var outputPath = GetSubtitleCachePath(mediaSource, subtitleStream.Index, "." + outputFormat);
- await ExtractTextSubtitle(mediaSource, subtitleStream.Index, outputCodec, outputPath, cancellationToken)
+ await ExtractTextSubtitle(mediaSource, subtitleStream, outputCodec, outputPath, cancellationToken)
.ConfigureAwait(false);
return new SubtitleInfo(outputPath, MediaProtocol.File, outputFormat, false);
@@ -494,7 +494,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
/// Extracts the text subtitle.
///
/// The mediaSource.
- /// Index of the subtitle stream.
+ /// The subtitle stream.
/// The output codec.
/// The output path.
/// The cancellation token.
@@ -502,7 +502,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
/// Must use inputPath list overload.
private async Task ExtractTextSubtitle(
MediaSourceInfo mediaSource,
- int subtitleStreamIndex,
+ MediaStream subtitleStream,
string outputCodec,
string outputPath,
CancellationToken cancellationToken)
@@ -511,12 +511,21 @@ namespace MediaBrowser.MediaEncoding.Subtitles
await semaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
+ var subtitleStreamIndex = EncodingHelper.FindIndex(mediaSource.MediaStreams, subtitleStream);
+
try
{
if (!File.Exists(outputPath))
{
+ var args = _mediaEncoder.GetInputArgument(mediaSource.Path, mediaSource);
+
+ if (subtitleStream.IsExternal)
+ {
+ args = _mediaEncoder.GetExternalSubtitleInputArgument(subtitleStream.Path);
+ }
+
await ExtractTextSubtitleInternal(
- _mediaEncoder.GetInputArgument(mediaSource.Path, mediaSource),
+ args,
subtitleStreamIndex,
outputCodec,
outputPath,
diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
index 4a289b3ab..8c08ab30e 100644
--- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
+++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs
@@ -173,16 +173,30 @@ namespace MediaBrowser.Providers.MediaInfo
IReadOnlyList mediaAttachments;
ChapterInfo[] chapters;
+ mediaStreams = new List();
+
+ // Add external streams before adding the streams from the file to preserve stream IDs on remote videos
+ await AddExternalSubtitlesAsync(video, mediaStreams, options, cancellationToken).ConfigureAwait(false);
+
+ await AddExternalAudioAsync(video, mediaStreams, options, cancellationToken).ConfigureAwait(false);
+
+ var startIndex = mediaStreams.Count == 0 ? 0 : (mediaStreams.Max(i => i.Index) + 1);
+
if (mediaInfo != null)
{
- mediaStreams = mediaInfo.MediaStreams.ToList();
+ foreach (var mediaStream in mediaInfo.MediaStreams)
+ {
+ mediaStream.Index = startIndex++;
+ mediaStreams.Add(mediaStream);
+ }
+
mediaAttachments = mediaInfo.MediaAttachments;
video.TotalBitrate = mediaInfo.Bitrate;
// video.FormatName = (mediaInfo.Container ?? string.Empty)
// .Replace("matroska", "mkv", StringComparison.OrdinalIgnoreCase);
- // For dvd's this may not always be accurate, so don't set the runtime if the item already has one
+ // For DVDs this may not always be accurate, so don't set the runtime if the item already has one
var needToSetRuntime = video.VideoType != VideoType.Dvd || video.RunTimeTicks == null || video.RunTimeTicks.Value == 0;
if (needToSetRuntime)
@@ -213,15 +227,20 @@ namespace MediaBrowser.Providers.MediaInfo
}
else
{
- mediaStreams = new List();
+ var currentMediaStreams = video.GetMediaStreams();
+ foreach (var mediaStream in currentMediaStreams)
+ {
+ if (!mediaStream.IsExternal)
+ {
+ mediaStream.Index = startIndex++;
+ mediaStreams.Add(mediaStream);
+ }
+ }
+
mediaAttachments = Array.Empty();
chapters = Array.Empty();
}
- await AddExternalSubtitlesAsync(video, mediaStreams, options, cancellationToken).ConfigureAwait(false);
-
- await AddExternalAudioAsync(video, mediaStreams, options, cancellationToken).ConfigureAwait(false);
-
var libraryOptions = _libraryManager.GetLibraryOptions(video);
if (mediaInfo != null)
@@ -254,7 +273,11 @@ namespace MediaBrowser.Providers.MediaInfo
video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle);
_itemRepo.SaveMediaStreams(video.Id, mediaStreams, cancellationToken);
- _itemRepo.SaveMediaAttachments(video.Id, mediaAttachments, cancellationToken);
+
+ if (mediaAttachments.Any())
+ {
+ _itemRepo.SaveMediaAttachments(video.Id, mediaAttachments, cancellationToken);
+ }
if (options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh ||
options.MetadataRefreshMode == MetadataRefreshMode.Default)
--
cgit v1.2.3
From eb55f47f2e9afbd82db66eef538b8d89cacb77b9 Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Sat, 4 Jun 2022 17:23:40 -0600
Subject: Merge pull request #7810 from Bond-009/unaccpattern
(cherry picked from commit 5e343d30e198ca57926a13e1a6b05ae232091d86)
Signed-off-by: crobibero
---
Jellyfin.Server/Program.cs | 10 ++++++----
MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 8 +++++---
2 files changed, 11 insertions(+), 7 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 1323d8a48..2bda8d290 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -545,12 +545,14 @@ namespace Jellyfin.Server
const string ResourcePath = "Jellyfin.Server.Resources.Configuration.logging.json";
Stream resource = typeof(Program).Assembly.GetManifestResourceStream(ResourcePath)
?? throw new InvalidOperationException($"Invalid resource path: '{ResourcePath}'");
- Stream dst = new FileStream(configPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
await using (resource.ConfigureAwait(false))
- await using (dst.ConfigureAwait(false))
{
- // Copy the resource contents to the expected file path for the config file
- await resource.CopyToAsync(dst).ConfigureAwait(false);
+ Stream dst = new FileStream(configPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
+ await using (dst.ConfigureAwait(false))
+ {
+ // Copy the resource contents to the expected file path for the config file
+ await resource.CopyToAsync(dst).ConfigureAwait(false);
+ }
}
}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index f6b7efb1e..49bc2d775 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -681,11 +681,13 @@ namespace MediaBrowser.MediaEncoding.Subtitles
if (!string.Equals(text, newText, StringComparison.Ordinal))
{
var fileStream = new FileStream(file, FileMode.Create, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
- var writer = new StreamWriter(fileStream, encoding);
await using (fileStream.ConfigureAwait(false))
- await using (writer.ConfigureAwait(false))
{
- await writer.WriteAsync(newText.AsMemory(), cancellationToken).ConfigureAwait(false);
+ var writer = new StreamWriter(fileStream, encoding);
+ await using (writer.ConfigureAwait(false))
+ {
+ await writer.WriteAsync(newText.AsMemory(), cancellationToken).ConfigureAwait(false);
+ }
}
}
}
--
cgit v1.2.3
From c19c7872732e71b6879560de7d0344d0999f7d6b Mon Sep 17 00:00:00 2001
From: Bond-009
Date: Mon, 6 Jun 2022 17:29:39 +0200
Subject: Merge pull request #7828 from nyanmisaka/fix-dovi-tonemap
Fix Dolby Vision profile 5 and 8 to SDR HW tone-mapping
(cherry picked from commit 8595a979a872c05d0d06f9b87ed1b56c693c267d)
Signed-off-by: crobibero
---
Jellyfin.Api/Controllers/DynamicHlsController.cs | 21 +++++--
.../MediaEncoding/EncodingHelper.cs | 66 ++++++++++++++--------
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 21 +++++--
MediaBrowser.Model/Entities/MediaStream.cs | 3 +-
4 files changed, 78 insertions(+), 33 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 6347b908c..9173487dd 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -1711,20 +1711,30 @@ namespace Jellyfin.Api.Controllers
return audioTranscodeParams;
}
+ // flac and opus are experimental in mp4 muxer
+ var strictArgs = string.Empty;
+
+ if (string.Equals(state.ActualOutputAudioCodec, "flac", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(state.ActualOutputAudioCodec, "opus", StringComparison.OrdinalIgnoreCase))
+ {
+ strictArgs = " -strict -2";
+ }
+
if (EncodingHelper.IsCopyCodec(audioCodec))
{
var videoCodec = _encodingHelper.GetVideoEncoder(state, _encodingOptions);
var bitStreamArgs = EncodingHelper.GetAudioBitStreamArguments(state, state.Request.SegmentContainer, state.MediaSource.Container);
+ var copyArgs = "-codec:a:0 copy" + bitStreamArgs + strictArgs;
if (EncodingHelper.IsCopyCodec(videoCodec) && state.EnableBreakOnNonKeyFrames(videoCodec))
{
- return "-codec:a:0 copy -strict -2 -copypriorss:a:0 0" + bitStreamArgs;
+ return copyArgs + " -copypriorss:a:0 0";
}
- return "-codec:a:0 copy -strict -2" + bitStreamArgs;
+ return copyArgs;
}
- var args = "-codec:a:0 " + audioCodec;
+ var args = "-codec:a:0 " + audioCodec + strictArgs;
var channels = state.OutputAudioChannels;
@@ -1779,11 +1789,12 @@ namespace Jellyfin.Api.Controllers
|| string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase))
{
if (EncodingHelper.IsCopyCodec(codec)
- && (string.Equals(state.VideoStream.CodecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
+ && (string.Equals(state.VideoStream.CodecTag, "dovi", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(state.VideoStream.CodecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|| string.Equals(state.VideoStream.CodecTag, "dvhe", StringComparison.OrdinalIgnoreCase)))
{
// Prefer dvh1 to dvhe
- args += " -tag:v:0 dvh1";
+ args += " -tag:v:0 dvh1 -strict -2";
}
else
{
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index bffd3a1ca..eb344b528 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -13,11 +13,13 @@ using System.Threading;
using Jellyfin.Data.Enums;
using Jellyfin.Extensions;
using MediaBrowser.Common.Configuration;
+using MediaBrowser.Controller.Extensions;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
+using Microsoft.Extensions.Configuration;
namespace MediaBrowser.Controller.MediaEncoding
{
@@ -32,6 +34,7 @@ namespace MediaBrowser.Controller.MediaEncoding
private readonly IApplicationPaths _appPaths;
private readonly IMediaEncoder _mediaEncoder;
private readonly ISubtitleEncoder _subtitleEncoder;
+ private readonly IConfiguration _config;
private static readonly string[] _videoProfilesH264 = new[]
{
@@ -54,11 +57,13 @@ namespace MediaBrowser.Controller.MediaEncoding
public EncodingHelper(
IApplicationPaths appPaths,
IMediaEncoder mediaEncoder,
- ISubtitleEncoder subtitleEncoder)
+ ISubtitleEncoder subtitleEncoder,
+ IConfiguration config)
{
_appPaths = appPaths;
_mediaEncoder = mediaEncoder;
_subtitleEncoder = subtitleEncoder;
+ _config = config;
}
public string GetH264Encoder(EncodingJobInfo state, EncodingOptions encodingOptions)
@@ -144,15 +149,28 @@ namespace MediaBrowser.Controller.MediaEncoding
private bool IsHwTonemapAvailable(EncodingJobInfo state, EncodingOptions options)
{
- if (state.VideoStream == null)
+ if (state.VideoStream == null
+ || !options.EnableTonemapping
+ || GetVideoColorBitDepth(state) != 10)
{
return false;
}
- return options.EnableTonemapping
- && (string.Equals(state.VideoStream.ColorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
- || string.Equals(state.VideoStream.ColorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase))
- && GetVideoColorBitDepth(state) == 10;
+ if (string.Equals(state.VideoStream.CodecTag, "dovi", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(state.VideoStream.CodecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(state.VideoStream.CodecTag, "dvhe", StringComparison.OrdinalIgnoreCase))
+ {
+ // Only native SW decoder and HW accelerator can parse dovi rpu.
+ var vidDecoder = GetHardwareVideoDecoder(state, options) ?? string.Empty;
+ var isSwDecoder = string.IsNullOrEmpty(vidDecoder);
+ var isNvdecDecoder = vidDecoder.Contains("cuda", StringComparison.OrdinalIgnoreCase);
+ var isVaapiDecoder = vidDecoder.Contains("vaapi", StringComparison.OrdinalIgnoreCase);
+ var isD3d11vaDecoder = vidDecoder.Contains("d3d11va", StringComparison.OrdinalIgnoreCase);
+ return isSwDecoder || isNvdecDecoder || isVaapiDecoder || isD3d11vaDecoder;
+ }
+
+ return string.Equals(state.VideoStream.ColorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(state.VideoStream.ColorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase);
}
private bool IsVaapiVppTonemapAvailable(EncodingJobInfo state, EncodingOptions options)
@@ -516,8 +534,7 @@ namespace MediaBrowser.Controller.MediaEncoding
if (string.Equals(codec, "flac", StringComparison.OrdinalIgnoreCase))
{
- // flac is experimental in mp4 muxer
- return "flac -strict -2";
+ return "flac";
}
return codec.ToLowerInvariant();
@@ -1024,7 +1041,8 @@ namespace MediaBrowser.Controller.MediaEncoding
if (string.Equals(videoCodec, "h264_amf", StringComparison.OrdinalIgnoreCase)
|| string.Equals(videoCodec, "hevc_amf", StringComparison.OrdinalIgnoreCase))
{
- return FormattableString.Invariant($" -qmin 18 -qmax 32 -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}");
+ // Override the too high default qmin 18 in transcoding preset
+ return FormattableString.Invariant($" -rc cbr -qmin 0 -qmax 32 -b:v {bitrate} -maxrate {bitrate} -bufsize {bufsize}");
}
if (string.Equals(videoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)
@@ -1222,10 +1240,9 @@ namespace MediaBrowser.Controller.MediaEncoding
// Example: we encoded half of desired length, then codec detected
// scene cut and inserted a keyframe; next forced keyframe would
// be created outside of segment, which breaks seeking.
- // -sc_threshold 0 is used to prevent the hardware encoder from post processing to break the set keyframe.
gopArg = string.Format(
CultureInfo.InvariantCulture,
- " -g:v:0 {0} -keyint_min:v:0 {0} -sc_threshold:v:0 0",
+ " -g:v:0 {0} -keyint_min:v:0 {0}",
Math.Ceiling(segmentLength * framerate.Value));
}
@@ -1245,6 +1262,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|| string.Equals(codec, "hevc_vaapi", StringComparison.OrdinalIgnoreCase))
{
args += keyFrameArg;
+
+ // prevent the libx264 from post processing to break the set keyframe.
+ if (string.Equals(codec, "libx264", StringComparison.OrdinalIgnoreCase))
+ {
+ args += " -sc_threshold:v:0 0";
+ }
}
else
{
@@ -4865,21 +4888,20 @@ namespace MediaBrowser.Controller.MediaEncoding
public string GetInputModifier(EncodingJobInfo state, EncodingOptions encodingOptions, string segmentContainer)
{
var inputModifier = string.Empty;
- var probeSizeArgument = string.Empty;
+ var analyzeDurationArgument = string.Empty;
- string analyzeDurationArgument;
- if (state.MediaSource.AnalyzeDurationMs.HasValue)
- {
- analyzeDurationArgument = "-analyzeduration " + (state.MediaSource.AnalyzeDurationMs.Value * 1000).ToString(CultureInfo.InvariantCulture);
- }
- else
+ // Apply -analyzeduration as per the environment variable,
+ // otherwise ffmpeg will break on certain files due to default value is 0.
+ // The default value of -probesize is more than enough, so leave it as is.
+ var ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
+
+ if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
{
- analyzeDurationArgument = string.Empty;
+ analyzeDurationArgument = "-analyzeduration " + ffmpegAnalyzeDuration;
}
-
- if (!string.IsNullOrEmpty(probeSizeArgument))
+ else if (state.MediaSource.AnalyzeDurationMs.HasValue)
{
- inputModifier += " " + probeSizeArgument;
+ analyzeDurationArgument = "-analyzeduration " + (state.MediaSource.AnalyzeDurationMs.Value * 1000).ToString(CultureInfo.InvariantCulture);
}
if (!string.IsNullOrEmpty(analyzeDurationArgument))
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 1bac4b187..77b97c9b4 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -16,6 +16,7 @@ using MediaBrowser.Common;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
+using MediaBrowser.Controller.Extensions;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.MediaEncoding.Probing;
using MediaBrowser.Model.Dlna;
@@ -49,6 +50,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
private readonly IServerConfigurationManager _configurationManager;
private readonly IFileSystem _fileSystem;
private readonly ILocalizationManager _localization;
+ private readonly IConfiguration _config;
private readonly string _startupOptionFFmpegPath;
private readonly SemaphoreSlim _thumbnailResourcePool = new SemaphoreSlim(2, 2);
@@ -85,6 +87,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
_configurationManager = configurationManager;
_fileSystem = fileSystem;
_localization = localization;
+ _config = config;
_startupOptionFFmpegPath = config.GetValue(Controller.Extensions.ConfigurationExtensions.FfmpegPathKey) ?? string.Empty;
_jsonSerializerOptions = JsonDefaults.Options;
}
@@ -371,8 +374,13 @@ namespace MediaBrowser.MediaEncoding.Encoder
var inputFile = request.MediaSource.Path;
string analyzeDuration = string.Empty;
+ string ffmpegAnalyzeDuration = _config.GetFFmpegAnalyzeDuration() ?? string.Empty;
- if (request.MediaSource.AnalyzeDurationMs > 0)
+ if (!string.IsNullOrEmpty(ffmpegAnalyzeDuration))
+ {
+ analyzeDuration = "-analyzeduration " + ffmpegAnalyzeDuration;
+ }
+ else if (request.MediaSource.AnalyzeDurationMs > 0)
{
analyzeDuration = "-analyzeduration " +
(request.MediaSource.AnalyzeDurationMs * 1000).ToString();
@@ -629,10 +637,15 @@ namespace MediaBrowser.MediaEncoding.Encoder
filters.Add("thumbnail=n=" + (useLargerBatchSize ? "50" : "24"));
}
- // Use SW tonemap on HDR video stream only when the zscale filter is available.
- var enableHdrExtraction = string.Equals(videoStream?.VideoRange, "HDR", StringComparison.OrdinalIgnoreCase) && SupportsFilter("zscale");
- if (enableHdrExtraction)
+ // Use SW tonemap on HDR10/HLG video stream only when the zscale filter is available.
+ var enableHdrExtraction = false;
+
+ if ((string.Equals(videoStream?.ColorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(videoStream?.ColorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase))
+ && SupportsFilter("zscale"))
{
+ enableHdrExtraction = true;
+
filters.Add("zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0:peak=100,zscale=t=bt709:m=bt709,format=yuv420p");
}
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index 4742d21e9..96b48ca52 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -121,8 +121,7 @@ namespace MediaBrowser.Model.Entities
var codecTag = CodecTag;
- if (string.Equals(codecTag, "dva1", StringComparison.OrdinalIgnoreCase)
- || string.Equals(codecTag, "dvav", StringComparison.OrdinalIgnoreCase)
+ if (string.Equals(codecTag, "dovi", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvhe", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dav1", StringComparison.OrdinalIgnoreCase))
--
cgit v1.2.3
From a65397ae147d09703bfc2c5508e6e61b4c2998e3 Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Fri, 17 Jun 2022 10:01:37 -0600
Subject: Merge pull request #7950 from nyanmisaka/brighter-vpp-tonemap
(cherry picked from commit b36543275f8e1c380f5c247a04a48d5d96eb5836)
Signed-off-by: Joshua Boniface
---
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 14 +++++++++++++-
MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 1 +
MediaBrowser.Model/Configuration/EncodingOptions.cs | 6 ++++++
3 files changed, 20 insertions(+), 1 deletion(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index d5b0aca3c..2a5018c05 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -125,6 +125,7 @@ namespace MediaBrowser.Controller.MediaEncoding
&& _mediaEncoder.SupportsFilter("scale_vaapi")
&& _mediaEncoder.SupportsFilter("deinterlace_vaapi")
&& _mediaEncoder.SupportsFilter("tonemap_vaapi")
+ && _mediaEncoder.SupportsFilter("procamp_vaapi")
&& _mediaEncoder.SupportsFilterWithOption(FilterOptionType.OverlayVaapiFrameSync)
&& _mediaEncoder.SupportsFilter("hwupload_vaapi");
}
@@ -2718,7 +2719,18 @@ namespace MediaBrowser.Controller.MediaEncoding
var args = "tonemap_{0}=format={1}:p=bt709:t=bt709:m=bt709";
- if (!hwTonemapSuffix.Contains("vaapi", StringComparison.OrdinalIgnoreCase))
+ if (hwTonemapSuffix.Contains("vaapi", StringComparison.OrdinalIgnoreCase))
+ {
+ args += ",procamp_vaapi=b={2}:c={3}:extra_hw_frames=16";
+ return string.Format(
+ CultureInfo.InvariantCulture,
+ args,
+ hwTonemapSuffix,
+ videoFormat ?? "nv12",
+ options.VppTonemappingBrightness,
+ options.VppTonemappingContrast);
+ }
+ else
{
args += ":tonemap={2}:peak={3}:desat={4}";
diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
index 20d372d7a..d378c6e13 100644
--- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
@@ -100,6 +100,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
"scale_vaapi",
"deinterlace_vaapi",
"tonemap_vaapi",
+ "procamp_vaapi",
"overlay_vaapi",
"hwupload_vaapi"
};
diff --git a/MediaBrowser.Model/Configuration/EncodingOptions.cs b/MediaBrowser.Model/Configuration/EncodingOptions.cs
index fce0b6d6f..73ebfba70 100644
--- a/MediaBrowser.Model/Configuration/EncodingOptions.cs
+++ b/MediaBrowser.Model/Configuration/EncodingOptions.cs
@@ -26,6 +26,8 @@ namespace MediaBrowser.Model.Configuration
TonemappingThreshold = 0.8;
TonemappingPeak = 100;
TonemappingParam = 0;
+ VppTonemappingBrightness = 0;
+ VppTonemappingContrast = 1.2;
H264Crf = 23;
H265Crf = 28;
DeinterlaceDoubleRate = false;
@@ -89,6 +91,10 @@ namespace MediaBrowser.Model.Configuration
public double TonemappingParam { get; set; }
+ public double VppTonemappingBrightness { get; set; }
+
+ public double VppTonemappingContrast { get; set; }
+
public int H264Crf { get; set; }
public int H265Crf { get; set; }
--
cgit v1.2.3
From e61c80fed7201124809ac21a1b26facf1daddf90 Mon Sep 17 00:00:00 2001
From: "Joshua M. Boniface"
Date: Mon, 20 Jun 2022 09:57:57 -0400
Subject: Merge pull request #7960 from Shadowghost/subrip-encoder-fix
(cherry picked from commit ae79bbc34cb3ecc297b0f21fcf474b6c359a3a33)
Signed-off-by: Joshua Boniface
---
MediaBrowser.MediaEncoding/Subtitles/AssWriter.cs | 54 ++++++++++++++++++++++
MediaBrowser.MediaEncoding/Subtitles/SsaWriter.cs | 54 ++++++++++++++++++++++
.../Subtitles/SubtitleEncoder.cs | 14 +++++-
MediaBrowser.Model/MediaInfo/SubtitleFormat.cs | 1 +
4 files changed, 122 insertions(+), 1 deletion(-)
create mode 100644 MediaBrowser.MediaEncoding/Subtitles/AssWriter.cs
create mode 100644 MediaBrowser.MediaEncoding/Subtitles/SsaWriter.cs
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/MediaBrowser.MediaEncoding/Subtitles/AssWriter.cs b/MediaBrowser.MediaEncoding/Subtitles/AssWriter.cs
new file mode 100644
index 000000000..0d1cf6e25
--- /dev/null
+++ b/MediaBrowser.MediaEncoding/Subtitles/AssWriter.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Globalization;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using MediaBrowser.Model.MediaInfo;
+
+namespace MediaBrowser.MediaEncoding.Subtitles
+{
+ ///
+ /// ASS subtitle writer.
+ ///
+ public class AssWriter : ISubtitleWriter
+ {
+ ///
+ public void Write(SubtitleTrackInfo info, Stream stream, CancellationToken cancellationToken)
+ {
+ using (var writer = new StreamWriter(stream, Encoding.UTF8, 1024, true))
+ {
+ var trackEvents = info.TrackEvents;
+ var timeFormat = @"hh\:mm\:ss\.ff";
+
+ // Write ASS header
+ writer.WriteLine("[Script Info]");
+ writer.WriteLine("Title: Jellyfin transcoded ASS subtitle");
+ writer.WriteLine("ScriptType: v4.00+");
+ writer.WriteLine();
+ writer.WriteLine("[V4+ Styles]");
+ writer.WriteLine("Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding");
+ writer.WriteLine("Style: Default,Arial,20,&H00FFFFFF,&H00FFFFFF,&H19333333,&H910E0807,0,0,0,0,100,100,0,0,0,1,0,2,10,10,10,1");
+ writer.WriteLine();
+ writer.WriteLine("[Events]");
+ writer.WriteLine("Format: Layer, Start, End, Style, Text");
+
+ for (int i = 0; i < trackEvents.Count; i++)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var trackEvent = trackEvents[i];
+ var startTime = TimeSpan.FromTicks(trackEvent.StartPositionTicks).ToString(timeFormat, CultureInfo.InvariantCulture);
+ var endTime = TimeSpan.FromTicks(trackEvent.EndPositionTicks).ToString(timeFormat, CultureInfo.InvariantCulture);
+ var text = Regex.Replace(trackEvent.Text, @"\n", "\\n", RegexOptions.IgnoreCase);
+
+ writer.WriteLine(
+ "Dialogue: 0,{0},{1},Default,{2}",
+ startTime,
+ endTime,
+ text);
+ }
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SsaWriter.cs b/MediaBrowser.MediaEncoding/Subtitles/SsaWriter.cs
new file mode 100644
index 000000000..6761cd309
--- /dev/null
+++ b/MediaBrowser.MediaEncoding/Subtitles/SsaWriter.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Globalization;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading;
+using MediaBrowser.Model.MediaInfo;
+
+namespace MediaBrowser.MediaEncoding.Subtitles
+{
+ ///
+ /// SSA subtitle writer.
+ ///
+ public class SsaWriter : ISubtitleWriter
+ {
+ ///
+ public void Write(SubtitleTrackInfo info, Stream stream, CancellationToken cancellationToken)
+ {
+ using (var writer = new StreamWriter(stream, Encoding.UTF8, 1024, true))
+ {
+ var trackEvents = info.TrackEvents;
+ var timeFormat = @"hh\:mm\:ss\.ff";
+
+ // Write SSA header
+ writer.WriteLine("[Script Info]");
+ writer.WriteLine("Title: Jellyfin transcoded SSA subtitle");
+ writer.WriteLine("ScriptType: v4.00");
+ writer.WriteLine();
+ writer.WriteLine("[V4 Styles]");
+ writer.WriteLine("Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding");
+ writer.WriteLine("Style: Default,Arial,20,&H00FFFFFF,&H00FFFFFF,&H19333333,&H19333333,0,0,0,1,0,2,10,10,10,0,1");
+ writer.WriteLine();
+ writer.WriteLine("[Events]");
+ writer.WriteLine("Format: Layer, Start, End, Style, Text");
+
+ for (int i = 0; i < trackEvents.Count; i++)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+
+ var trackEvent = trackEvents[i];
+ var startTime = TimeSpan.FromTicks(trackEvent.StartPositionTicks).ToString(timeFormat, CultureInfo.InvariantCulture);
+ var endTime = TimeSpan.FromTicks(trackEvent.EndPositionTicks).ToString(timeFormat, CultureInfo.InvariantCulture);
+ var text = Regex.Replace(trackEvent.Text, @"\n", "\\n", RegexOptions.IgnoreCase);
+
+ writer.WriteLine(
+ "Dialogue: 0,{0},{1},Default,{2}",
+ startTime,
+ endTime,
+ text);
+ }
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 49bc2d775..b9b8a89eb 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -283,6 +283,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles
private bool TryGetWriter(string format, [NotNullWhen(true)] out ISubtitleWriter? value)
{
+ if (string.Equals(format, SubtitleFormat.ASS, StringComparison.OrdinalIgnoreCase))
+ {
+ value = new AssWriter();
+ return true;
+ }
+
if (string.IsNullOrEmpty(format))
{
throw new ArgumentNullException(nameof(format));
@@ -294,12 +300,18 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return true;
}
- if (string.Equals(format, SubtitleFormat.SRT, StringComparison.OrdinalIgnoreCase))
+ if (string.Equals(format, SubtitleFormat.SRT, StringComparison.OrdinalIgnoreCase) || string.Equals(format,SubtitleFormat.SUBRIP, StringComparison.OrdinalIgnoreCase))
{
value = new SrtWriter();
return true;
}
+ if (string.Equals(format, SubtitleFormat.SSA, StringComparison.OrdinalIgnoreCase))
+ {
+ value = new SsaWriter();
+ return true;
+ }
+
if (string.Equals(format, SubtitleFormat.VTT, StringComparison.OrdinalIgnoreCase))
{
value = new VttWriter();
diff --git a/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs
index 9bc5c31f6..85de91694 100644
--- a/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs
+++ b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs
@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.MediaInfo
public static class SubtitleFormat
{
public const string SRT = "srt";
+ public const string SUBRIP = "subrip";
public const string SSA = "ssa";
public const string ASS = "ass";
public const string VTT = "vtt";
--
cgit v1.2.3
From fe32b5e33353e6154e067c5fb196a36cdecc0cea Mon Sep 17 00:00:00 2001
From: "Joshua M. Boniface"
Date: Sun, 26 Jun 2022 20:55:36 -0400
Subject: Merge pull request #7964 from jellyfin/dovi-side-data
(cherry picked from commit 39d185c7b19ed2da1ae46566152fb1cf182266cd)
Signed-off-by: Joshua Boniface
---
.../Data/SqliteItemRepository.cs | 70 +++++++++++++-
.../MediaEncoding/EncodingHelper.cs | 20 ++--
.../Probing/MediaStreamInfo.cs | 7 ++
.../Probing/MediaStreamInfoSideData.cs | 74 +++++++++++++++
.../Probing/ProbeResultNormalizer.cs | 21 +++++
MediaBrowser.Model/Entities/MediaStream.cs | 101 ++++++++++++++++++++-
.../Probing/ProbeResultNormalizerTests.cs | 8 ++
.../Test Data/Probing/video_metadata.json | 15 ++-
8 files changed, 301 insertions(+), 15 deletions(-)
create mode 100644 MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 964a630b2..4361440d7 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -170,7 +170,15 @@ namespace Emby.Server.Implementations.Data
"CodecTimeBase",
"ColorPrimaries",
"ColorSpace",
- "ColorTransfer"
+ "ColorTransfer",
+ "DvVersionMajor",
+ "DvVersionMinor",
+ "DvProfile",
+ "DvLevel",
+ "RpuPresentFlag",
+ "ElPresentFlag",
+ "BlPresentFlag",
+ "DvBlSignalCompatibilityId"
};
private static readonly string _mediaStreamSaveColumnsInsertQuery =
@@ -341,7 +349,7 @@ namespace Emby.Server.Implementations.Data
public void Initialize(SqliteUserDataRepository userDataRepo, IUserManager userManager)
{
const string CreateMediaStreamsTableCommand
- = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, ColorPrimaries TEXT NULL, ColorSpace TEXT NULL, ColorTransfer TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
+ = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, ColorPrimaries TEXT NULL, ColorSpace TEXT NULL, ColorTransfer TEXT NULL, DvVersionMajor INT NULL, DvVersionMinor INT NULL, DvProfile INT NULL, DvLevel INT NULL, RpuPresentFlag INT NULL, ElPresentFlag INT NULL, BlPresentFlag INT NULL, DvBlSignalCompatibilityId INT NULL, PRIMARY KEY (ItemId, StreamIndex))";
const string CreateMediaAttachmentsTableCommand
= "create table if not exists mediaattachments (ItemId GUID, AttachmentIndex INT, Codec TEXT, CodecTag TEXT NULL, Comment TEXT NULL, Filename TEXT NULL, MIMEType TEXT NULL, PRIMARY KEY (ItemId, AttachmentIndex))";
@@ -555,6 +563,15 @@ namespace Emby.Server.Implementations.Data
AddColumn(db, "MediaStreams", "ColorPrimaries", "TEXT", existingColumnNames);
AddColumn(db, "MediaStreams", "ColorSpace", "TEXT", existingColumnNames);
AddColumn(db, "MediaStreams", "ColorTransfer", "TEXT", existingColumnNames);
+
+ AddColumn(db, "MediaStreams", "DvVersionMajor", "INT", existingColumnNames);
+ AddColumn(db, "MediaStreams", "DvVersionMinor", "INT", existingColumnNames);
+ AddColumn(db, "MediaStreams", "DvProfile", "INT", existingColumnNames);
+ AddColumn(db, "MediaStreams", "DvLevel", "INT", existingColumnNames);
+ AddColumn(db, "MediaStreams", "RpuPresentFlag", "INT", existingColumnNames);
+ AddColumn(db, "MediaStreams", "ElPresentFlag", "INT", existingColumnNames);
+ AddColumn(db, "MediaStreams", "BlPresentFlag", "INT", existingColumnNames);
+ AddColumn(db, "MediaStreams", "DvBlSignalCompatibilityId", "INT", existingColumnNames);
},
TransactionMode);
@@ -5859,6 +5876,15 @@ AND Type = @InternalPersonType)");
statement.TryBind("@ColorPrimaries" + index, stream.ColorPrimaries);
statement.TryBind("@ColorSpace" + index, stream.ColorSpace);
statement.TryBind("@ColorTransfer" + index, stream.ColorTransfer);
+
+ statement.TryBind("@DvVersionMajor" + index, stream.DvVersionMajor);
+ statement.TryBind("@DvVersionMinor" + index, stream.DvVersionMinor);
+ statement.TryBind("@DvProfile" + index, stream.DvProfile);
+ statement.TryBind("@DvLevel" + index, stream.DvLevel);
+ statement.TryBind("@RpuPresentFlag" + index, stream.RpuPresentFlag);
+ statement.TryBind("@ElPresentFlag" + index, stream.ElPresentFlag);
+ statement.TryBind("@BlPresentFlag" + index, stream.BlPresentFlag);
+ statement.TryBind("@DvBlSignalCompatibilityId" + index, stream.DvBlSignalCompatibilityId);
}
statement.Reset();
@@ -6030,6 +6056,46 @@ AND Type = @InternalPersonType)");
item.ColorTransfer = colorTransfer;
}
+ if (reader.TryGetInt32(35, out var dvVersionMajor))
+ {
+ item.DvVersionMajor = dvVersionMajor;
+ }
+
+ if (reader.TryGetInt32(36, out var dvVersionMinor))
+ {
+ item.DvVersionMinor = dvVersionMinor;
+ }
+
+ if (reader.TryGetInt32(37, out var dvProfile))
+ {
+ item.DvProfile = dvProfile;
+ }
+
+ if (reader.TryGetInt32(38, out var dvLevel))
+ {
+ item.DvLevel = dvLevel;
+ }
+
+ if (reader.TryGetInt32(39, out var rpuPresentFlag))
+ {
+ item.RpuPresentFlag = rpuPresentFlag;
+ }
+
+ if (reader.TryGetInt32(40, out var elPresentFlag))
+ {
+ item.ElPresentFlag = elPresentFlag;
+ }
+
+ if (reader.TryGetInt32(41, out var blPresentFlag))
+ {
+ item.BlPresentFlag = blPresentFlag;
+ }
+
+ if (reader.TryGetInt32(42, out var dvBlSignalCompatibilityId))
+ {
+ item.DvBlSignalCompatibilityId = dvBlSignalCompatibilityId;
+ }
+
if (item.Type == MediaStreamType.Subtitle)
{
item.LocalizedUndefined = _localization.GetLocalizedString("Undefined");
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 2a5018c05..f795bf2aa 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -157,9 +157,9 @@ namespace MediaBrowser.Controller.MediaEncoding
return false;
}
- if (string.Equals(state.VideoStream.CodecTag, "dovi", StringComparison.OrdinalIgnoreCase)
- || string.Equals(state.VideoStream.CodecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
- || string.Equals(state.VideoStream.CodecTag, "dvhe", StringComparison.OrdinalIgnoreCase))
+ if (string.Equals(state.VideoStream.Codec, "hevc", StringComparison.OrdinalIgnoreCase)
+ && string.Equals(state.VideoStream.VideoRange, "HDR", StringComparison.OrdinalIgnoreCase)
+ && string.Equals(state.VideoStream.VideoRangeType, "DOVI", StringComparison.OrdinalIgnoreCase))
{
// Only native SW decoder and HW accelerator can parse dovi rpu.
var vidDecoder = GetHardwareVideoDecoder(state, options) ?? string.Empty;
@@ -170,22 +170,24 @@ namespace MediaBrowser.Controller.MediaEncoding
return isSwDecoder || isNvdecDecoder || isVaapiDecoder || isD3d11vaDecoder;
}
- return string.Equals(state.VideoStream.ColorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
- || string.Equals(state.VideoStream.ColorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase);
+ return string.Equals(state.VideoStream.VideoRange, "HDR", StringComparison.OrdinalIgnoreCase)
+ && (string.Equals(state.VideoStream.VideoRangeType, "HDR10", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(state.VideoStream.VideoRangeType, "HLG", StringComparison.OrdinalIgnoreCase));
}
private bool IsVaapiVppTonemapAvailable(EncodingJobInfo state, EncodingOptions options)
{
- if (state.VideoStream == null)
+ if (state.VideoStream == null
+ || !options.EnableVppTonemapping
+ || GetVideoColorBitDepth(state) != 10)
{
return false;
}
// Native VPP tonemapping may come to QSV in the future.
- return options.EnableVppTonemapping
- && string.Equals(state.VideoStream.ColorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
- && GetVideoColorBitDepth(state) == 10;
+ return string.Equals(state.VideoStream.VideoRange, "HDR", StringComparison.OrdinalIgnoreCase)
+ && string.Equals(state.VideoStream.VideoRangeType, "HDR10", StringComparison.OrdinalIgnoreCase);
}
///
diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs
index c9c8c34c2..eab8f79bb 100644
--- a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs
+++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs
@@ -310,5 +310,12 @@ namespace MediaBrowser.MediaEncoding.Probing
/// The color primaries.
[JsonPropertyName("color_primaries")]
public string ColorPrimaries { get; set; }
+
+ ///
+ /// Gets or sets the side_data_list.
+ ///
+ /// The side_data_list.
+ [JsonPropertyName("side_data_list")]
+ public IReadOnlyList SideDataList { get; set; }
}
}
diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
new file mode 100644
index 000000000..095757bef
--- /dev/null
+++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
@@ -0,0 +1,74 @@
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+
+namespace MediaBrowser.MediaEncoding.Probing
+{
+ ///
+ /// Class MediaStreamInfoSideData.
+ ///
+ public class MediaStreamInfoSideData
+ {
+ ///
+ /// Gets or sets the SideDataType.
+ ///
+ /// The SideDataType.
+ [JsonPropertyName("side_data_type")]
+ public string? SideDataType { get; set; }
+
+ ///
+ /// Gets or sets the DvVersionMajor.
+ ///
+ /// The DvVersionMajor.
+ [JsonPropertyName("dv_version_major")]
+ public int? DvVersionMajor { get; set; }
+
+ ///
+ /// Gets or sets the DvVersionMinor.
+ ///
+ /// The DvVersionMinor.
+ [JsonPropertyName("dv_version_minor")]
+ public int? DvVersionMinor { get; set; }
+
+ ///
+ /// Gets or sets the DvProfile.
+ ///
+ /// The DvProfile.
+ [JsonPropertyName("dv_profile")]
+ public int? DvProfile { get; set; }
+
+ ///
+ /// Gets or sets the DvLevel.
+ ///
+ /// The DvLevel.
+ [JsonPropertyName("dv_level")]
+ public int? DvLevel { get; set; }
+
+ ///
+ /// Gets or sets the RpuPresentFlag.
+ ///
+ /// The RpuPresentFlag.
+ [JsonPropertyName("rpu_present_flag")]
+ public int? RpuPresentFlag { get; set; }
+
+ ///
+ /// Gets or sets the ElPresentFlag.
+ ///
+ /// The ElPresentFlag.
+ [JsonPropertyName("el_present_flag")]
+ public int? ElPresentFlag { get; set; }
+
+ ///
+ /// Gets or sets the BlPresentFlag.
+ ///
+ /// The BlPresentFlag.
+ [JsonPropertyName("bl_present_flag")]
+ public int? BlPresentFlag { get; set; }
+
+ ///
+ /// Gets or sets the DvBlSignalCompatibilityId.
+ ///
+ /// The DvBlSignalCompatibilityId.
+ [JsonPropertyName("dv_bl_signal_compatibility_id")]
+ public int? DvBlSignalCompatibilityId { get; set; }
+ }
+}
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index 3f78d0d42..74d7341e9 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -841,6 +841,27 @@ namespace MediaBrowser.MediaEncoding.Probing
{
stream.ColorPrimaries = streamInfo.ColorPrimaries;
}
+
+ if (streamInfo.SideDataList != null)
+ {
+ foreach (var data in streamInfo.SideDataList)
+ {
+ // Parse Dolby Vision metadata from side_data
+ if (string.Equals(data.SideDataType, "DOVI configuration record", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.DvVersionMajor = data.DvVersionMajor;
+ stream.DvVersionMinor = data.DvVersionMinor;
+ stream.DvProfile = data.DvProfile;
+ stream.DvLevel = data.DvLevel;
+ stream.RpuPresentFlag = data.RpuPresentFlag;
+ stream.ElPresentFlag = data.ElPresentFlag;
+ stream.BlPresentFlag = data.BlPresentFlag;
+ stream.DvBlSignalCompatibilityId = data.DvBlSignalCompatibilityId;
+
+ break;
+ }
+ }
+ }
}
else
{
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index 48408e584..58988b6fa 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -72,6 +72,54 @@ namespace MediaBrowser.Model.Entities
/// The color primaries.
public string ColorPrimaries { get; set; }
+ ///
+ /// Gets or sets the Dolby Vision version major.
+ ///
+ /// The Dolby Vision version major.
+ public int? DvVersionMajor { get; set; }
+
+ ///
+ /// Gets or sets the Dolby Vision version minor.
+ ///
+ /// The Dolby Vision version minor.
+ public int? DvVersionMinor { get; set; }
+
+ ///
+ /// Gets or sets the Dolby Vision profile.
+ ///
+ /// The Dolby Vision profile.
+ public int? DvProfile { get; set; }
+
+ ///
+ /// Gets or sets the Dolby Vision level.
+ ///
+ /// The Dolby Vision level.
+ public int? DvLevel { get; set; }
+
+ ///
+ /// Gets or sets the Dolby Vision rpu present flag.
+ ///
+ /// The Dolby Vision rpu present flag.
+ public int? RpuPresentFlag { get; set; }
+
+ ///
+ /// Gets or sets the Dolby Vision el present flag.
+ ///
+ /// The Dolby Vision el present flag.
+ public int? ElPresentFlag { get; set; }
+
+ ///
+ /// Gets or sets the Dolby Vision bl present flag.
+ ///
+ /// The Dolby Vision bl present flag.
+ public int? BlPresentFlag { get; set; }
+
+ ///
+ /// Gets or sets the Dolby Vision bl signal compatibility id.
+ ///
+ /// The Dolby Vision bl signal compatibility id.
+ public int? DvBlSignalCompatibilityId { get; set; }
+
///
/// Gets or sets the comment.
///
@@ -124,6 +172,47 @@ namespace MediaBrowser.Model.Entities
}
}
+ ///
+ /// Gets the video dovi title.
+ ///
+ /// The video dovi title.
+ public string VideoDoViTitle
+ {
+ get
+ {
+ var dvProfile = DvProfile;
+ var rpuPresentFlag = RpuPresentFlag == 1;
+ var blPresentFlag = BlPresentFlag == 1;
+ var dvBlCompatId = DvBlSignalCompatibilityId;
+
+ if (rpuPresentFlag
+ && blPresentFlag
+ && (dvProfile == 4
+ || dvProfile == 5
+ || dvProfile == 7
+ || dvProfile == 8
+ || dvProfile == 9))
+ {
+ var title = "DV Profile " + dvProfile;
+
+ if (dvBlCompatId > 0)
+ {
+ title += "." + dvBlCompatId;
+ }
+
+ return dvBlCompatId switch
+ {
+ 1 => title + " (HDR10)",
+ 2 => title + " (SDR)",
+ 4 => title + " (HLG)",
+ _ => title
+ };
+ }
+
+ return null;
+ }
+ }
+
public string LocalizedUndefined { get; set; }
public string LocalizedDefault { get; set; }
@@ -582,11 +671,17 @@ namespace MediaBrowser.Model.Entities
return ("HDR", "HLG");
}
- // For some Dolby Vision files, no color transfer is provided, so check the codec
-
var codecTag = CodecTag;
+ var dvProfile = DvProfile;
+ var rpuPresentFlag = RpuPresentFlag == 1;
+ var blPresentFlag = BlPresentFlag == 1;
+ var dvBlCompatId = DvBlSignalCompatibilityId;
+
+ var isDoViHDRProfile = dvProfile == 5 || dvProfile == 7 || dvProfile == 8;
+ var isDoViHDRFlag = rpuPresentFlag && blPresentFlag && (dvBlCompatId == 0 || dvBlCompatId == 1 || dvBlCompatId == 4);
- if (string.Equals(codecTag, "dovi", StringComparison.OrdinalIgnoreCase)
+ if ((isDoViHDRProfile && isDoViHDRFlag)
+ || string.Equals(codecTag, "dovi", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dvhe", StringComparison.OrdinalIgnoreCase)
|| string.Equals(codecTag, "dav1", StringComparison.OrdinalIgnoreCase))
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
index 53e1550ed..13cfe885f 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs
@@ -75,6 +75,14 @@ namespace Jellyfin.MediaEncoding.Tests.Probing
Assert.Equal(1, res.VideoStream.RefFrames);
Assert.Equal("1/1000", res.VideoStream.TimeBase);
Assert.Equal(MediaStreamType.Video, res.VideoStream.Type);
+ Assert.Equal(1, res.VideoStream.DvVersionMajor);
+ Assert.Equal(0, res.VideoStream.DvVersionMinor);
+ Assert.Equal(5, res.VideoStream.DvProfile);
+ Assert.Equal(6, res.VideoStream.DvLevel);
+ Assert.Equal(1, res.VideoStream.RpuPresentFlag);
+ Assert.Equal(0, res.VideoStream.ElPresentFlag);
+ Assert.Equal(1, res.VideoStream.BlPresentFlag);
+ Assert.Equal(0, res.VideoStream.DvBlSignalCompatibilityId);
Assert.Empty(res.Chapters);
Assert.Equal("Just color bars", res.Overview);
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_metadata.json b/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_metadata.json
index 720fc5c8f..519d81179 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_metadata.json
+++ b/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_metadata.json
@@ -47,7 +47,20 @@
"tags": {
"ENCODER": "Lavc57.107.100 libx264",
"DURATION": "00:00:01.000000000"
- }
+ },
+ "side_data_list": [
+ {
+ "side_data_type": "DOVI configuration record",
+ "dv_version_major": 1,
+ "dv_version_minor": 0,
+ "dv_profile": 5,
+ "dv_level": 6,
+ "rpu_present_flag": 1,
+ "el_present_flag": 0,
+ "bl_present_flag": 1,
+ "dv_bl_signal_compatibility_id": 0
+ }
+ ]
}
],
"chapters": [
--
cgit v1.2.3
From 3061446c8757d3f4f654e8b82d9bb5963f7adc06 Mon Sep 17 00:00:00 2001
From: "Joshua M. Boniface"
Date: Thu, 23 Jun 2022 09:13:35 -0400
Subject: Merge pull request #7984 from crobibero/dotnet-6.0.6
Upgrade to dotnet 6.0.6, update remaining dependencies
(cherry picked from commit 56e7b323de3e993ba79ed86ef7e9a10f79693156)
Signed-off-by: Joshua Boniface
---
Emby.Server.Implementations/Emby.Server.Implementations.csproj | 4 ++--
Jellyfin.Api/Jellyfin.Api.csproj | 2 +-
Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj | 4 ++--
.../Jellyfin.Server.Implementations.csproj | 8 ++++----
Jellyfin.Server/Jellyfin.Server.csproj | 4 ++--
MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 2 +-
MediaBrowser.Model/MediaBrowser.Model.csproj | 2 +-
deployment/Dockerfile.centos.amd64 | 2 +-
deployment/Dockerfile.fedora.amd64 | 2 +-
deployment/Dockerfile.ubuntu.amd64 | 2 +-
deployment/Dockerfile.ubuntu.arm64 | 2 +-
deployment/Dockerfile.ubuntu.armhf | 2 +-
tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj | 2 +-
.../Jellyfin.Server.Integration.Tests.csproj | 2 +-
tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj | 2 +-
15 files changed, 21 insertions(+), 21 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index 161c69642..cd24cd872 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -29,10 +29,10 @@
-
+
-
+
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index cd195ba25..d037ba712 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
index 4de4b231d..94614b4c8 100644
--- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
+++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
@@ -18,8 +18,8 @@
-
-
+
+
diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
index 5c0df4693..71614dce5 100644
--- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
+++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
@@ -27,13 +27,13 @@
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index 420676477..0a507c9f9 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -37,8 +37,8 @@
-
-
+
+
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index b9b8a89eb..7091af734 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -300,7 +300,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return true;
}
- if (string.Equals(format, SubtitleFormat.SRT, StringComparison.OrdinalIgnoreCase) || string.Equals(format,SubtitleFormat.SUBRIP, StringComparison.OrdinalIgnoreCase))
+ if (string.Equals(format, SubtitleFormat.SRT, StringComparison.OrdinalIgnoreCase) || string.Equals(format, SubtitleFormat.SUBRIP, StringComparison.OrdinalIgnoreCase))
{
value = new SrtWriter();
return true;
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index b3a581543..b4e93de19 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -40,7 +40,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/deployment/Dockerfile.centos.amd64 b/deployment/Dockerfile.centos.amd64
index 2d574fa74..20847fd25 100644
--- a/deployment/Dockerfile.centos.amd64
+++ b/deployment/Dockerfile.centos.amd64
@@ -13,7 +13,7 @@ RUN yum update -yq \
&& yum install -yq @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git wget
# Install DotNET SDK
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/dc930bff-ef3d-4f6f-8799-6eb60390f5b4/1efee2a8ea0180c94aff8f15eb3af981/dotnet-sdk-6.0.300-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.fedora.amd64 b/deployment/Dockerfile.fedora.amd64
index 0833cccc8..5da6fbf77 100644
--- a/deployment/Dockerfile.fedora.amd64
+++ b/deployment/Dockerfile.fedora.amd64
@@ -12,7 +12,7 @@ RUN dnf update -yq \
&& dnf install -yq @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel systemd wget make
# Install DotNET SDK
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/dc930bff-ef3d-4f6f-8799-6eb60390f5b4/1efee2a8ea0180c94aff8f15eb3af981/dotnet-sdk-6.0.300-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64
index 7143a39f3..34ef0c20d 100644
--- a/deployment/Dockerfile.ubuntu.amd64
+++ b/deployment/Dockerfile.ubuntu.amd64
@@ -17,7 +17,7 @@ RUN apt-get update -yqq \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/dc930bff-ef3d-4f6f-8799-6eb60390f5b4/1efee2a8ea0180c94aff8f15eb3af981/dotnet-sdk-6.0.300-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64
index 625b0791e..f3a7de56d 100644
--- a/deployment/Dockerfile.ubuntu.arm64
+++ b/deployment/Dockerfile.ubuntu.arm64
@@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/dc930bff-ef3d-4f6f-8799-6eb60390f5b4/1efee2a8ea0180c94aff8f15eb3af981/dotnet-sdk-6.0.300-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf
index c457aa0bb..fa21daf66 100644
--- a/deployment/Dockerfile.ubuntu.armhf
+++ b/deployment/Dockerfile.ubuntu.armhf
@@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/dc930bff-ef3d-4f6f-8799-6eb60390f5b4/1efee2a8ea0180c94aff8f15eb3af981/dotnet-sdk-6.0.300-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index 35afe06b1..a08220858 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
index 2d4ea3e8a..07c5e94de 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
index 3d9192041..3e445e012 100644
--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
@@ -10,7 +10,7 @@
-
+
--
cgit v1.2.3
From be3d57ad417060d74723582e0d2621665db246c7 Mon Sep 17 00:00:00 2001
From: Joshua Boniface
Date: Wed, 20 Jul 2022 19:29:09 -0400
Subject: Backport pull request #8115 from jellyfin/release-10.8.z
Update to dotnet 6.0.7
Authored-by: Cody Robibero
Merged-by: Joshua M. Boniface
Original-merge: d0fd23bb4b746ffc98fe76a790706ecfa3c19342
---
Emby.Server.Implementations/Emby.Server.Implementations.csproj | 2 +-
Jellyfin.Api/Jellyfin.Api.csproj | 2 +-
Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj | 4 ++--
.../Jellyfin.Server.Implementations.csproj | 8 ++++----
Jellyfin.Server/Jellyfin.Server.csproj | 4 ++--
MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj | 2 +-
deployment/Dockerfile.centos.amd64 | 2 +-
deployment/Dockerfile.fedora.amd64 | 2 +-
deployment/Dockerfile.ubuntu.amd64 | 2 +-
deployment/Dockerfile.ubuntu.arm64 | 2 +-
deployment/Dockerfile.ubuntu.armhf | 2 +-
tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj | 2 +-
.../Jellyfin.Server.Integration.Tests.csproj | 2 +-
tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj | 2 +-
14 files changed, 19 insertions(+), 19 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index cd24cd872..9e653590b 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -29,7 +29,7 @@
-
+
diff --git a/Jellyfin.Api/Jellyfin.Api.csproj b/Jellyfin.Api/Jellyfin.Api.csproj
index d037ba712..309e3a9c5 100644
--- a/Jellyfin.Api/Jellyfin.Api.csproj
+++ b/Jellyfin.Api/Jellyfin.Api.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
index 94614b4c8..b64a84292 100644
--- a/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
+++ b/Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj
@@ -18,8 +18,8 @@
-
-
+
+
diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
index 71614dce5..d7c27542f 100644
--- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
+++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
@@ -27,13 +27,13 @@
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index 0a507c9f9..e372742e0 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -37,8 +37,8 @@
-
-
+
+
diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
index 92c9fc1a0..afe4ff4e7 100644
--- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
+++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj
@@ -30,7 +30,7 @@
-
+
diff --git a/deployment/Dockerfile.centos.amd64 b/deployment/Dockerfile.centos.amd64
index 20847fd25..89c74aadb 100644
--- a/deployment/Dockerfile.centos.amd64
+++ b/deployment/Dockerfile.centos.amd64
@@ -13,7 +13,7 @@ RUN yum update -yq \
&& yum install -yq @buildsys-build rpmdevtools yum-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel git wget
# Install DotNET SDK
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/0e83f50a-0619-45e6-8f16-dc4f41d1bb16/e0de908b2f070ef9e7e3b6ddea9d268c/dotnet-sdk-6.0.302-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.fedora.amd64 b/deployment/Dockerfile.fedora.amd64
index 5da6fbf77..2135d6f01 100644
--- a/deployment/Dockerfile.fedora.amd64
+++ b/deployment/Dockerfile.fedora.amd64
@@ -12,7 +12,7 @@ RUN dnf update -yq \
&& dnf install -yq @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel systemd wget make
# Install DotNET SDK
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/0e83f50a-0619-45e6-8f16-dc4f41d1bb16/e0de908b2f070ef9e7e3b6ddea9d268c/dotnet-sdk-6.0.302-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.amd64 b/deployment/Dockerfile.ubuntu.amd64
index 34ef0c20d..24330f629 100644
--- a/deployment/Dockerfile.ubuntu.amd64
+++ b/deployment/Dockerfile.ubuntu.amd64
@@ -17,7 +17,7 @@ RUN apt-get update -yqq \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/0e83f50a-0619-45e6-8f16-dc4f41d1bb16/e0de908b2f070ef9e7e3b6ddea9d268c/dotnet-sdk-6.0.302-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.arm64 b/deployment/Dockerfile.ubuntu.arm64
index f3a7de56d..507f446cc 100644
--- a/deployment/Dockerfile.ubuntu.arm64
+++ b/deployment/Dockerfile.ubuntu.arm64
@@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/0e83f50a-0619-45e6-8f16-dc4f41d1bb16/e0de908b2f070ef9e7e3b6ddea9d268c/dotnet-sdk-6.0.302-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/deployment/Dockerfile.ubuntu.armhf b/deployment/Dockerfile.ubuntu.armhf
index fa21daf66..31513541c 100644
--- a/deployment/Dockerfile.ubuntu.armhf
+++ b/deployment/Dockerfile.ubuntu.armhf
@@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release
# Install dotnet repository
-RUN wget -q https://download.visualstudio.microsoft.com/download/pr/77d472e5-194c-421e-992d-e4ca1d08e6cc/56c61ac303ddf1b12026151f4f000a2b/dotnet-sdk-6.0.301-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
+RUN wget -q https://download.visualstudio.microsoft.com/download/pr/0e83f50a-0619-45e6-8f16-dc4f41d1bb16/e0de908b2f070ef9e7e3b6ddea9d268c/dotnet-sdk-6.0.302-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
diff --git a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
index a08220858..1f1e2910a 100644
--- a/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
+++ b/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
index 07c5e94de..e2a0fe89b 100644
--- a/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
+++ b/tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
index 3e445e012..fb90c69de 100644
--- a/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
+++ b/tests/Jellyfin.Server.Tests/Jellyfin.Server.Tests.csproj
@@ -10,7 +10,7 @@
-
+
--
cgit v1.2.3
From 38eefbbafa381ea2d87efaa3328c5e273b902732 Mon Sep 17 00:00:00 2001
From: Joshua Boniface
Date: Mon, 1 Aug 2022 14:25:42 -0400
Subject: Backport pull request #8087 from jellyfin/release-10.8.z
feat: make subtitleeditparser generic
Authored-by: Claus Vium
Merged-by: Bond-009
Original-merge: 7323ccfc232d31797af3ceb8bad93cae1ea0898d
---
Emby.Server.Implementations/ApplicationHost.cs | 4 +-
MediaBrowser.MediaEncoding/Subtitles/AssParser.cs | 19 -----
.../Subtitles/ISubtitleParser.cs | 12 ++-
MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs | 19 -----
MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs | 19 -----
.../Subtitles/SubtitleEditParser.cs | 85 ++++++++++++++++++----
.../Subtitles/SubtitleEncoder.cs | 47 ++----------
.../Subtitles/AssParserTests.cs | 2 +-
.../Subtitles/SrtParserTests.cs | 4 +-
.../Subtitles/SsaParserTests.cs | 6 +-
10 files changed, 98 insertions(+), 119 deletions(-)
delete mode 100644 MediaBrowser.MediaEncoding/Subtitles/AssParser.cs
delete mode 100644 MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs
delete mode 100644 MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index bc55dc6b4..91a16c199 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -83,6 +83,7 @@ using MediaBrowser.Controller.SyncPlay;
using MediaBrowser.Controller.TV;
using MediaBrowser.LocalMetadata.Savers;
using MediaBrowser.MediaEncoding.BdInfo;
+using MediaBrowser.MediaEncoding.Subtitles;
using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Globalization;
@@ -634,7 +635,8 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
- serviceCollection.AddSingleton();
+ serviceCollection.AddSingleton();
+ serviceCollection.AddSingleton();
serviceCollection.AddSingleton();
diff --git a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs b/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs
deleted file mode 100644
index 08ee5c72e..000000000
--- a/MediaBrowser.MediaEncoding/Subtitles/AssParser.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Microsoft.Extensions.Logging;
-using Nikse.SubtitleEdit.Core.SubtitleFormats;
-
-namespace MediaBrowser.MediaEncoding.Subtitles
-{
- ///
- /// Advanced SubStation Alpha subtitle parser.
- ///
- public class AssParser : SubtitleEditParser
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// The logger.
- public AssParser(ILogger logger) : base(logger)
- {
- }
- }
-}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/ISubtitleParser.cs b/MediaBrowser.MediaEncoding/Subtitles/ISubtitleParser.cs
index c0023ebf2..bd13437fb 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/ISubtitleParser.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/ISubtitleParser.cs
@@ -1,7 +1,6 @@
#pragma warning disable CS1591
using System.IO;
-using System.Threading;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.MediaEncoding.Subtitles
@@ -12,8 +11,15 @@ namespace MediaBrowser.MediaEncoding.Subtitles
/// Parses the specified stream.
///
/// The stream.
- /// The cancellation token.
+ /// The file extension.
/// SubtitleTrackInfo.
- SubtitleTrackInfo Parse(Stream stream, CancellationToken cancellationToken);
+ SubtitleTrackInfo Parse(Stream stream, string fileExtension);
+
+ ///
+ /// Determines whether the file extension is supported by the parser.
+ ///
+ /// The file extension.
+ /// A value indicating whether the file extension is supported.
+ bool SupportsFileExtension(string fileExtension);
}
}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs
deleted file mode 100644
index 78d54ca51..000000000
--- a/MediaBrowser.MediaEncoding/Subtitles/SrtParser.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Microsoft.Extensions.Logging;
-using Nikse.SubtitleEdit.Core.SubtitleFormats;
-
-namespace MediaBrowser.MediaEncoding.Subtitles
-{
- ///
- /// SubRip subtitle parser.
- ///
- public class SrtParser : SubtitleEditParser
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// The logger.
- public SrtParser(ILogger logger) : base(logger)
- {
- }
- }
-}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs
deleted file mode 100644
index 17c2ae40e..000000000
--- a/MediaBrowser.MediaEncoding/Subtitles/SsaParser.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Microsoft.Extensions.Logging;
-using Nikse.SubtitleEdit.Core.SubtitleFormats;
-
-namespace MediaBrowser.MediaEncoding.Subtitles
-{
- ///
- /// SubStation Alpha subtitle parser.
- ///
- public class SsaParser : SubtitleEditParser
- {
- ///
- /// Initializes a new instance of the class.
- ///
- /// The logger.
- public SsaParser(ILogger logger) : base(logger)
- {
- }
- }
-}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
index 52c1b6467..eb8ff9624 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEditParser.cs
@@ -1,12 +1,14 @@
+using System;
+using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
-using System.Threading;
+using System.Reflection;
using Jellyfin.Extensions;
using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging;
using Nikse.SubtitleEdit.Core.Common;
-using ILogger = Microsoft.Extensions.Logging.ILogger;
+using Nikse.SubtitleEdit.Core.SubtitleFormats;
using SubtitleFormat = Nikse.SubtitleEdit.Core.SubtitleFormats.SubtitleFormat;
namespace MediaBrowser.MediaEncoding.Subtitles
@@ -14,31 +16,57 @@ namespace MediaBrowser.MediaEncoding.Subtitles
///
/// SubStation Alpha subtitle parser.
///
- /// The .
- public abstract class SubtitleEditParser : ISubtitleParser
- where T : SubtitleFormat, new()
+ public class SubtitleEditParser : ISubtitleParser
{
- private readonly ILogger _logger;
+ private readonly ILogger _logger;
+ private readonly Dictionary _subtitleFormats;
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
/// The logger.
- protected SubtitleEditParser(ILogger logger)
+ public SubtitleEditParser(ILogger logger)
{
_logger = logger;
+ _subtitleFormats = GetSubtitleFormats()
+ .Where(subtitleFormat => !string.IsNullOrEmpty(subtitleFormat.Extension))
+ .GroupBy(subtitleFormat => subtitleFormat.Extension.TrimStart('.'), StringComparer.OrdinalIgnoreCase)
+ .ToDictionary(g => g.Key, g => g.ToArray(), StringComparer.OrdinalIgnoreCase);
}
///
- public SubtitleTrackInfo Parse(Stream stream, CancellationToken cancellationToken)
+ public SubtitleTrackInfo Parse(Stream stream, string fileExtension)
{
var subtitle = new Subtitle();
- var subRip = new T();
var lines = stream.ReadAllLines().ToList();
- subRip.LoadSubtitle(subtitle, lines, "untitled");
- if (subRip.ErrorCount > 0)
+
+ if (!_subtitleFormats.TryGetValue(fileExtension, out var subtitleFormats))
+ {
+ throw new ArgumentException($"Unsupported file extension: {fileExtension}", nameof(fileExtension));
+ }
+
+ foreach (var subtitleFormat in subtitleFormats)
{
- _logger.LogError("{ErrorCount} errors encountered while parsing subtitle", subRip.ErrorCount);
+ _logger.LogDebug(
+ "Trying to parse '{FileExtension}' subtitle using the {SubtitleFormatParser} format parser",
+ fileExtension,
+ subtitleFormat.Name);
+ subtitleFormat.LoadSubtitle(subtitle, lines, fileExtension);
+ if (subtitleFormat.ErrorCount == 0)
+ {
+ break;
+ }
+
+ _logger.LogError(
+ "{ErrorCount} errors encountered while parsing '{FileExtension}' subtitle using the {SubtitleFormatParser} format parser",
+ subtitleFormat.ErrorCount,
+ fileExtension,
+ subtitleFormat.Name);
+ }
+
+ if (subtitle.Paragraphs.Count == 0)
+ {
+ throw new ArgumentException("Unsupported format: " + fileExtension);
}
var trackInfo = new SubtitleTrackInfo();
@@ -57,5 +85,36 @@ namespace MediaBrowser.MediaEncoding.Subtitles
trackInfo.TrackEvents = trackEvents;
return trackInfo;
}
+
+ ///
+ public bool SupportsFileExtension(string fileExtension)
+ => _subtitleFormats.ContainsKey(fileExtension);
+
+ private IEnumerable GetSubtitleFormats()
+ {
+ var subtitleFormats = new List();
+ var assembly = typeof(SubtitleFormat).Assembly;
+
+ foreach (var type in assembly.GetTypes())
+ {
+ if (!type.IsSubclassOf(typeof(SubtitleFormat)) || type.IsAbstract)
+ {
+ continue;
+ }
+
+ try
+ {
+ // It shouldn't be null, but the exception is caught if it is
+ var subtitleFormat = (SubtitleFormat)Activator.CreateInstance(type, true)!;
+ subtitleFormats.Add(subtitleFormat);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogWarning(ex, "Failed to create instance of the subtitle format {SubtitleFormatType}", type.Name);
+ }
+ }
+
+ return subtitleFormats;
+ }
}
}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 7091af734..50c4d9210 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -35,6 +35,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
private readonly IMediaEncoder _mediaEncoder;
private readonly IHttpClientFactory _httpClientFactory;
private readonly IMediaSourceManager _mediaSourceManager;
+ private readonly ISubtitleParser _subtitleParser;
///
/// The _semaphoreLocks.
@@ -48,7 +49,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
IFileSystem fileSystem,
IMediaEncoder mediaEncoder,
IHttpClientFactory httpClientFactory,
- IMediaSourceManager mediaSourceManager)
+ IMediaSourceManager mediaSourceManager,
+ ISubtitleParser subtitleParser)
{
_logger = logger;
_appPaths = appPaths;
@@ -56,6 +58,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
_mediaEncoder = mediaEncoder;
_httpClientFactory = httpClientFactory;
_mediaSourceManager = mediaSourceManager;
+ _subtitleParser = subtitleParser;
}
private string SubtitleCachePath => Path.Combine(_appPaths.DataPath, "subtitles");
@@ -73,8 +76,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
try
{
- var reader = GetReader(inputFormat);
- var trackInfo = reader.Parse(stream, cancellationToken);
+ var trackInfo = _subtitleParser.Parse(stream, inputFormat);
FilterEvents(trackInfo, startTimeTicks, endTimeTicks, preserveOriginalTimestamps);
@@ -233,7 +235,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
var currentFormat = (Path.GetExtension(subtitleStream.Path) ?? subtitleStream.Codec)
.TrimStart('.');
- if (!TryGetReader(currentFormat, out _))
+ // Fallback to ffmpeg conversion
+ if (!_subtitleParser.SupportsFileExtension(currentFormat))
{
// Convert
var outputPath = GetSubtitleCachePath(mediaSource, subtitleStream.Index, ".srt");
@@ -243,44 +246,10 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return new SubtitleInfo(outputPath, MediaProtocol.File, "srt", true);
}
- // It's possbile that the subtitleStream and mediaSource don't share the same protocol (e.g. .STRM file with local subs)
+ // It's possible that the subtitleStream and mediaSource don't share the same protocol (e.g. .STRM file with local subs)
return new SubtitleInfo(subtitleStream.Path, _mediaSourceManager.GetPathProtocol(subtitleStream.Path), currentFormat, true);
}
- private bool TryGetReader(string format, [NotNullWhen(true)] out ISubtitleParser? value)
- {
- if (string.Equals(format, SubtitleFormat.SRT, StringComparison.OrdinalIgnoreCase))
- {
- value = new SrtParser(_logger);
- return true;
- }
-
- if (string.Equals(format, SubtitleFormat.SSA, StringComparison.OrdinalIgnoreCase))
- {
- value = new SsaParser(_logger);
- return true;
- }
-
- if (string.Equals(format, SubtitleFormat.ASS, StringComparison.OrdinalIgnoreCase))
- {
- value = new AssParser(_logger);
- return true;
- }
-
- value = null;
- return false;
- }
-
- private ISubtitleParser GetReader(string format)
- {
- if (TryGetReader(format, out var reader))
- {
- return reader;
- }
-
- throw new ArgumentException("Unsupported format: " + format);
- }
-
private bool TryGetWriter(string format, [NotNullWhen(true)] out ISubtitleWriter? value)
{
if (string.Equals(format, SubtitleFormat.ASS, StringComparison.OrdinalIgnoreCase))
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs
index 3775555de..e14850eed 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/AssParserTests.cs
@@ -15,7 +15,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
using (var stream = File.OpenRead("Test Data/example.ass"))
{
- var parsed = new AssParser(new NullLogger()).Parse(stream, CancellationToken.None);
+ var parsed = new SubtitleEditParser(new NullLogger()).Parse(stream, "ass");
Assert.Single(parsed.TrackEvents);
var trackEvent = parsed.TrackEvents[0];
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs
index c07c9ea7d..0038b1873 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SrtParserTests.cs
@@ -15,7 +15,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
using (var stream = File.OpenRead("Test Data/example.srt"))
{
- var parsed = new SrtParser(new NullLogger()).Parse(stream, CancellationToken.None);
+ var parsed = new SubtitleEditParser(new NullLogger()).Parse(stream, "srt");
Assert.Equal(2, parsed.TrackEvents.Count);
var trackEvent1 = parsed.TrackEvents[0];
@@ -37,7 +37,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
using (var stream = File.OpenRead("Test Data/example2.srt"))
{
- var parsed = new SrtParser(new NullLogger()).Parse(stream, CancellationToken.None);
+ var parsed = new SubtitleEditParser(new NullLogger()).Parse(stream, "srt");
Assert.Equal(2, parsed.TrackEvents.Count);
var trackEvent1 = parsed.TrackEvents[0];
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs
index 56649db8f..3b9a71690 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SsaParserTests.cs
@@ -13,7 +13,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
public class SsaParserTests
{
- private readonly SsaParser _parser = new SsaParser(new NullLogger());
+ private readonly SubtitleEditParser _parser = new SubtitleEditParser(new NullLogger());
[Theory]
[MemberData(nameof(Parse_MultipleDialogues_TestData))]
@@ -21,7 +21,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(ssa)))
{
- SubtitleTrackInfo subtitleTrackInfo = _parser.Parse(stream, CancellationToken.None);
+ SubtitleTrackInfo subtitleTrackInfo = _parser.Parse(stream, "ssa");
Assert.Equal(expectedSubtitleTrackEvents.Count, subtitleTrackInfo.TrackEvents.Count);
@@ -76,7 +76,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
using (var stream = File.OpenRead("Test Data/example.ssa"))
{
- var parsed = _parser.Parse(stream, CancellationToken.None);
+ var parsed = _parser.Parse(stream, "ssa");
Assert.Single(parsed.TrackEvents);
var trackEvent = parsed.TrackEvents[0];
--
cgit v1.2.3
From 3e5cf9395fb9493a4a4324c1dde5390fb85870a4 Mon Sep 17 00:00:00 2001
From: Shadowghost
Date: Sat, 13 Aug 2022 21:46:33 -0400
Subject: Backport pull request #8182 from jellyfin/release-10.8.z
Extract external subs from container before determining characterset
Original-merge: 1faee43b1103428392d305cb0d1b46ff3ab6b5fc
Merged-by: Bond-009
Backported-by: Joshua Boniface
---
.../MediaEncoding/EncodingHelper.cs | 13 ++--
.../MediaEncoding/ISubtitleEncoder.cs | 9 ++-
.../Subtitles/SubtitleEncoder.cs | 89 ++++++++++++----------
3 files changed, 60 insertions(+), 51 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 7c59fa300..e5aae620a 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -1152,16 +1152,15 @@ namespace MediaBrowser.Controller.MediaEncoding
if (state.SubtitleStream.IsExternal)
{
- var subtitlePath = state.SubtitleStream.Path;
var charsetParam = string.Empty;
if (!string.IsNullOrEmpty(state.SubtitleStream.Language))
{
var charenc = _subtitleEncoder.GetSubtitleFileCharacterSet(
- subtitlePath,
- state.SubtitleStream.Language,
- state.MediaSource.Protocol,
- CancellationToken.None).GetAwaiter().GetResult();
+ state.SubtitleStream,
+ state.SubtitleStream.Language,
+ state.MediaSource,
+ CancellationToken.None).GetAwaiter().GetResult();
if (!string.IsNullOrEmpty(charenc))
{
@@ -1173,7 +1172,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return string.Format(
CultureInfo.InvariantCulture,
"subtitles=f='{0}'{1}{2}{3}{4}{5}",
- _mediaEncoder.EscapeSubtitleFilterPath(subtitlePath),
+ _mediaEncoder.EscapeSubtitleFilterPath(state.SubtitleStream.Path),
charsetParam,
alphaParam,
sub2videoParam,
@@ -5536,7 +5535,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return index;
}
- if (string.Equals(currentMediaStream.Path, streamToFind.Path, StringComparison.Ordinal))
+ if (string.Equals(currentMediaStream.Path, streamToFind.Path, StringComparison.Ordinal))
{
index++;
}
diff --git a/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs b/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs
index 4483cf708..5bf83a9e3 100644
--- a/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs
+++ b/MediaBrowser.Controller/MediaEncoding/ISubtitleEncoder.cs
@@ -6,7 +6,8 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
-using MediaBrowser.Model.MediaInfo;
+using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.MediaEncoding
{
@@ -37,11 +38,11 @@ namespace MediaBrowser.Controller.MediaEncoding
///
/// Gets the subtitle language encoding parameter.
///
- /// The path.
+ /// The subtitle stream.
/// The language.
- /// The protocol.
+ /// The media source.
/// The cancellation token.
/// System.String.
- Task GetSubtitleFileCharacterSet(string path, string language, MediaProtocol protocol, CancellationToken cancellationToken);
+ Task GetSubtitleFileCharacterSet(MediaStream subtitleStream, string language, MediaSourceInfo mediaSource, CancellationToken cancellationToken);
}
}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 50c4d9210..6112fda68 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -241,7 +241,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
// Convert
var outputPath = GetSubtitleCachePath(mediaSource, subtitleStream.Index, ".srt");
- await ConvertTextSubtitleToSrt(subtitleStream.Path, subtitleStream.Language, mediaSource, outputPath, cancellationToken).ConfigureAwait(false);
+ await ConvertTextSubtitleToSrt(subtitleStream, mediaSource, outputPath, cancellationToken).ConfigureAwait(false);
return new SubtitleInfo(outputPath, MediaProtocol.File, "srt", true);
}
@@ -320,13 +320,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles
///
/// Converts the text subtitle to SRT.
///
- /// The input path.
- /// The language.
+ /// The subtitle stream.
/// The input mediaSource.
/// The output path.
/// The cancellation token.
/// Task.
- private async Task ConvertTextSubtitleToSrt(string inputPath, string language, MediaSourceInfo mediaSource, string outputPath, CancellationToken cancellationToken)
+ private async Task ConvertTextSubtitleToSrt(MediaStream subtitleStream, MediaSourceInfo mediaSource, string outputPath, CancellationToken cancellationToken)
{
var semaphore = GetLock(outputPath);
@@ -336,7 +335,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
if (!File.Exists(outputPath))
{
- await ConvertTextSubtitleToSrtInternal(inputPath, language, mediaSource, outputPath, cancellationToken).ConfigureAwait(false);
+ await ConvertTextSubtitleToSrtInternal(subtitleStream, mediaSource, outputPath, cancellationToken).ConfigureAwait(false);
}
}
finally
@@ -348,8 +347,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
///
/// Converts the text subtitle to SRT internal.
///
- /// The input path.
- /// The language.
+ /// The subtitle stream.
/// The input mediaSource.
/// The output path.
/// The cancellation token.
@@ -357,8 +355,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
///
/// The inputPath or outputPath is null.
///
- private async Task ConvertTextSubtitleToSrtInternal(string inputPath, string language, MediaSourceInfo mediaSource, string outputPath, CancellationToken cancellationToken)
+ private async Task ConvertTextSubtitleToSrtInternal(MediaStream subtitleStream, MediaSourceInfo mediaSource, string outputPath, CancellationToken cancellationToken)
{
+ var inputPath = subtitleStream.Path;
if (string.IsNullOrEmpty(inputPath))
{
throw new ArgumentNullException(nameof(inputPath));
@@ -371,7 +370,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
Directory.CreateDirectory(Path.GetDirectoryName(outputPath) ?? throw new ArgumentException($"Provided path ({outputPath}) is not valid.", nameof(outputPath)));
- var encodingParam = await GetSubtitleFileCharacterSet(inputPath, language, mediaSource.Protocol, cancellationToken).ConfigureAwait(false);
+ var encodingParam = await GetSubtitleFileCharacterSet(subtitleStream, subtitleStream.Language, mediaSource, cancellationToken).ConfigureAwait(false);
// FFmpeg automatically convert character encoding when it is UTF-16
// If we specify character encoding, it rejects with "do not specify a character encoding" and "Unable to recode subtitle event"
@@ -389,18 +388,18 @@ namespace MediaBrowser.MediaEncoding.Subtitles
int exitCode;
using (var process = new Process
+ {
+ StartInfo = new ProcessStartInfo
{
- StartInfo = new ProcessStartInfo
- {
- CreateNoWindow = true,
- UseShellExecute = false,
- FileName = _mediaEncoder.EncoderPath,
- Arguments = string.Format(CultureInfo.InvariantCulture, "{0} -i \"{1}\" -c:s srt \"{2}\"", encodingParam, inputPath, outputPath),
- WindowStyle = ProcessWindowStyle.Hidden,
- ErrorDialog = false
- },
- EnableRaisingEvents = true
- })
+ CreateNoWindow = true,
+ UseShellExecute = false,
+ FileName = _mediaEncoder.EncoderPath,
+ Arguments = string.Format(CultureInfo.InvariantCulture, "{0} -i \"{1}\" -c:s srt \"{2}\"", encodingParam, inputPath, outputPath),
+ WindowStyle = ProcessWindowStyle.Hidden,
+ ErrorDialog = false
+ },
+ EnableRaisingEvents = true
+ })
{
_logger.LogInformation("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
@@ -540,7 +539,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
var processArgs = string.Format(
CultureInfo.InvariantCulture,
- "-i {0} -map 0:{1} -an -vn -c:s {2} \"{3}\"",
+ "-i {0} -copyts -map 0:{1} -an -vn -c:s {2} \"{3}\"",
inputPath,
subtitleStreamIndex,
outputCodec,
@@ -549,18 +548,18 @@ namespace MediaBrowser.MediaEncoding.Subtitles
int exitCode;
using (var process = new Process
+ {
+ StartInfo = new ProcessStartInfo
{
- StartInfo = new ProcessStartInfo
- {
- CreateNoWindow = true,
- UseShellExecute = false,
- FileName = _mediaEncoder.EncoderPath,
- Arguments = processArgs,
- WindowStyle = ProcessWindowStyle.Hidden,
- ErrorDialog = false
- },
- EnableRaisingEvents = true
- })
+ CreateNoWindow = true,
+ UseShellExecute = false,
+ FileName = _mediaEncoder.EncoderPath,
+ Arguments = processArgs,
+ WindowStyle = ProcessWindowStyle.Hidden,
+ ErrorDialog = false
+ },
+ EnableRaisingEvents = true
+ })
{
_logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments);
@@ -698,9 +697,19 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
///
- public async Task GetSubtitleFileCharacterSet(string path, string language, MediaProtocol protocol, CancellationToken cancellationToken)
+ public async Task GetSubtitleFileCharacterSet(MediaStream subtitleStream, string language, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
{
- using (var stream = await GetStream(path, protocol, cancellationToken).ConfigureAwait(false))
+ var subtitleCodec = subtitleStream.Codec;
+ var path = subtitleStream.Path;
+
+ if (path.EndsWith(".mks", StringComparison.OrdinalIgnoreCase))
+ {
+ path = GetSubtitleCachePath(mediaSource, subtitleStream.Index, "." + subtitleCodec);
+ await ExtractTextSubtitle(mediaSource, subtitleStream, subtitleCodec, path, cancellationToken)
+ .ConfigureAwait(false);
+ }
+
+ using (var stream = await GetStream(path, mediaSource.Protocol, cancellationToken).ConfigureAwait(false))
{
var charset = CharsetDetector.DetectFromStream(stream).Detected?.EncodingName ?? string.Empty;
@@ -723,12 +732,12 @@ namespace MediaBrowser.MediaEncoding.Subtitles
switch (protocol)
{
case MediaProtocol.Http:
- {
- using var response = await _httpClientFactory.CreateClient(NamedClient.Default)
- .GetAsync(new Uri(path), cancellationToken)
- .ConfigureAwait(false);
- return await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
- }
+ {
+ using var response = await _httpClientFactory.CreateClient(NamedClient.Default)
+ .GetAsync(new Uri(path), cancellationToken)
+ .ConfigureAwait(false);
+ return await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
+ }
case MediaProtocol.File:
return AsyncFile.OpenRead(path);
--
cgit v1.2.3
From 7391b001eff764d88fad8f35daffa1de0ca0960e Mon Sep 17 00:00:00 2001
From: MagicGreenDragon <14246920+MagicGreenDragon@users.noreply.github.com>
Date: Sun, 14 Aug 2022 08:53:00 +0200
Subject: increased subtitle extraction timeout to 30 min
---
CONTRIBUTORS.md | 1 +
MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 87086a728..fb582238d 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -157,6 +157,7 @@
- [jonas-resch](https://github.com/jonas-resch)
- [vgambier](https://github.com/vgambier)
- [MinecraftPlaye](https://github.com/MinecraftPlaye)
+ - [RealGreenDragon](https://github.com/RealGreenDragon)
# Emby Contributors
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 50c4d9210..41354a0b9 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -575,7 +575,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
throw;
}
- var ranToCompletion = await process.WaitForExitAsync(TimeSpan.FromMinutes(5)).ConfigureAwait(false);
+ var ranToCompletion = await process.WaitForExitAsync(TimeSpan.FromMinutes(30)).ConfigureAwait(false);
if (!ranToCompletion)
{
--
cgit v1.2.3
From 9ec2870b1034e0b64ebde3e29a3779c7f6bb2ac4 Mon Sep 17 00:00:00 2001
From: luz paz
Date: Mon, 15 Aug 2022 06:48:34 -0400
Subject: Fix various typos
Found via `codespell -q 3 -S ./Emby.Server.Implementations/Localization -L allready,doesnt,inh,receivedfrom,whoknows`
---
Emby.Dlna/Didl/DidlBuilder.cs | 2 +-
Emby.Dlna/DlnaManager.cs | 2 +-
Emby.Dlna/IDlnaEventManager.cs | 4 ++--
Emby.Server.Implementations/Library/LibraryManager.cs | 2 +-
.../Library/Resolvers/Movies/MovieResolver.cs | 2 +-
Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs | 2 +-
Emby.Server.Implementations/Session/SessionManager.cs | 2 +-
.../Session/SessionWebSocketListener.cs | 2 +-
Jellyfin.Api/Controllers/AudioController.cs | 2 +-
Jellyfin.Api/Controllers/DynamicHlsController.cs | 4 ++--
Jellyfin.Api/Controllers/SearchController.cs | 6 +++---
Jellyfin.Api/Controllers/UserController.cs | 2 +-
Jellyfin.Api/Models/StreamingDtos/StreamState.cs | 2 +-
.../Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs | 4 ++--
Jellyfin.Drawing.Skia/SkiaHelper.cs | 2 +-
Jellyfin.Networking/Configuration/NetworkConfiguration.cs | 2 +-
Jellyfin.Networking/Manager/NetworkManager.cs | 2 +-
MediaBrowser.Controller/Entities/TV/Season.cs | 2 +-
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 4 ++--
.../SyncPlay/GroupStates/WaitingGroupState.cs | 2 +-
.../PlaybackRequests/RemoveFromPlaylistGroupRequest.cs | 4 ++--
MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs | 4 ++--
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 4 ++--
MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs | 2 +-
MediaBrowser.Model/Dto/BaseItemDto.cs | 6 +++---
MediaBrowser.Model/Entities/MediaStream.cs | 2 +-
MediaBrowser.Model/SyncPlay/GroupStateType.cs | 2 +-
MediaBrowser.Model/Tasks/ITaskManager.cs | 10 +++++-----
MediaBrowser.Model/Tasks/ITaskTrigger.cs | 4 ++--
MediaBrowser.Providers/Manager/ProviderManager.cs | 2 +-
.../Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs | 2 +-
MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs | 2 +-
src/Jellyfin.Extensions/SplitStringExtensions.cs | 2 +-
src/Jellyfin.Extensions/StringExtensions.cs | 2 +-
tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs | 6 +++---
tests/Jellyfin.Networking.Tests/NetworkParseTests.cs | 2 +-
.../LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs | 2 +-
.../Test Data/Updates/manifest-stable.json | 2 +-
38 files changed, 56 insertions(+), 56 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs
index df6539a5a..8e3a335c6 100644
--- a/Emby.Dlna/Didl/DidlBuilder.cs
+++ b/Emby.Dlna/Didl/DidlBuilder.cs
@@ -446,7 +446,7 @@ namespace Emby.Dlna.Didl
///
///
/// If context is a season, this will return a string containing just episode number and name.
- /// Otherwise the result will include series nams and season number.
+ /// Otherwise the result will include series names and season number.
///
/// The episode.
/// Current context.
diff --git a/Emby.Dlna/DlnaManager.cs b/Emby.Dlna/DlnaManager.cs
index fe78d74ee..74624334b 100644
--- a/Emby.Dlna/DlnaManager.cs
+++ b/Emby.Dlna/DlnaManager.cs
@@ -123,7 +123,7 @@ namespace Emby.Dlna
///
/// Attempts to match a device with a profile.
/// Rules:
- /// - If the profile field has no value, the field matches irregardless of its contents.
+ /// - If the profile field has no value, the field matches regardless of its contents.
/// - the profile field can be an exact match, or a reg exp.
///
/// The of the device.
diff --git a/Emby.Dlna/IDlnaEventManager.cs b/Emby.Dlna/IDlnaEventManager.cs
index 33cf0896b..eea030d6d 100644
--- a/Emby.Dlna/IDlnaEventManager.cs
+++ b/Emby.Dlna/IDlnaEventManager.cs
@@ -16,7 +16,7 @@ namespace Emby.Dlna
///
/// The subscription identifier.
/// The notification type.
- /// The requested timeout as a sting.
+ /// The requested timeout as a string.
/// The callback url.
/// The response.
EventSubscriptionResponse RenewEventSubscription(string subscriptionId, string notificationType, string requestedTimeoutString, string callbackUrl);
@@ -25,7 +25,7 @@ namespace Emby.Dlna
/// Creates the event subscription.
///
/// The notification type.
- /// The requested timeout as a sting.
+ /// The requested timeout as a string.
/// The callback url.
/// The response.
EventSubscriptionResponse CreateEventSubscription(string notificationType, string requestedTimeoutString, string callbackUrl);
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 2843fb8f8..679684552 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -2529,7 +2529,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
- _logger.LogError(ex, "Error reading the episode informations with ffprobe. Episode: {EpisodeInfo}", episodeInfo.Path);
+ _logger.LogError(ex, "Error reading the episode information with ffprobe. Episode: {EpisodeInfo}", episodeInfo.Path);
}
var changed = false;
diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
index a60251dac..b2f388a66 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
@@ -387,7 +387,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (!string.IsNullOrEmpty(item.Path))
{
- // check for imdb id - we use full media path, as we can assume, that this will match in any use case (wither id in parent dir or in file name)
+ // check for imdb id - we use full media path, as we can assume, that this will match in any use case (either id in parent dir or in file name)
var imdbid = item.Path.AsSpan().GetAttributeValue("imdbid");
if (!string.IsNullOrWhiteSpace(imdbid))
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
index 708ff52d7..be06356a4 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/M3uParser.cs
@@ -199,7 +199,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
if (string.IsNullOrWhiteSpace(numberString))
{
// Using this as a fallback now as this leads to Problems with channels like "5 USA"
- // where 5 isn't ment to be the channel number
+ // where 5 isn't meant to be the channel number
// Check for channel number with the format from SatIp
// #EXTINF:0,84. VOX Schweiz
// #EXTINF:0,84.0 - VOX Schweiz
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index d25376297..7f927e270 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -1242,7 +1242,7 @@ namespace Emby.Server.Implementations.Session
if (item == null)
{
- _logger.LogError("A non-existant item Id {0} was passed into TranslateItemForPlayback", id);
+ _logger.LogError("A non-existent item Id {0} was passed into TranslateItemForPlayback", id);
return Array.Empty();
}
diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
index a085ee546..fccf50f60 100644
--- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -37,7 +37,7 @@ namespace Emby.Server.Implementations.Session
private const float ForceKeepAliveFactor = 0.75f;
///
- /// Lock used for accesing the KeepAlive cancellation token.
+ /// Lock used for accessing the KeepAlive cancellation token.
///
private readonly object _keepAliveLock = new object();
diff --git a/Jellyfin.Api/Controllers/AudioController.cs b/Jellyfin.Api/Controllers/AudioController.cs
index 54ac06276..94f7a7b82 100644
--- a/Jellyfin.Api/Controllers/AudioController.cs
+++ b/Jellyfin.Api/Controllers/AudioController.cs
@@ -207,7 +207,7 @@ namespace Jellyfin.Api.Controllers
/// Optional. The dlna device profile id to utilize.
/// The play session id.
/// The segment container.
- /// The segment lenght.
+ /// The segment length.
/// The minimum number of segments.
/// The media version id, if playing an alternate version.
/// The device id of the client requesting. Used to stop encoding processes when needed.
diff --git a/Jellyfin.Api/Controllers/DynamicHlsController.cs b/Jellyfin.Api/Controllers/DynamicHlsController.cs
index 1e8d03875..3ed80f662 100644
--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs
+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs
@@ -121,7 +121,7 @@ namespace Jellyfin.Api.Controllers
/// Optional. The dlna device profile id to utilize.
/// The play session id.
/// The segment container.
- /// The segment lenght.
+ /// The segment length.
/// The minimum number of segments.
/// The media version id, if playing an alternate version.
/// The device id of the client requesting. Used to stop encoding processes when needed.
@@ -1832,7 +1832,7 @@ namespace Jellyfin.Api.Controllers
// Set the key frame params for video encoding to match the hls segment time.
args += _encodingHelper.GetHlsVideoKeyFrameArguments(state, codec, state.SegmentLength, isEventPlaylist, startNumber);
- // Currenly b-frames in libx265 breaks the FMP4-HLS playback on iOS, disable it for now.
+ // Currently b-frames in libx265 breaks the FMP4-HLS playback on iOS, disable it for now.
if (string.Equals(codec, "libx265", StringComparison.OrdinalIgnoreCase))
{
args += " -bf 0";
diff --git a/Jellyfin.Api/Controllers/SearchController.cs b/Jellyfin.Api/Controllers/SearchController.cs
index 07e113ad3..3b1f7a52a 100644
--- a/Jellyfin.Api/Controllers/SearchController.cs
+++ b/Jellyfin.Api/Controllers/SearchController.cs
@@ -60,9 +60,9 @@ namespace Jellyfin.Api.Controllers
/// Optional. The maximum number of records to return.
/// Optional. Supply a user id to search within a user's library or omit to search all.
/// The search term to filter on.
- /// If specified, only results with the specified item types are returned. This allows multiple, comma delimeted.
- /// If specified, results with these item types are filtered out. This allows multiple, comma delimeted.
- /// If specified, only results with the specified media types are returned. This allows multiple, comma delimeted.
+ /// If specified, only results with the specified item types are returned. This allows multiple, comma delimited.
+ /// If specified, results with these item types are filtered out. This allows multiple, comma delimited.
+ /// If specified, only results with the specified media types are returned. This allows multiple, comma delimited.
/// If specified, only children of the parent are returned.
/// Optional filter for movies.
/// Optional filter for series.
diff --git a/Jellyfin.Api/Controllers/UserController.cs b/Jellyfin.Api/Controllers/UserController.cs
index 82c8563a8..d1109bebc 100644
--- a/Jellyfin.Api/Controllers/UserController.cs
+++ b/Jellyfin.Api/Controllers/UserController.cs
@@ -502,7 +502,7 @@ namespace Jellyfin.Api.Controllers
if (isLocal)
{
- _logger.LogWarning("Password reset proccess initiated from outside the local network with IP: {IP}", ip);
+ _logger.LogWarning("Password reset process initiated from outside the local network with IP: {IP}", ip);
}
var result = await _userManager.StartForgotPasswordProcess(forgotPasswordRequest.EnteredUsername, isLocal).ConfigureAwait(false);
diff --git a/Jellyfin.Api/Models/StreamingDtos/StreamState.cs b/Jellyfin.Api/Models/StreamingDtos/StreamState.cs
index 192f33ebd..8182e3c9e 100644
--- a/Jellyfin.Api/Models/StreamingDtos/StreamState.cs
+++ b/Jellyfin.Api/Models/StreamingDtos/StreamState.cs
@@ -169,7 +169,7 @@ namespace Jellyfin.Api.Models.StreamingDtos
///
/// Disposes the stream state.
///
- /// Whether the object is currently beeing disposed.
+ /// Whether the object is currently being disposed.
protected virtual void Dispose(bool disposing)
{
if (_disposed)
diff --git a/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs b/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs
index 02ce5a048..226a584e1 100644
--- a/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs
+++ b/Jellyfin.Api/Models/SyncPlayDtos/RemoveFromPlaylistRequestDto.cs
@@ -17,9 +17,9 @@ namespace Jellyfin.Api.Models.SyncPlayDtos
}
///
- /// Gets or sets the playlist identifiers ot the items. Ignored when clearing the playlist.
+ /// Gets or sets the playlist identifiers of the items. Ignored when clearing the playlist.
///
- /// The playlist identifiers ot the items.
+ /// The playlist identifiers of the items.
public IReadOnlyList PlaylistItemIds { get; set; }
///
diff --git a/Jellyfin.Drawing.Skia/SkiaHelper.cs b/Jellyfin.Drawing.Skia/SkiaHelper.cs
index c001c32b8..0478fc7c3 100644
--- a/Jellyfin.Drawing.Skia/SkiaHelper.cs
+++ b/Jellyfin.Drawing.Skia/SkiaHelper.cs
@@ -13,7 +13,7 @@ namespace Jellyfin.Drawing.Skia
///
/// The current skia encoder.
/// The list of image paths.
- /// The current checked indes.
+ /// The current checked index.
/// The new index.
/// A valid bitmap, or null if no bitmap exists after currentIndex.
public static SKBitmap? GetNextValidImage(SkiaEncoder skiaEncoder, IReadOnlyList paths, int currentIndex, out int newIndex)
diff --git a/Jellyfin.Networking/Configuration/NetworkConfiguration.cs b/Jellyfin.Networking/Configuration/NetworkConfiguration.cs
index 61db223d9..361dbc814 100644
--- a/Jellyfin.Networking/Configuration/NetworkConfiguration.cs
+++ b/Jellyfin.Networking/Configuration/NetworkConfiguration.cs
@@ -193,7 +193,7 @@ namespace Jellyfin.Networking.Configuration
public bool AutoDiscovery { get; set; } = true;
///
- /// Gets or sets the filter for remote IP connectivity. Used in conjuntion with .
+ /// Gets or sets the filter for remote IP connectivity. Used in conjunction with .
///
public string[] RemoteIPFilter { get; set; } = Array.Empty();
diff --git a/Jellyfin.Networking/Manager/NetworkManager.cs b/Jellyfin.Networking/Manager/NetworkManager.cs
index 4b7b87814..fd0665dbd 100644
--- a/Jellyfin.Networking/Manager/NetworkManager.cs
+++ b/Jellyfin.Networking/Manager/NetworkManager.cs
@@ -944,7 +944,7 @@ namespace Jellyfin.Networking.Manager
// Add virtual machine interface names to the list of bind exclusions, so that they are auto-excluded.
if (config.IgnoreVirtualInterfaces)
{
- // each virtual interface name must be pre-pended with the exclusion symbol !
+ // each virtual interface name must be prepended with the exclusion symbol !
var virtualInterfaceNames = config.VirtualInterfaceNames.Split(',').Select(p => "!" + p).ToArray();
if (lanAddresses.Length > 0)
{
diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs
index bd8df2fac..599d35da6 100644
--- a/MediaBrowser.Controller/Entities/TV/Season.cs
+++ b/MediaBrowser.Controller/Entities/TV/Season.cs
@@ -244,7 +244,7 @@ namespace MediaBrowser.Controller.Entities.TV
///
/// This is called before any metadata refresh and returns true or false indicating if changes were made.
///
- /// true to replace metdata, false to not.
+ /// true to replace metadata, false to not.
/// true if XXXX, false otherwise.
public override bool BeforeMetadataRefresh(bool replaceAllMetadata)
{
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index e5aae620a..17e410fe1 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -194,7 +194,7 @@ namespace MediaBrowser.Controller.MediaEncoding
///
/// Gets the name of the output video codec.
///
- /// Encording state.
+ /// Encoding state.
/// Encoding options.
/// Encoder string.
public string GetVideoEncoder(EncodingJobInfo state, EncodingOptions encodingOptions)
@@ -1980,7 +1980,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
- // Cap the max target bitrate to intMax/2 to satisify the bufsize=bitrate*2.
+ // Cap the max target bitrate to intMax/2 to satisfy the bufsize=bitrate*2.
return Math.Min(bitrate ?? 0, int.MaxValue / 2);
}
diff --git a/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs b/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs
index a0c38b309..216494556 100644
--- a/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs
+++ b/MediaBrowser.Controller/SyncPlay/GroupStates/WaitingGroupState.cs
@@ -549,7 +549,7 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
if (InitialState.Equals(GroupStateType.Playing))
{
- // Group went from playing to waiting state and a pause request occured while waiting.
+ // Group went from playing to waiting state and a pause request occurred while waiting.
var pauseRequest = new PauseGroupRequest();
pausedState.HandleRequest(pauseRequest, context, Type, session, cancellationToken);
}
diff --git a/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs b/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs
index 2f38d6adc..619294e95 100644
--- a/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs
+++ b/MediaBrowser.Controller/SyncPlay/PlaybackRequests/RemoveFromPlaylistGroupRequest.cs
@@ -27,9 +27,9 @@ namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
}
///
- /// Gets the playlist identifiers ot the items.
+ /// Gets the playlist identifiers of the items.
///
- /// The playlist identifiers ot the items.
+ /// The playlist identifiers of the items.
public IReadOnlyList PlaylistItemIds { get; }
///
diff --git a/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs b/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
index f49876cca..3a7685f34 100644
--- a/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
+++ b/MediaBrowser.Controller/SyncPlay/Queue/PlayQueueManager.cs
@@ -102,7 +102,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
}
///
- /// Appends new items to the playlist. The specified order is mantained.
+ /// Appends new items to the playlist. The specified order is maintained.
///
/// The items to add to the playlist.
public void Queue(IReadOnlyList items)
@@ -197,7 +197,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
}
///
- /// Adds new items to the playlist right after the playing item. The specified order is mantained.
+ /// Adds new items to the playlist right after the playing item. The specified order is maintained.
///
/// The items to add to the playlist.
public void QueueNext(IReadOnlyList items)
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 77b97c9b4..7f301a9d8 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -619,9 +619,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
Video3DFormat.HalfSideBySide => "crop=iw/2:ih:0:0,scale=(iw*2):ih,setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
// fsbs crop width in half,set the display aspect,crop out any black bars we may have made
Video3DFormat.FullSideBySide => "crop=iw/2:ih:0:0,setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
- // htab crop heigh in half,scale to correct size, set the display aspect,crop out any black bars we may have made
+ // htab crop height in half,scale to correct size, set the display aspect,crop out any black bars we may have made
Video3DFormat.HalfTopAndBottom => "crop=iw:ih/2:0:0,scale=(iw*2):ih),setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
- // ftab crop heigt in half, set the display aspect,crop out any black bars we may have made
+ // ftab crop height in half, set the display aspect,crop out any black bars we may have made
Video3DFormat.FullTopAndBottom => "crop=iw:ih/2:0:0,setdar=dar=a,crop=min(iw\\,ih*dar):min(ih\\,iw/dar):(iw-min(iw\\,iw*sar))/2:(ih - min (ih\\,ih/sar))/2,setsar=sar=1",
_ => "scale=trunc(iw*sar):ih"
};
diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
index 47c36494b..c32c1c108 100644
--- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
+++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs
@@ -157,7 +157,7 @@ namespace MediaBrowser.Model.Dlna
flagValue |= DlnaFlags.ByteBasedSeek;
}
- // Time based seek is curently disabled when streaming. On LG CX3 adding DlnaFlags.TimeBasedSeek and orgPn causes the DLNA playback to fail (format not supported). Further investigations are needed before enabling the remaining code paths.
+ // Time based seek is currently disabled when streaming. On LG CX3 adding DlnaFlags.TimeBasedSeek and orgPn causes the DLNA playback to fail (format not supported). Further investigations are needed before enabling the remaining code paths.
// else if (runtimeTicks.HasValue)
// {
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs
index 094dc73b2..fdb84fa32 100644
--- a/MediaBrowser.Model/Dto/BaseItemDto.cs
+++ b/MediaBrowser.Model/Dto/BaseItemDto.cs
@@ -294,13 +294,13 @@ namespace MediaBrowser.Model.Dto
public NameGuidPair[] GenreItems { get; set; }
///
- /// Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one.
+ /// Gets or sets whether the item has a logo, this will hold the Id of the Parent that has one.
///
/// The parent logo item id.
public Guid? ParentLogoItemId { get; set; }
///
- /// Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one.
+ /// Gets or sets whether the item has any backdrops, this will hold the Id of the Parent that has one.
///
/// The parent backdrop item id.
public Guid? ParentBackdropItemId { get; set; }
@@ -506,7 +506,7 @@ namespace MediaBrowser.Model.Dto
public string ParentLogoImageTag { get; set; }
///
- /// Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one.
+ /// Gets or sets whether the item has fan art, this will hold the Id of the Parent that has one.
///
/// The parent art item id.
public Guid? ParentArtItemId { get; set; }
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index ae8f3b0ed..90a60cf47 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -606,7 +606,7 @@ namespace MediaBrowser.Model.Entities
<= 1024 when Height <= 576 => IsInterlaced ? "576i" : "576p",
// 1280x720
<= 1280 when Height <= 962 => IsInterlaced ? "720i" : "720p",
- // 2560x1080 (FHD ultra wide 21:9) using 1440px width to accomodate WQHD
+ // 2560x1080 (FHD ultra wide 21:9) using 1440px width to accommodate WQHD
<= 2560 when Height <= 1440 => IsInterlaced ? "1080i" : "1080p",
// 4K
<= 4096 when Height <= 3072 => "4K",
diff --git a/MediaBrowser.Model/SyncPlay/GroupStateType.cs b/MediaBrowser.Model/SyncPlay/GroupStateType.cs
index 7aa454f92..96364cacc 100644
--- a/MediaBrowser.Model/SyncPlay/GroupStateType.cs
+++ b/MediaBrowser.Model/SyncPlay/GroupStateType.cs
@@ -11,7 +11,7 @@ namespace MediaBrowser.Model.SyncPlay
Idle = 0,
///
- /// The group is in wating state. Playback is paused. Will start playing when users are ready.
+ /// The group is in waiting state. Playback is paused. Will start playing when users are ready.
///
Waiting = 1,
diff --git a/MediaBrowser.Model/Tasks/ITaskManager.cs b/MediaBrowser.Model/Tasks/ITaskManager.cs
index a86bf2a1c..13bebc479 100644
--- a/MediaBrowser.Model/Tasks/ITaskManager.cs
+++ b/MediaBrowser.Model/Tasks/ITaskManager.cs
@@ -22,7 +22,7 @@ namespace MediaBrowser.Model.Tasks
///
/// Cancels if running and queue.
///
- /// An implementatin of .
+ /// An implementation of .
/// Task options.
void CancelIfRunningAndQueue(TaskOptions options)
where T : IScheduledTask;
@@ -30,21 +30,21 @@ namespace MediaBrowser.Model.Tasks
///
/// Cancels if running and queue.
///
- /// An implementatin of .
+ /// An implementation of .
void CancelIfRunningAndQueue()
where T : IScheduledTask;
///
/// Cancels if running.
///
- /// An implementatin of .
+ /// An implementation of .
void CancelIfRunning()
where T : IScheduledTask;
///
/// Queues the scheduled task.
///
- /// An implementatin of .
+ /// An implementation of .
/// Task options.
void QueueScheduledTask(TaskOptions options)
where T : IScheduledTask;
@@ -52,7 +52,7 @@ namespace MediaBrowser.Model.Tasks
///
/// Queues the scheduled task.
///
- /// An implementatin of .
+ /// An implementation of .
void QueueScheduledTask()
where T : IScheduledTask;
diff --git a/MediaBrowser.Model/Tasks/ITaskTrigger.cs b/MediaBrowser.Model/Tasks/ITaskTrigger.cs
index 8c3ec6626..0536f4ef7 100644
--- a/MediaBrowser.Model/Tasks/ITaskTrigger.cs
+++ b/MediaBrowser.Model/Tasks/ITaskTrigger.cs
@@ -21,10 +21,10 @@ namespace MediaBrowser.Model.Tasks
///
/// Stars waiting for the trigger action.
///
- /// Result of the last run triggerd task.
+ /// Result of the last run triggered task.
/// The .
/// The name of the task.
- /// Wheter or not this is is fired during startup.
+ /// Whether or not this is is fired during startup.
void Start(TaskResult? lastResult, ILogger logger, string taskName, bool isApplicationStartup);
///
diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs
index 01ff473f0..bbb33ddf0 100644
--- a/MediaBrowser.Providers/Manager/ProviderManager.cs
+++ b/MediaBrowser.Providers/Manager/ProviderManager.cs
@@ -926,7 +926,7 @@ namespace MediaBrowser.Providers.Manager
}
catch (Exception ex)
{
- _logger.LogError(ex, "Error in {0}.Suports", i.GetType().Name);
+ _logger.LogError(ex, "Error in {0}.Supports", i.GetType().Name);
return false;
}
});
diff --git a/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs
index 4bf66c098..915fb97fd 100644
--- a/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs
+++ b/MediaBrowser.Providers/Plugins/MusicBrainz/MusicBrainzAlbumProvider.cs
@@ -36,7 +36,7 @@ namespace MediaBrowser.Providers.Music
///
/// The Jellyfin user-agent is unrestricted but source IP must not exceed
/// one request per second, therefore we rate limit to avoid throttling.
- /// Be prudent, use a value slightly above the minimun required.
+ /// Be prudent, use a value slightly above the minimum required.
/// https://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting.
///
private readonly long _musicBrainzQueryIntervalMs;
diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
index 09ff84044..da348239a 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
@@ -1330,7 +1330,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
};
///
- /// Used to split names of comma or pipe delimeted genres and people.
+ /// Used to split names of comma or pipe delimited genres and people.
///
/// The value.
/// IEnumerable{System.String}.
diff --git a/src/Jellyfin.Extensions/SplitStringExtensions.cs b/src/Jellyfin.Extensions/SplitStringExtensions.cs
index 1d1c377f5..a4dc9fc6b 100644
--- a/src/Jellyfin.Extensions/SplitStringExtensions.cs
+++ b/src/Jellyfin.Extensions/SplitStringExtensions.cs
@@ -55,7 +55,7 @@ namespace Jellyfin.Extensions
public static Enumerator Split(this ReadOnlySpan str, char separator) => new(str, separator);
///
- /// Provides an enumerator for the substrings seperated by the separator.
+ /// Provides an enumerator for the substrings separated by the separator.
///
[StructLayout(LayoutKind.Auto)]
public ref struct Enumerator
diff --git a/src/Jellyfin.Extensions/StringExtensions.cs b/src/Jellyfin.Extensions/StringExtensions.cs
index dadc9f1d5..59fb038a7 100644
--- a/src/Jellyfin.Extensions/StringExtensions.cs
+++ b/src/Jellyfin.Extensions/StringExtensions.cs
@@ -40,7 +40,7 @@ namespace Jellyfin.Extensions
}
///
- /// Checks wether or not the specified string has diacritics in it.
+ /// Checks whether or not the specified string has diacritics in it.
///
/// The string to check.
/// True if the string has diacritics, false otherwise.
diff --git a/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs b/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs
index 6948280a3..162f53e56 100644
--- a/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs
+++ b/tests/Jellyfin.Model.Tests/Cryptography/PasswordHashTests.cs
@@ -152,9 +152,9 @@ namespace Jellyfin.Model.Tests.Cryptography
[InlineData("$PBKDF2$$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Empty segment
[InlineData("$PBKDF2$iterations=1000$$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Empty salt segment
[InlineData("$PBKDF2$iterations=1000$69F420$")] // Empty hash segment
- [InlineData("$PBKDF2$=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parmeter
- [InlineData("$PBKDF2$=1000$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parmeter
- [InlineData("$PBKDF2$iterations=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parmeter
+ [InlineData("$PBKDF2$=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parameter
+ [InlineData("$PBKDF2$=1000$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parameter
+ [InlineData("$PBKDF2$iterations=$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D")] // Invalid parameter
[InlineData("$PBKDF2$iterations=1000$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D$")] // Ends on $
[InlineData("$PBKDF2$iterations=1000$69F420$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D$")] // Extra segment
[InlineData("$PBKDF2$iterations=1000$69F420$62FBA410AFCA5B4475F35137AB2E8596B127E4D927BA23F6CC05C067E897042D$anotherone")] // Extra segment
diff --git a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
index 6b9397437..52b0e5a95 100644
--- a/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
+++ b/tests/Jellyfin.Networking.Tests/NetworkParseTests.cs
@@ -393,7 +393,7 @@ namespace Jellyfin.Networking.Tests
// User on external network, internal binding only - so assumption is a proxy forward, return external override.
[InlineData("jellyfin.org", "192.168.1.0/24", "eth16", false, "0.0.0.0=http://helloworld.com", "http://helloworld.com")]
- // User on external network, no binding - so result is the 1st external which is overriden.
+ // User on external network, no binding - so result is the 1st external which is overridden.
[InlineData("jellyfin.org", "192.168.1.0/24", "", false, "0.0.0.0 = http://helloworld.com", "http://helloworld.com")]
// User assumed to be internal, no binding - so result is the 1st internal.
diff --git a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
index 3b3e38bd1..e1d2bb2d5 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/LiveTv/SchedulesDirect/SchedulesDirectDeserializeTests.cs
@@ -18,7 +18,7 @@ namespace Jellyfin.Server.Implementations.Tests.LiveTv.SchedulesDirect
}
///
- /// /token reponse.
+ /// /token response.
///
[Fact]
public void Deserialize_Token_Response_Live_Success()
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json b/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json
index b766e668e..fa8fbd8d2 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json
+++ b/tests/Jellyfin.Server.Implementations.Tests/Test Data/Updates/manifest-stable.json
@@ -253,7 +253,7 @@
"versions": [
{
"version": "5.0.0.0",
- "changelog": "Updated to use NextPVR API v5, no longer compatable with API v4.\n",
+ "changelog": "Updated to use NextPVR API v5, no longer compatible with API v4.\n",
"targetAbi": "10.7.0.0",
"sourceUrl": "https://repo.jellyfin.org/releases/plugin/nextpvr/nextpvr_5.0.0.0.zip",
"checksum": "d70f694d14bf9462ba2b2ebe110068d3",
--
cgit v1.2.3
From 6004060b4ea6e68280c5d2e28799bb91fbc4f38e Mon Sep 17 00:00:00 2001
From: Cody Robibero
Date: Sun, 14 Aug 2022 11:20:01 -0600
Subject: Fix build errors from new warnings
---
MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 2 +-
.../DefaultAuthorizationHandlerTests.cs | 2 +-
.../ModelBinders/CommaDelimitedArrayModelBinderTests.cs | 8 ++++++--
.../ModelBinders/PipeDelimitedArrayModelBinderTests.cs | 8 ++++++--
.../Json/Converters/JsonStringConverterTests.cs | 2 +-
.../Playlist/DynamicHlsPlaylistGeneratorTests.cs | 4 ++--
.../Subtitles/SubtitleEncoderTests.cs | 2 +-
tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs | 2 +-
tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs | 2 +-
tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs | 2 +-
.../Jellyfin.Providers.Tests/MediaInfo/MediaInfoResolverTests.cs | 2 +-
.../Jellyfin.Providers.Tests/MediaInfo/VideoImageProviderTests.cs | 2 +-
.../Sorting/IndexNumberComparerTests.cs | 2 +-
.../Sorting/ParentIndexNumberComparerTests.cs | 2 +-
.../Controllers/DashboardControllerTests.cs | 1 +
.../Controllers/StartupControllerTests.cs | 8 ++++++--
.../Controllers/UserControllerTests.cs | 2 ++
17 files changed, 34 insertions(+), 19 deletions(-)
(limited to 'MediaBrowser.MediaEncoding')
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 8e1acc46c..115f085ff 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -746,7 +746,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
- internal readonly struct SubtitleInfo
+ public readonly struct SubtitleInfo
{
public SubtitleInfo(string path, MediaProtocol protocol, string format, bool isExternal)
{
diff --git a/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs b/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs
index 23c51999f..7c85ddd62 100644
--- a/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs
+++ b/tests/Jellyfin.Api.Tests/Auth/DefaultAuthorizationPolicy/DefaultAuthorizationHandlerTests.cs
@@ -62,7 +62,7 @@ namespace Jellyfin.Api.Tests.Auth.DefaultAuthorizationPolicy
}
}
- private static TheoryData> GetParts_ValidAuthHeader_Success_Data()
+ public static TheoryData> GetParts_ValidAuthHeader_Success_Data()
{
var data = new TheoryData>();
diff --git a/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs b/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs
index 3ae6ae5bd..e37c9d91f 100644
--- a/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs
+++ b/tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs
@@ -192,7 +192,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Empty((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Empty(listResult);
}
[Fact]
@@ -220,7 +222,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Single((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Single(listResult);
}
}
}
diff --git a/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs b/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs
index 938d19a15..7c05ee036 100644
--- a/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs
+++ b/tests/Jellyfin.Api.Tests/ModelBinders/PipeDelimitedArrayModelBinderTests.cs
@@ -192,7 +192,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Empty((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Empty(listResult);
}
[Fact]
@@ -220,7 +222,9 @@ namespace Jellyfin.Api.Tests.ModelBinders
await modelBinder.BindModelAsync(bindingContextMock.Object);
Assert.True(bindingContextMock.Object.Result.IsModelSet);
- Assert.Single((IReadOnlyList?)bindingContextMock.Object.Result.Model);
+ var listResult = (IReadOnlyList?)bindingContextMock.Object.Result.Model;
+ Assert.NotNull(listResult);
+ Assert.Single(listResult);
}
}
}
diff --git a/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs b/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs
index 345f37cbe..77717af70 100644
--- a/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs
+++ b/tests/Jellyfin.Extensions.Tests/Json/Converters/JsonStringConverterTests.cs
@@ -32,7 +32,7 @@ namespace Jellyfin.Extensions.Tests.Json.Converters
const string? input = "123";
const int output = 123;
var deserialized = JsonSerializer.Deserialize(input, _jsonSerializerOptions);
- Assert.Equal(deserialized, output);
+ Assert.Equal(output, deserialized);
}
}
}
diff --git a/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs b/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs
index 79648c4f6..bbacdcd62 100644
--- a/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Hls.Tests/Playlist/DynamicHlsPlaylistGeneratorTests.cs
@@ -53,7 +53,7 @@ namespace Jellyfin.MediaEncoding.Hls.Tests.Playlist
Assert.False(DynamicHlsPlaylistGenerator.IsExtractionAllowedForFile(filePath, allowedExtensions));
}
- private static TheoryData ComputeEqualLengthSegments_Valid_Success_Data()
+ public static TheoryData ComputeEqualLengthSegments_Valid_Success_Data()
{
var data = new TheoryData
{
@@ -67,7 +67,7 @@ namespace Jellyfin.MediaEncoding.Hls.Tests.Playlist
return data;
}
- private static TheoryData ComputeSegments_Valid_Success_Data()
+ public static TheoryData ComputeSegments_Valid_Success_Data()
{
var data = new TheoryData
{
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs
index 639c364df..243127438 100644
--- a/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs
+++ b/tests/Jellyfin.MediaEncoding.Tests/Subtitles/SubtitleEncoderTests.cs
@@ -12,7 +12,7 @@ namespace Jellyfin.MediaEncoding.Subtitles.Tests
{
public class SubtitleEncoderTests
{
- internal static TheoryData GetReadableFile_Valid_TestData()
+ public static TheoryData GetReadableFile_Valid_TestData()
{
var data = new TheoryData();
diff --git a/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs b/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs
index 7c3a7ff6c..a5bdb42d8 100644
--- a/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs
+++ b/tests/Jellyfin.Model.Tests/Drawing/ImageFormatExtensionsTests.cs
@@ -7,7 +7,7 @@ namespace Jellyfin.Model.Drawing;
public static class ImageFormatExtensionsTests
{
- private static TheoryData GetAllImageFormats()
+ public static TheoryData GetAllImageFormats()
{
var theoryTypes = new TheoryData();
foreach (var x in Enum.GetValues())
diff --git a/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs b/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs
index c0931dbcf..08b343cd8 100644
--- a/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs
+++ b/tests/Jellyfin.Providers.Tests/Manager/ItemImageProviderTests.cs
@@ -44,7 +44,7 @@ namespace Jellyfin.Providers.Tests.Manager
ValidateImages_Test(ImageType.Primary, 0, true, 0, false, 0);
}
- private static TheoryData GetImageTypesWithCount()
+ public static TheoryData GetImageTypesWithCount()
{
var theoryTypes = new TheoryData
{
diff --git a/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs b/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs
index b74b331b7..28b2e1d8f 100644
--- a/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs
+++ b/tests/Jellyfin.Providers.Tests/Manager/MetadataServiceTests.cs
@@ -132,7 +132,7 @@ namespace Jellyfin.Providers.Tests.Manager
Assert.True(TestMergeBaseItemData