Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
185662cfbd Update dependency SharpCompress to 0.50.0 2026-07-13 17:49:18 +00:00
5 changed files with 9 additions and 29 deletions

View File

@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "10.0.10",
"version": "10.0.9",
"commands": [
"dotnet-ef"
]

View File

@@ -67,7 +67,7 @@
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageVersion Include="Serilog.Sinks.Graylog" Version="3.1.1" />
<PackageVersion Include="SerilogAnalyzer" Version="0.15.0" />
<PackageVersion Include="SharpCompress" Version="0.49.1" />
<PackageVersion Include="SharpCompress" Version="0.50.0" />
<PackageVersion Include="SharpFuzz" Version="2.3.0" />
<PackageVersion Include="SkiaSharp" Version="3.119.4" />
<PackageVersion Include="SkiaSharp.HarfBuzz" Version="3.119.4" />

View File

@@ -385,7 +385,7 @@ namespace Emby.Server.Implementations.Localization
// Convert ints directly
// This may override some of the locale specific age ratings (but those always map to the same age)
if (TryParseRatingAsScore(rating, out var ratingAge))
if (int.TryParse(rating, out var ratingAge))
{
return new(ratingAge, null);
}
@@ -487,13 +487,6 @@ namespace Emby.Server.Implementations.Localization
return true;
}
// If it's not a recognized rating string, fall back to using the number as the score
if (TryParseRatingAsScore(ratingPart, out var numericScore))
{
result = new ParentalRatingScore(numericScore, null);
return true;
}
_logger.LogWarning(
"Rating '{Rating}' not found in the '{CountryCode}' rating system, treating as unrated",
rating,
@@ -508,18 +501,6 @@ namespace Emby.Server.Implementations.Localization
return true;
}
/// <summary>
/// Tries to parse a rating as a number, allowing an optional trailing '+' (e.g. "16" or "18+").
/// </summary>
/// <param name="ratingValue">Rating value to parse.</param>
/// <param name="score">Parsed score.</param>
/// <returns>Returns true if parsing was successful.</returns>
private static bool TryParseRatingAsScore(ReadOnlySpan<char> ratingValue, out int score)
{
var trimmed = ratingValue.TrimEnd('+');
return int.TryParse(trimmed, out score);
}
/// <inheritdoc />
public string GetLocalizedString(string phrase)
{

View File

@@ -492,8 +492,8 @@ namespace MediaBrowser.Controller.Entities
public IOrderedEnumerable<Video> GetAdditionalParts(User user = null)
{
return GetAdditionalPartIds()
.Select(i => LibraryManager.GetItemById<Video>(i))
.Where(i => i is not null && (user is null || i.IsVisible(user)))
.Select(i => LibraryManager.GetItemById<Video>(i, user))
.Where(i => i is not null)
.OrderBy(i => i.SortName);
}

View File

@@ -167,7 +167,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
if (fileInfo.Protocol == MediaProtocol.Http)
{
var result = await DetectCharset(fileInfo.Path, cancellationToken).ConfigureAwait(false);
var result = await DetectCharset(fileInfo.Path, fileInfo.Protocol, cancellationToken).ConfigureAwait(false);
var detected = result.Detected;
if (detected is not null)
@@ -1104,7 +1104,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
var result = await DetectCharset(path, cancellationToken).ConfigureAwait(false);
var result = await DetectCharset(path, mediaSource.Protocol, cancellationToken).ConfigureAwait(false);
var charset = result.Detected?.EncodingName ?? string.Empty;
// UTF16 is automatically converted to UTF8 by FFmpeg, do not specify a character encoding
@@ -1120,9 +1120,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return charset;
}
private async Task<DetectionResult> DetectCharset(string path, CancellationToken cancellationToken)
private async Task<DetectionResult> DetectCharset(string path, MediaProtocol protocol, CancellationToken cancellationToken)
{
var protocol = _mediaSourceManager.GetPathProtocol(path);
switch (protocol)
{
case MediaProtocol.Http:
@@ -1142,7 +1141,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
default:
throw new NotSupportedException($"Unsupported protocol: {protocol}");
throw new ArgumentOutOfRangeException(nameof(protocol), protocol, "Unsupported protocol");
}
}