aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2023-05-09 15:25:41 +0200
committerShadowghost <Ghost_of_Stone@web.de>2023-05-09 15:25:41 +0200
commit6cc1203c1b423ee2765be7e33aad56be374c8314 (patch)
tree57ce21874de41124f2626c5f06328bcb2e9734d5 /MediaBrowser.MediaEncoding
parent520c07e8cad3e4372f6a5214160d1600106a7bfd (diff)
parent92a0d26f31743ca0015fcc3e0a4fe094792ac63c (diff)
Merge branch 'master' into network-rewrite
Diffstat (limited to 'MediaBrowser.MediaEncoding')
-rw-r--r--MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs12
-rw-r--r--MediaBrowser.MediaEncoding/BdInfo/BdInfoDirectoryInfo.cs3
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs13
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs30
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs8
5 files changed, 33 insertions, 33 deletions
diff --git a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
index 80091bf5a..989e386a5 100644
--- a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
+++ b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs
@@ -231,10 +231,8 @@ namespace MediaBrowser.MediaEncoding.Attachments
throw new InvalidOperationException(
string.Format(CultureInfo.InvariantCulture, "ffmpeg attachment extraction failed for {0} to {1}", inputPath, outputPath));
}
- else
- {
- _logger.LogInformation("ffmpeg attachment extraction completed for {Path} to {Path}", inputPath, outputPath);
- }
+
+ _logger.LogInformation("ffmpeg attachment extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
}
private async Task<Stream> GetAttachmentStream(
@@ -376,10 +374,8 @@ namespace MediaBrowser.MediaEncoding.Attachments
throw new InvalidOperationException(
string.Format(CultureInfo.InvariantCulture, "ffmpeg attachment extraction failed for {0} to {1}", inputPath, outputPath));
}
- else
- {
- _logger.LogInformation("ffmpeg attachment extraction completed for {Path} to {Path}", inputPath, outputPath);
- }
+
+ _logger.LogInformation("ffmpeg attachment extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
}
private string GetAttachmentCachePath(string mediaPath, MediaSourceInfo mediaSource, int attachmentStreamIndex)
diff --git a/MediaBrowser.MediaEncoding/BdInfo/BdInfoDirectoryInfo.cs b/MediaBrowser.MediaEncoding/BdInfo/BdInfoDirectoryInfo.cs
index ea520b1d6..fca17d4c0 100644
--- a/MediaBrowser.MediaEncoding/BdInfo/BdInfoDirectoryInfo.cs
+++ b/MediaBrowser.MediaEncoding/BdInfo/BdInfoDirectoryInfo.cs
@@ -1,4 +1,3 @@
-using System;
using System.IO;
using System.Linq;
using BDInfo.IO;
@@ -105,7 +104,7 @@ public class BdInfoDirectoryInfo : IDirectoryInfo
_impl.FullName,
new[] { searchPattern },
false,
- (searchOption & SearchOption.AllDirectories) == SearchOption.AllDirectories)
+ searchOption == SearchOption.AllDirectories)
.Select(x => new BdInfoFileInfo(x))
.ToArray();
}
diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
index 540d50bf1..d3843796f 100644
--- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
@@ -25,11 +25,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
"mpeg2video",
"mpeg4",
"msmpeg4",
- "dts",
+ "dca",
"ac3",
"aac",
"mp3",
"flac",
+ "truehd",
"h264_qsv",
"hevc_qsv",
"mpeg2_qsv",
@@ -59,10 +60,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
"aac_at",
"libfdk_aac",
"ac3",
+ "dca",
"libmp3lame",
"libopus",
"libvorbis",
"flac",
+ "truehd",
"srt",
"h264_amf",
"hevc_amf",
@@ -214,12 +217,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
return false;
}
- else if (version < MinVersion) // Version is below what we recommend
+
+ if (version < MinVersion) // Version is below what we recommend
{
_logger.LogWarning("FFmpeg validation: The minimum recommended version is {MinVersion}", MinVersion);
return false;
}
- else if (MaxVersion is not null && version > MaxVersion) // Version is above what we recommend
+
+ if (MaxVersion is not null && version > MaxVersion) // Version is above what we recommend
{
_logger.LogWarning("FFmpeg validation: The maximum recommended version is {MaxVersion}", MaxVersion);
return false;
@@ -488,7 +493,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
var found = Regex
.Matches(output, @"^\s\S{6}\s(?<codec>[\w|-]+)\s+.+$", RegexOptions.Multiline)
- .Cast<Match>()
.Select(x => x.Groups["codec"].Value)
.Where(x => required.Contains(x));
@@ -517,7 +521,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
var found = Regex
.Matches(output, @"^\s\S{3}\s(?<filter>[\w|-]+)\s+.+$", RegexOptions.Multiline)
- .Cast<Match>()
.Select(x => x.Groups["filter"].Value)
.Where(x => _requiredFilters.Contains(x));
diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
index cb482301f..7d655240b 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
+using Jellyfin.Data.Enums;
using Jellyfin.Extensions;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
@@ -67,6 +68,9 @@ namespace MediaBrowser.MediaEncoding.Probing
"諭吉佳作/men",
"//dARTH nULL",
"Phantom/Ghost",
+ "She/Her/Hers",
+ "5/8erl in Ehr'n",
+ "Smith/Kotzen",
};
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType? videoType, bool isAudio, string path, MediaProtocol protocol)
@@ -507,7 +511,7 @@ namespace MediaBrowser.MediaEncoding.Probing
peoples.Add(new BaseItemPerson
{
Name = pair.Value,
- Type = PersonType.Writer
+ Type = PersonKind.Writer
});
}
}
@@ -518,7 +522,7 @@ namespace MediaBrowser.MediaEncoding.Probing
peoples.Add(new BaseItemPerson
{
Name = pair.Value,
- Type = PersonType.Producer
+ Type = PersonKind.Producer
});
}
}
@@ -529,7 +533,7 @@ namespace MediaBrowser.MediaEncoding.Probing
peoples.Add(new BaseItemPerson
{
Name = pair.Value,
- Type = PersonType.Director
+ Type = PersonKind.Director
});
}
}
@@ -1163,7 +1167,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(composer, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Composer });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Composer });
}
}
@@ -1171,7 +1175,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(conductor, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Conductor });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Conductor });
}
}
@@ -1179,7 +1183,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(lyricist, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Lyricist });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Lyricist });
}
}
@@ -1195,7 +1199,7 @@ namespace MediaBrowser.MediaEncoding.Probing
people.Add(new BaseItemPerson
{
Name = match.Groups["name"].Value,
- Type = PersonType.Actor,
+ Type = PersonKind.Actor,
Role = CultureInfo.InvariantCulture.TextInfo.ToTitleCase(match.Groups["instrument"].Value)
});
}
@@ -1207,7 +1211,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(writer, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Writer });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Writer });
}
}
@@ -1215,7 +1219,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(arranger, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Arranger });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Arranger });
}
}
@@ -1223,7 +1227,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(engineer, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Engineer });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Engineer });
}
}
@@ -1231,7 +1235,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(mixer, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Mixer });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Mixer });
}
}
@@ -1239,7 +1243,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
foreach (var person in Split(remixer, false))
{
- people.Add(new BaseItemPerson { Name = person, Type = PersonType.Remixer });
+ people.Add(new BaseItemPerson { Name = person, Type = PersonKind.Remixer });
}
}
@@ -1491,7 +1495,7 @@ namespace MediaBrowser.MediaEncoding.Probing
{
video.People = people.Split(new[] { ';', '/' }, StringSplitOptions.RemoveEmptyEntries)
.Where(i => !string.IsNullOrWhiteSpace(i))
- .Select(i => new BaseItemPerson { Name = i.Trim(), Type = PersonType.Actor })
+ .Select(i => new BaseItemPerson { Name = i.Trim(), Type = PersonKind.Actor })
.ToArray();
}
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index 90bc49132..794906c3b 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -449,7 +449,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
try
{
- _logger.LogInformation("Deleting converted subtitle due to failure: ", outputPath);
+ _logger.LogInformation("Deleting converted subtitle due to failure: {Path}", outputPath);
_fileSystem.DeleteFile(outputPath);
}
catch (IOException ex)
@@ -624,10 +624,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
throw new FfmpegException(
string.Format(CultureInfo.InvariantCulture, "ffmpeg subtitle extraction failed for {0} to {1}", inputPath, outputPath));
}
- else
- {
- _logger.LogInformation("ffmpeg subtitle extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
- }
+
+ _logger.LogInformation("ffmpeg subtitle extraction completed for {InputPath} to {OutputPath}", inputPath, outputPath);
if (string.Equals(outputCodec, "ass", StringComparison.OrdinalIgnoreCase))
{