Merge branch 'master' into dlnope_never_again

This commit is contained in:
cvium 2021-11-09 16:00:14 +01:00
commit 2b02b53fc0
65 changed files with 132 additions and 138 deletions

View File

@ -34,7 +34,6 @@ jobs:
inputs: inputs:
packageType: sdk packageType: sdk
version: ${{ parameters.DotNetSdkVersion }} version: ${{ parameters.DotNetSdkVersion }}
includePreviewVersions: true
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: 'Install ABI CompatibilityChecker Tool' displayName: 'Install ABI CompatibilityChecker Tool'

View File

@ -54,7 +54,6 @@ jobs:
inputs: inputs:
packageType: sdk packageType: sdk
version: ${{ parameters.DotNetSdkVersion }} version: ${{ parameters.DotNetSdkVersion }}
includePreviewVersions: true
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: 'Publish Server' displayName: 'Publish Server'

View File

@ -199,7 +199,6 @@ jobs:
inputs: inputs:
packageType: 'sdk' packageType: 'sdk'
version: '6.0.x' version: '6.0.x'
includePreviewVersions: true
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: 'Build Stable Nuget packages' displayName: 'Build Stable Nuget packages'

View File

@ -41,7 +41,6 @@ jobs:
inputs: inputs:
packageType: sdk packageType: sdk
version: ${{ parameters.DotNetSdkVersion }} version: ${{ parameters.DotNetSdkVersion }}
includePreviewVersions: true
- task: SonarCloudPrepare@1 - task: SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud' displayName: 'Prepare analysis on SonarCloud'

View File

@ -25,8 +25,7 @@ jobs:
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: '6.0.x' dotnet-version: '6.0.x'
include-prerelease: true
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v1
with: with:

View File

@ -20,7 +20,6 @@ jobs:
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: '6.0.x' dotnet-version: '6.0.x'
include-prerelease: true
- name: Generate openapi.json - name: Generate openapi.json
run: dotnet test tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj -c Release --filter "Jellyfin.Server.Integration.Tests.OpenApiSpecTests" run: dotnet test tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj -c Release --filter "Jellyfin.Server.Integration.Tests.OpenApiSpecTests"
- name: Upload openapi.json - name: Upload openapi.json
@ -45,7 +44,6 @@ jobs:
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: '6.0.x' dotnet-version: '6.0.x'
include-prerelease: true
- name: Generate openapi.json - name: Generate openapi.json
run: dotnet test tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj -c Release --filter "Jellyfin.Server.Integration.Tests.OpenApiSpecTests" run: dotnet test tests/Jellyfin.Server.Integration.Tests/Jellyfin.Server.Integration.Tests.csproj -c Release --filter "Jellyfin.Server.Integration.Tests.OpenApiSpecTests"
- name: Upload openapi.json - name: Upload openapi.json

View File

@ -3,10 +3,13 @@
<PropertyGroup> <PropertyGroup>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/jellyfin.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/jellyfin.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<AnalysisMode>AllEnabledByDefault</AnalysisMode> <AnalysisMode>AllEnabledByDefault</AnalysisMode>
</PropertyGroup> </PropertyGroup>

View File

@ -72,7 +72,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -26,7 +26,7 @@ namespace Emby.Drawing
public sealed class ImageProcessor : IImageProcessor, IDisposable public sealed class ImageProcessor : IImageProcessor, IDisposable
{ {
// Increment this when there's a change requiring caches to be invalidated // Increment this when there's a change requiring caches to be invalidated
private const string Version = "3"; private const char Version = '3';
private static readonly HashSet<string> _transparentImageTypes private static readonly HashSet<string> _transparentImageTypes
= new HashSet<string>(StringComparer.OrdinalIgnoreCase) { ".png", ".webp", ".gif" }; = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { ".png", ".webp", ".gif" };

View File

@ -1,3 +1,5 @@
#pragma warning disable CA1819
using System; using System;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

View File

@ -38,7 +38,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
<!-- Code Analyzers--> <!-- Code Analyzers-->

View File

@ -497,7 +497,7 @@ namespace Emby.Server.Implementations.Dto
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error getting {imageType} image info for {path}", image.Type, image.Path); _logger.LogError(ex, "Error getting {ImageType} image info for {Path}", image.Type, image.Path);
return null; return null;
} }
} }

View File

@ -25,11 +25,11 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="DiscUtils.Udf" Version="0.16.13" /> <PackageReference Include="DiscUtils.Udf" Version="0.16.13" />
<PackageReference Include="Jellyfin.XmlTv" Version="10.6.2" /> <PackageReference Include="Jellyfin.XmlTv" Version="10.6.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" />
<PackageReference Include="Mono.Nat" Version="3.0.1" /> <PackageReference Include="Mono.Nat" Version="3.0.1" />
<PackageReference Include="prometheus-net.DotNetRuntime" Version="4.2.2" /> <PackageReference Include="prometheus-net.DotNetRuntime" Version="4.2.2" />
<PackageReference Include="sharpcompress" Version="0.30.0" /> <PackageReference Include="sharpcompress" Version="0.30.0" />

View File

@ -276,7 +276,7 @@ namespace Emby.Server.Implementations.IO
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error watching path: {path}", path); _logger.LogError(ex, "Error watching path: {Path}", path);
} }
}); });
} }

View File

@ -492,7 +492,7 @@ namespace Emby.Server.Implementations.Library
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error in {resolver} resolving {path}", resolver.GetType().Name, args.Path); _logger.LogError(ex, "Error in {Resolver} resolving {Path}", resolver.GetType().Name, args.Path);
return null; return null;
} }
} }
@ -799,7 +799,7 @@ namespace Emby.Server.Implementations.Library
{ {
var userRootPath = _configurationManager.ApplicationPaths.DefaultUserViewsPath; var userRootPath = _configurationManager.ApplicationPaths.DefaultUserViewsPath;
_logger.LogDebug("Creating userRootPath at {path}", userRootPath); _logger.LogDebug("Creating userRootPath at {Path}", userRootPath);
Directory.CreateDirectory(userRootPath); Directory.CreateDirectory(userRootPath);
var newItemId = GetNewItemId(userRootPath, typeof(UserRootFolder)); var newItemId = GetNewItemId(userRootPath, typeof(UserRootFolder));
@ -810,7 +810,7 @@ namespace Emby.Server.Implementations.Library
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error creating UserRootFolder {path}", newItemId); _logger.LogError(ex, "Error creating UserRootFolder {Path}", newItemId);
} }
if (tmpItem == null) if (tmpItem == null)
@ -827,7 +827,7 @@ namespace Emby.Server.Implementations.Library
} }
_userRootFolder = tmpItem; _userRootFolder = tmpItem;
_logger.LogDebug("Setting userRootFolder: {folder}", _userRootFolder); _logger.LogDebug("Setting userRootFolder: {Folder}", _userRootFolder);
} }
} }
} }
@ -1213,7 +1213,7 @@ namespace Emby.Server.Implementations.Library
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error resolving shortcut file {file}", i); _logger.LogError(ex, "Error resolving shortcut file {File}", i);
return null; return null;
} }
}) })
@ -1698,7 +1698,7 @@ namespace Emby.Server.Implementations.Library
if (video == null) if (video == null)
{ {
_logger.LogError("Intro resolver returned null for {path}.", info.Path); _logger.LogError("Intro resolver returned null for {Path}.", info.Path);
} }
else else
{ {
@ -1717,7 +1717,7 @@ namespace Emby.Server.Implementations.Library
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error resolving path {path}.", info.Path); _logger.LogError(ex, "Error resolving path {Path}.", info.Path);
} }
} }
else else

View File

@ -78,7 +78,7 @@ namespace Emby.Server.Implementations.Library.Validators
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error validating IBN entry {person}", person); _logger.LogError(ex, "Error validating IBN entry {Person}", person);
} }
// Update progress // Update progress

View File

@ -1308,16 +1308,16 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
await recorder.Record(directStreamProvider, mediaStreamInfo, recordPath, duration, onStarted, activeRecordingInfo.CancellationTokenSource.Token).ConfigureAwait(false); await recorder.Record(directStreamProvider, mediaStreamInfo, recordPath, duration, onStarted, activeRecordingInfo.CancellationTokenSource.Token).ConfigureAwait(false);
recordingStatus = RecordingStatus.Completed; recordingStatus = RecordingStatus.Completed;
_logger.LogInformation("Recording completed: {recordPath}", recordPath); _logger.LogInformation("Recording completed: {RecordPath}", recordPath);
} }
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
_logger.LogInformation("Recording stopped: {recordPath}", recordPath); _logger.LogInformation("Recording stopped: {RecordPath}", recordPath);
recordingStatus = RecordingStatus.Completed; recordingStatus = RecordingStatus.Completed;
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error recording to {recordPath}", recordPath); _logger.LogError(ex, "Error recording to {RecordPath}", recordPath);
recordingStatus = RecordingStatus.Error; recordingStatus = RecordingStatus.Error;
} }
@ -1404,7 +1404,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error deleting 0-byte failed recording file {path}", path); _logger.LogError(ex, "Error deleting 0-byte failed recording file {Path}", path);
} }
} }
} }

View File

@ -225,13 +225,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{ {
try try
{ {
_logger.LogInformation("Stopping ffmpeg recording process for {path}", _targetPath); _logger.LogInformation("Stopping ffmpeg recording process for {Path}", _targetPath);
_process.StandardInput.WriteLine("q"); _process.StandardInput.WriteLine("q");
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error stopping recording transcoding job for {path}", _targetPath); _logger.LogError(ex, "Error stopping recording transcoding job for {Path}", _targetPath);
} }
if (_hasExited) if (_hasExited)
@ -241,7 +241,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
try try
{ {
_logger.LogInformation("Calling recording process.WaitForExit for {path}", _targetPath); _logger.LogInformation("Calling recording process.WaitForExit for {Path}", _targetPath);
if (_process.WaitForExit(10000)) if (_process.WaitForExit(10000))
{ {
@ -250,7 +250,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error waiting for recording process to exit for {path}", _targetPath); _logger.LogError(ex, "Error waiting for recording process to exit for {Path}", _targetPath);
} }
if (_hasExited) if (_hasExited)
@ -260,13 +260,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
try try
{ {
_logger.LogInformation("Killing ffmpeg recording process for {path}", _targetPath); _logger.LogInformation("Killing ffmpeg recording process for {Path}", _targetPath);
_process.Kill(); _process.Kill();
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error killing recording transcoding job for {path}", _targetPath); _logger.LogError(ex, "Error killing recording transcoding job for {Path}", _targetPath);
} }
} }
} }

View File

@ -393,7 +393,7 @@ namespace Emby.Server.Implementations.LiveTv
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error getting image info for {name}", info.Name); _logger.LogError(ex, "Error getting image info for {Name}", info.Name);
} }
return null; return null;

View File

@ -1054,7 +1054,7 @@ namespace Emby.Server.Implementations.LiveTv
{ {
cancellationToken.ThrowIfCancellationRequested(); cancellationToken.ThrowIfCancellationRequested();
_logger.LogDebug("Refreshing guide from {name}", service.Name); _logger.LogDebug("Refreshing guide from {Name}", service.Name);
try try
{ {
@ -1135,7 +1135,7 @@ namespace Emby.Server.Implementations.LiveTv
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error getting channel information for {name}", channelInfo.Item2.Name); _logger.LogError(ex, "Error getting channel information for {Name}", channelInfo.Item2.Name);
} }
numComplete++; numComplete++;
@ -1248,7 +1248,7 @@ namespace Emby.Server.Implementations.LiveTv
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error getting programs for channel {name}", currentChannel.Name); _logger.LogError(ex, "Error getting programs for channel {Name}", currentChannel.Name);
} }
numComplete++; numComplete++;

View File

@ -82,7 +82,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
Directory.CreateDirectory(Path.GetDirectoryName(TempFilePath)); Directory.CreateDirectory(Path.GetDirectoryName(TempFilePath));
Logger.LogInformation("Opening HDHR UDP Live stream from {host}", uri.Host); Logger.LogInformation("Opening HDHR UDP Live stream from {Host}", uri.Host);
var remoteAddress = IPAddress.Parse(uri.Host); var remoteAddress = IPAddress.Parse(uri.Host);
IPAddress localAddress = null; IPAddress localAddress = null;

View File

@ -62,11 +62,11 @@
"PluginUninstalledWithName": "{0} đã được gỡ bỏ", "PluginUninstalledWithName": "{0} đã được gỡ bỏ",
"PluginInstalledWithName": "{0} đã được cài đặt", "PluginInstalledWithName": "{0} đã được cài đặt",
"Plugin": "Plugin", "Plugin": "Plugin",
"NotificationOptionVideoPlaybackStopped": "Phát lại video đã dừng", "NotificationOptionVideoPlaybackStopped": "Đã dừng phát lại video",
"NotificationOptionVideoPlayback": "Đã bắt đầu phát lại video", "NotificationOptionVideoPlayback": "Đã bắt đầu phát lại video",
"NotificationOptionUserLockedOut": "Người dùng bị khóa", "NotificationOptionUserLockedOut": "Người dùng bị khóa",
"NotificationOptionTaskFailed": "Lỗi tác vụ đã lên lịch", "NotificationOptionTaskFailed": "Lỗi tác vụ đã lên lịch",
"NotificationOptionServerRestartRequired": "Yêu cầu khởi động lại Server", "NotificationOptionServerRestartRequired": "Yêu cầu khởi động lại máy chủ",
"NotificationOptionPluginUpdateInstalled": "Cập nhật Plugin đã được cài đặt", "NotificationOptionPluginUpdateInstalled": "Cập nhật Plugin đã được cài đặt",
"NotificationOptionPluginUninstalled": "Đã gỡ bỏ Plugin", "NotificationOptionPluginUninstalled": "Đã gỡ bỏ Plugin",
"NotificationOptionPluginInstalled": "Đã cài đặt Plugin", "NotificationOptionPluginInstalled": "Đã cài đặt Plugin",
@ -75,7 +75,7 @@
"NotificationOptionInstallationFailed": "Cài đặt thất bại", "NotificationOptionInstallationFailed": "Cài đặt thất bại",
"NotificationOptionCameraImageUploaded": "Đã tải lên hình ảnh máy ảnh", "NotificationOptionCameraImageUploaded": "Đã tải lên hình ảnh máy ảnh",
"NotificationOptionAudioPlaybackStopped": "Phát lại âm thanh đã dừng", "NotificationOptionAudioPlaybackStopped": "Phát lại âm thanh đã dừng",
"NotificationOptionAudioPlayback": "Phát lại âm thanh đã bắt đầu", "NotificationOptionAudioPlayback": "Đã bắt đầu phát lại âm thanh",
"NotificationOptionApplicationUpdateInstalled": "Bản cập nhật ứng dụng đã được cài đặt", "NotificationOptionApplicationUpdateInstalled": "Bản cập nhật ứng dụng đã được cài đặt",
"NotificationOptionApplicationUpdateAvailable": "Bản cập nhật ứng dụng hiện sẵn có", "NotificationOptionApplicationUpdateAvailable": "Bản cập nhật ứng dụng hiện sẵn có",
"NewVersionIsAvailable": "Một phiên bản mới của Jellyfin Server sẵn có để tải.", "NewVersionIsAvailable": "Một phiên bản mới của Jellyfin Server sẵn có để tải.",

View File

@ -161,11 +161,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
} }
catch (UnauthorizedAccessException ex) catch (UnauthorizedAccessException ex)
{ {
_logger.LogError(ex, "Error deleting directory {path}", directory); _logger.LogError(ex, "Error deleting directory {Path}", directory);
} }
catch (IOException ex) catch (IOException ex)
{ {
_logger.LogError(ex, "Error deleting directory {path}", directory); _logger.LogError(ex, "Error deleting directory {Path}", directory);
} }
} }
} }
@ -179,11 +179,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
} }
catch (UnauthorizedAccessException ex) catch (UnauthorizedAccessException ex)
{ {
_logger.LogError(ex, "Error deleting file {path}", path); _logger.LogError(ex, "Error deleting file {Path}", path);
} }
catch (IOException ex) catch (IOException ex)
{ {
_logger.LogError(ex, "Error deleting file {path}", path); _logger.LogError(ex, "Error deleting file {Path}", path);
} }
} }
} }

View File

@ -141,11 +141,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
} }
catch (UnauthorizedAccessException ex) catch (UnauthorizedAccessException ex)
{ {
_logger.LogError(ex, "Error deleting directory {path}", directory); _logger.LogError(ex, "Error deleting directory {Path}", directory);
} }
catch (IOException ex) catch (IOException ex)
{ {
_logger.LogError(ex, "Error deleting directory {path}", directory); _logger.LogError(ex, "Error deleting directory {Path}", directory);
} }
} }
} }
@ -159,11 +159,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
} }
catch (UnauthorizedAccessException ex) catch (UnauthorizedAccessException ex)
{ {
_logger.LogError(ex, "Error deleting file {path}", path); _logger.LogError(ex, "Error deleting file {Path}", path);
} }
catch (IOException ex) catch (IOException ex)
{ {
_logger.LogError(ex, "Error deleting file {path}", path); _logger.LogError(ex, "Error deleting file {Path}", path);
} }
} }
} }

View File

@ -1794,7 +1794,7 @@ namespace Jellyfin.Api.Controllers
return; return;
} }
_logger.LogDebug("Deleting partial HLS file {path}", path); _logger.LogDebug("Deleting partial HLS file {Path}", path);
try try
{ {
@ -1802,15 +1802,15 @@ namespace Jellyfin.Api.Controllers
} }
catch (IOException ex) catch (IOException ex)
{ {
_logger.LogError(ex, "Error deleting partial stream file(s) {path}", path); _logger.LogError(ex, "Error deleting partial stream file(s) {Path}", path);
var task = Task.Delay(100); var task = Task.Delay(100);
Task.WaitAll(task); task.Wait();
DeleteFile(path, retryCount + 1); DeleteFile(path, retryCount + 1);
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error deleting partial stream file(s) {path}", path); _logger.LogError(ex, "Error deleting partial stream file(s) {Path}", path);
} }
} }

View File

@ -64,7 +64,7 @@ namespace Jellyfin.Api.Controllers
var transcodePath = _serverConfigurationManager.GetTranscodePath(); var transcodePath = _serverConfigurationManager.GetTranscodePath();
file = Path.GetFullPath(Path.Combine(transcodePath, file)); file = Path.GetFullPath(Path.Combine(transcodePath, file));
var fileDir = Path.GetDirectoryName(file); var fileDir = Path.GetDirectoryName(file);
if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath)) if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath, StringComparison.InvariantCulture))
{ {
return BadRequest("Invalid segment."); return BadRequest("Invalid segment.");
} }
@ -90,7 +90,7 @@ namespace Jellyfin.Api.Controllers
var transcodePath = _serverConfigurationManager.GetTranscodePath(); var transcodePath = _serverConfigurationManager.GetTranscodePath();
file = Path.GetFullPath(Path.Combine(transcodePath, file)); file = Path.GetFullPath(Path.Combine(transcodePath, file));
var fileDir = Path.GetDirectoryName(file); var fileDir = Path.GetDirectoryName(file);
if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath) || Path.GetExtension(file) != ".m3u8") if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodePath, StringComparison.InvariantCulture) || Path.GetExtension(file) != ".m3u8")
{ {
return BadRequest("Invalid segment."); return BadRequest("Invalid segment.");
} }
@ -144,7 +144,7 @@ namespace Jellyfin.Api.Controllers
file = Path.GetFullPath(Path.Combine(transcodeFolderPath, file)); file = Path.GetFullPath(Path.Combine(transcodeFolderPath, file));
var fileDir = Path.GetDirectoryName(file); var fileDir = Path.GetDirectoryName(file);
if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodeFolderPath)) if (string.IsNullOrEmpty(fileDir) || !fileDir.StartsWith(transcodeFolderPath, StringComparison.InvariantCulture))
{ {
return BadRequest("Invalid segment."); return BadRequest("Invalid segment.");
} }

View File

@ -82,7 +82,7 @@ namespace Jellyfin.Api.Controllers
return NotFound(); return NotFound();
} }
if (!path.StartsWith(_applicationPaths.GeneralPath)) if (!path.StartsWith(_applicationPaths.GeneralPath, StringComparison.InvariantCulture))
{ {
return BadRequest("Invalid image path."); return BadRequest("Invalid image path.");
} }
@ -177,7 +177,7 @@ namespace Jellyfin.Api.Controllers
if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path)) if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
{ {
if (!path.StartsWith(basePath)) if (!path.StartsWith(basePath, StringComparison.InvariantCulture))
{ {
return BadRequest("Invalid image path."); return BadRequest("Invalid image path.");
} }
@ -196,7 +196,7 @@ namespace Jellyfin.Api.Controllers
if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path)) if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
{ {
if (!path.StartsWith(basePath)) if (!path.StartsWith(basePath, StringComparison.InvariantCulture))
{ {
return BadRequest("Invalid image path."); return BadRequest("Invalid image path.");
} }

View File

@ -528,7 +528,7 @@ namespace Jellyfin.Api.Controllers
if (fontFile != null && fileSize != null && fileSize > 0) if (fontFile != null && fileSize != null && fileSize > 0)
{ {
_logger.LogDebug("Fallback font size is {fileSize} Bytes", fileSize); _logger.LogDebug("Fallback font size is {FileSize} Bytes", fileSize);
return PhysicalFile(fontFile.FullName, MimeTypes.GetMimeType(fontFile.FullName)); return PhysicalFile(fontFile.FullName, MimeTypes.GetMimeType(fontFile.FullName));
} }
else else

View File

@ -19,7 +19,7 @@ namespace Jellyfin.Api.Helpers
// If any this null throw an exception. // If any this null throw an exception.
if (source == null || destination == null) if (source == null || destination == null)
{ {
throw new Exception("Source or/and Destination Objects are null"); throw new ArgumentException("Source or/and Destination Objects are null");
} }
// Getting the Types of the objects. // Getting the Types of the objects.

View File

@ -148,7 +148,7 @@ namespace Jellyfin.Api.Helpers
mediaSource = string.IsNullOrEmpty(streamingRequest.MediaSourceId) mediaSource = string.IsNullOrEmpty(streamingRequest.MediaSourceId)
? mediaSources[0] ? mediaSources[0]
: mediaSources.Find(i => string.Equals(i.Id, streamingRequest.MediaSourceId, StringComparison.InvariantCulture)); : mediaSources.Find(i => string.Equals(i.Id, streamingRequest.MediaSourceId, StringComparison.Ordinal));
if (mediaSource == null && Guid.Parse(streamingRequest.MediaSourceId) == streamingRequest.Id) if (mediaSource == null && Guid.Parse(streamingRequest.MediaSourceId) == streamingRequest.Id)
{ {

View File

@ -283,6 +283,7 @@ namespace Jellyfin.Api.Helpers
lock (job.ProcessLock!) lock (job.ProcessLock!)
{ {
#pragma warning disable CA1849 // Can't await in lock block
job.TranscodingThrottler?.Stop().GetAwaiter().GetResult(); job.TranscodingThrottler?.Stop().GetAwaiter().GetResult();
var process = job.Process; var process = job.Process;
@ -308,6 +309,7 @@ namespace Jellyfin.Api.Helpers
{ {
} }
} }
#pragma warning restore CA1849
} }
if (delete(job.Path!)) if (delete(job.Path!))

View File

@ -13,8 +13,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="6.2.3" /> <PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="6.2.3" />
</ItemGroup> </ItemGroup>

View File

@ -24,7 +24,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
<!-- Code analysers--> <!-- Code analysers-->
@ -35,7 +35,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -57,7 +57,7 @@ namespace Jellyfin.Server.Implementations.Events
} }
catch (Exception e) catch (Exception e)
{ {
_logger.LogError(e, "Uncaught exception in EventConsumer {type}: ", service.GetType()); _logger.LogError(e, "Uncaught exception in EventConsumer {Type}: ", service.GetType());
} }
} }
} }

View File

@ -19,13 +19,13 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Linq.Async" Version="5.0.0" /> <PackageReference Include="System.Linq.Async" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-rc.2*"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-rc.2*"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@ -31,10 +31,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" /> <PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="6.0.0" />
<PackageReference Include="prometheus-net" Version="5.0.1" /> <PackageReference Include="prometheus-net" Version="5.0.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="5.0.1" /> <PackageReference Include="prometheus-net.AspNetCore" Version="5.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />

View File

@ -68,7 +68,7 @@ namespace Jellyfin.Server.Middleware
if (_enableWarning && watch.ElapsedMilliseconds > _warningThreshold) if (_enableWarning && watch.ElapsedMilliseconds > _warningThreshold)
{ {
_logger.LogWarning( _logger.LogWarning(
"Slow HTTP Response from {url} to {remoteIp} in {elapsed:g} with Status Code {statusCode}", "Slow HTTP Response from {Url} to {RemoteIp} in {Elapsed:g} with Status Code {StatusCode}",
context.Request.GetDisplayUrl(), context.Request.GetDisplayUrl(),
context.GetNormalizedRemoteIp(), context.GetNormalizedRemoteIp(),
watch.Elapsed, watch.Elapsed,

View File

@ -51,7 +51,7 @@ namespace Jellyfin.Server.Middleware
return; return;
} }
if (!key.Contains('=')) if (!key.Contains('=', StringComparison.Ordinal))
{ {
_store = value; _store = value;
return; return;

View File

@ -675,7 +675,7 @@ namespace Jellyfin.Server
private static string NormalizeCommandLineArgument(string arg) private static string NormalizeCommandLineArgument(string arg)
{ {
if (!arg.Contains(" ", StringComparison.OrdinalIgnoreCase)) if (!arg.Contains(' ', StringComparison.Ordinal))
{ {
return arg; return arg;
} }

View File

@ -19,9 +19,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1452,7 +1452,7 @@ namespace MediaBrowser.Controller.Entities
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.LogError(ex, "Error refreshing owned items for {path}", Path ?? Name); Logger.LogError(ex, "Error refreshing owned items for {Path}", Path ?? Name);
} }
} }

View File

@ -303,7 +303,7 @@ namespace MediaBrowser.Controller.Entities
if (dictionary.ContainsKey(id)) if (dictionary.ContainsKey(id))
{ {
Logger.LogError( Logger.LogError(
"Found folder containing items with duplicate id. Path: {path}, Child Name: {ChildName}", "Found folder containing items with duplicate id. Path: {Path}, Child Name: {ChildName}",
Path ?? Name, Path ?? Name,
child.Path ?? child.Name); child.Path ?? child.Name);
} }
@ -1013,6 +1013,7 @@ namespace MediaBrowser.Controller.Entities
items = CollapseBoxSetItemsIfNeeded(items, query, this, user, ConfigurationManager, CollectionManager); items = CollapseBoxSetItemsIfNeeded(items, query, this, user, ConfigurationManager, CollectionManager);
} }
#pragma warning disable CA1309
if (!string.IsNullOrEmpty(query.NameStartsWithOrGreater)) if (!string.IsNullOrEmpty(query.NameStartsWithOrGreater))
{ {
items = items.Where(i => string.Compare(query.NameStartsWithOrGreater, i.SortName, StringComparison.InvariantCultureIgnoreCase) < 1); items = items.Where(i => string.Compare(query.NameStartsWithOrGreater, i.SortName, StringComparison.InvariantCultureIgnoreCase) < 1);
@ -1027,6 +1028,7 @@ namespace MediaBrowser.Controller.Entities
{ {
items = items.Where(i => string.Compare(query.NameLessThan, i.SortName, StringComparison.InvariantCultureIgnoreCase) == 1); items = items.Where(i => string.Compare(query.NameLessThan, i.SortName, StringComparison.InvariantCultureIgnoreCase) == 1);
} }
#pragma warning restore CA1309
// This must be the last filter // This must be the last filter
if (!string.IsNullOrEmpty(query.AdjacentTo)) if (!string.IsNullOrEmpty(query.AdjacentTo))

View File

@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.IO
if (string.IsNullOrEmpty(newPath)) if (string.IsNullOrEmpty(newPath))
{ {
// invalid shortcut - could be old or target could just be unavailable // invalid shortcut - could be old or target could just be unavailable
logger.LogWarning("Encountered invalid shortcut: " + fullName); logger.LogWarning("Encountered invalid shortcut: {Path}", fullName);
continue; continue;
} }
@ -83,7 +83,7 @@ namespace MediaBrowser.Controller.IO
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.LogError(ex, "Error resolving shortcut from {path}", fullName); logger.LogError(ex, "Error resolving shortcut from {Path}", fullName);
} }
} }
else if (flattenFolderDepth > 0 && isDirectory) else if (flattenFolderDepth > 0 && isDirectory)

View File

@ -15,10 +15,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Diacritics" Version="3.3.4" /> <PackageReference Include="Diacritics" Version="3.3.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0" PrivateAssets="All" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="6.0.0-rc.2*" /> <PackageReference Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -412,7 +412,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
{ {
var actors = reader.ReadInnerXml(); var actors = reader.ReadInnerXml();
if (actors.Contains("<", StringComparison.Ordinal)) if (actors.Contains('<', StringComparison.Ordinal))
{ {
// This is one of the mis-named "Actors" full nodes created by MB2 // This is one of the mis-named "Actors" full nodes created by MB2
// Create a reader and pass it to the persons node processor // Create a reader and pass it to the persons node processor

View File

@ -144,7 +144,7 @@ namespace MediaBrowser.LocalMetadata.Savers
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.LogError(ex, "Error setting hidden attribute on {path}", path); Logger.LogError(ex, "Error setting hidden attribute on {Path}", path);
} }
} }

View File

@ -24,8 +24,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="BDInfo" Version="0.7.6.1" /> <PackageReference Include="BDInfo" Version="0.7.6.1" />
<PackageReference Include="libse" Version="3.6.2" /> <PackageReference Include="libse" Version="3.6.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-rc.2*" /> <PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<PackageReference Include="UTF.Unknown" Version="2.5.0" /> <PackageReference Include="UTF.Unknown" Version="2.5.0" />
</ItemGroup> </ItemGroup>

View File

@ -6,20 +6,6 @@ namespace MediaBrowser.Model.Dlna
{ {
public static class DlnaMaps public static class DlnaMaps
{ {
private static readonly string DefaultStreaming =
FlagsToString(DlnaFlags.StreamingTransferMode |
DlnaFlags.BackgroundTransferMode |
DlnaFlags.ConnectionStall |
DlnaFlags.ByteBasedSeek |
DlnaFlags.DlnaV15);
private static readonly string DefaultInteractive =
FlagsToString(DlnaFlags.InteractiveTransferMode |
DlnaFlags.BackgroundTransferMode |
DlnaFlags.ConnectionStall |
DlnaFlags.ByteBasedSeek |
DlnaFlags.DlnaV15);
public static string FlagsToString(DlnaFlags flags) public static string FlagsToString(DlnaFlags flags)
{ {
return string.Format(CultureInfo.InvariantCulture, "{0:X8}{1:D24}", (ulong)flags, 0); return string.Format(CultureInfo.InvariantCulture, "{0:X8}{1:D24}", (ulong)flags, 0);

View File

@ -794,7 +794,7 @@ namespace MediaBrowser.Model.Dlna
} }
// strip spaces to avoid having to encode h264 profile names // strip spaces to avoid having to encode h264 profile names
list.Add(new NameValuePair(pair.Key, pair.Value.Replace(" ", string.Empty))); list.Add(new NameValuePair(pair.Key, pair.Value.Replace(" ", string.Empty, StringComparison.Ordinal)));
} }
if (!item.IsDirectStream) if (!item.IsDirectStream)

View File

@ -29,10 +29,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="System.Globalization" Version="4.3.0" /> <PackageReference Include="System.Globalization" Version="4.3.0" />
<PackageReference Include="System.Text.Json" Version="6.0.0-rc.2*" /> <PackageReference Include="System.Text.Json" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -215,7 +215,7 @@ namespace MediaBrowser.Providers.Manager
catch (Exception ex) catch (Exception ex)
{ {
result.ErrorMessage = ex.Message; result.ErrorMessage = ex.Message;
_logger.LogError(ex, "Error in {provider}", provider.Name); _logger.LogError(ex, "Error in {Provider}", provider.Name);
} }
} }
@ -331,7 +331,7 @@ namespace MediaBrowser.Providers.Manager
catch (Exception ex) catch (Exception ex)
{ {
result.ErrorMessage = ex.Message; result.ErrorMessage = ex.Message;
_logger.LogError(ex, "Error in {provider}", provider.Name); _logger.LogError(ex, "Error in {Provider}", provider.Name);
} }
} }

View File

@ -713,7 +713,7 @@ namespace MediaBrowser.Providers.Manager
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.LogError(ex, "Error in {provider}", provider.Name); Logger.LogError(ex, "Error in {Provider}", provider.Name);
// If a local provider fails, consider that a failure // If a local provider fails, consider that a failure
refreshResult.ErrorMessage = ex.Message; refreshResult.ErrorMessage = ex.Message;
@ -785,7 +785,7 @@ namespace MediaBrowser.Providers.Manager
catch (Exception ex) catch (Exception ex)
{ {
refreshResult.ErrorMessage = ex.Message; refreshResult.ErrorMessage = ex.Message;
Logger.LogError(ex, "Error in {provider}", provider.Name); Logger.LogError(ex, "Error in {Provider}", provider.Name);
} }
} }
@ -837,7 +837,7 @@ namespace MediaBrowser.Providers.Manager
{ {
refreshResult.Failures++; refreshResult.Failures++;
refreshResult.ErrorMessage = ex.Message; refreshResult.ErrorMessage = ex.Message;
Logger.LogError(ex, "Error in {provider}", provider.Name); Logger.LogError(ex, "Error in {Provider}", provider.Name);
} }
} }

View File

@ -16,9 +16,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="OptimizedPriorityQueue" Version="5.0.0" /> <PackageReference Include="OptimizedPriorityQueue" Version="5.0.0" />
<PackageReference Include="PlaylistsNET" Version="1.1.3" /> <PackageReference Include="PlaylistsNET" Version="1.1.3" />

View File

@ -125,7 +125,7 @@ namespace MediaBrowser.Providers.MediaInfo
if (attachmentStream != null) if (attachmentStream != null)
{ {
return await ExtractAttachment(item, cancellationToken, attachmentStream, mediaSource); return await ExtractAttachment(item, attachmentStream, mediaSource, cancellationToken);
} }
// Fall back to EmbeddedImage streams // Fall back to EmbeddedImage streams
@ -169,7 +169,7 @@ namespace MediaBrowser.Providers.MediaInfo
}; };
} }
private async Task<DynamicImageResponse> ExtractAttachment(Video item, CancellationToken cancellationToken, MediaAttachment attachmentStream, MediaSourceInfo mediaSource) private async Task<DynamicImageResponse> ExtractAttachment(Video item, MediaAttachment attachmentStream, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
{ {
var extension = string.IsNullOrEmpty(attachmentStream.MimeType) var extension = string.IsNullOrEmpty(attachmentStream.MimeType)
? Path.GetExtension(attachmentStream.FileName) ? Path.GetExtension(attachmentStream.FileName)

View File

@ -71,7 +71,7 @@ namespace MediaBrowser.XbmcMetadata
} }
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error saving metadata for {path}", item.Path ?? item.Name); _logger.LogError(ex, "Error saving metadata for {Path}", item.Path ?? item.Name);
} }
} }
} }

View File

@ -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 && 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 # Install DotNET SDK
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/20283373-1d83-4879-8278-0afb7fd4035e/56f204f174743b29a656499ad0fc93c3/dotnet-sdk-6.0.100-rc.2.21505.57-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ RUN wget -q https://download.visualstudio.microsoft.com/download/pr/17b6759f-1af0-41bc-ab12-209ba0377779/e8d02195dbf1434b940e0f05ae086453/dotnet-sdk-6.0.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \ && mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@ -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 && dnf install -yq @buildsys-build rpmdevtools git dnf-plugins-core libcurl-devel fontconfig-devel freetype-devel openssl-devel glibc-devel libicu-devel systemd wget
# Install DotNET SDK # Install DotNET SDK
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/20283373-1d83-4879-8278-0afb7fd4035e/56f204f174743b29a656499ad0fc93c3/dotnet-sdk-6.0.100-rc.2.21505.57-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ RUN wget -q https://download.visualstudio.microsoft.com/download/pr/17b6759f-1af0-41bc-ab12-209ba0377779/e8d02195dbf1434b940e0f05ae086453/dotnet-sdk-6.0.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \ && mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@ -17,7 +17,7 @@ RUN apt-get update -yqq \
libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
# Install dotnet repository # Install dotnet repository
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/20283373-1d83-4879-8278-0afb7fd4035e/56f204f174743b29a656499ad0fc93c3/dotnet-sdk-6.0.100-rc.2.21505.57-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ RUN wget -q https://download.visualstudio.microsoft.com/download/pr/17b6759f-1af0-41bc-ab12-209ba0377779/e8d02195dbf1434b940e0f05ae086453/dotnet-sdk-6.0.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \ && mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release mmv build-essential lsb-release
# Install dotnet repository # Install dotnet repository
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/20283373-1d83-4879-8278-0afb7fd4035e/56f204f174743b29a656499ad0fc93c3/dotnet-sdk-6.0.100-rc.2.21505.57-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ RUN wget -q https://download.visualstudio.microsoft.com/download/pr/17b6759f-1af0-41bc-ab12-209ba0377779/e8d02195dbf1434b940e0f05ae086453/dotnet-sdk-6.0.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \ && mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@ -16,7 +16,7 @@ RUN apt-get update -yqq \
mmv build-essential lsb-release mmv build-essential lsb-release
# Install dotnet repository # Install dotnet repository
RUN wget -q https://download.visualstudio.microsoft.com/download/pr/20283373-1d83-4879-8278-0afb7fd4035e/56f204f174743b29a656499ad0fc93c3/dotnet-sdk-6.0.100-rc.2.21505.57-linux-x64.tar.gz -O dotnet-sdk.tar.gz \ RUN wget -q https://download.visualstudio.microsoft.com/download/pr/17b6759f-1af0-41bc-ab12-209ba0377779/e8d02195dbf1434b940e0f05ae086453/dotnet-sdk-6.0.100-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
&& mkdir -p dotnet-sdk \ && mkdir -p dotnet-sdk \
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \ && tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet && ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet

View File

@ -42,6 +42,8 @@
<Rule Id="CA1305" Action="Error" /> <Rule Id="CA1305" Action="Error" />
<!-- error on CA1725: Parameter names should match base declaration --> <!-- error on CA1725: Parameter names should match base declaration -->
<Rule Id="CA1725" Action="Error" /> <Rule Id="CA1725" Action="Error" />
<!-- error on CA1725: Call async methods when in an async method -->
<Rule Id="CA1727" Action="Error" />
<!-- error on CA2016: Forward the CancellationToken parameter to methods that take one <!-- error on CA2016: Forward the CancellationToken parameter to methods that take one
or pass in 'CancellationToken.None' explicitly to indicate intentionally not propagating the token --> or pass in 'CancellationToken.None' explicitly to indicate intentionally not propagating the token -->
<Rule Id="CA2016" Action="Error" /> <Rule Id="CA2016" Action="Error" />
@ -77,6 +79,8 @@
<Rule Id="CA1822" Action="Info" /> <Rule Id="CA1822" Action="Info" />
<!-- disable warning CA2000: Dispose objects before losing scope --> <!-- disable warning CA2000: Dispose objects before losing scope -->
<Rule Id="CA2000" Action="Info" /> <Rule Id="CA2000" Action="Info" />
<!-- disable warning CA2253: Named placeholders should not be numeric values -->
<Rule Id="CA2253" Action="Info" />
<!-- disable warning CA5394: Do not use insecure randomness --> <!-- disable warning CA5394: Do not use insecure randomness -->
<Rule Id="CA5394" Action="Info" /> <Rule Id="CA5394" Action="Info" />
@ -90,6 +94,8 @@
<Rule Id="CA1303" Action="None" /> <Rule Id="CA1303" Action="None" />
<!-- disable warning CA1308: Normalize strings to uppercase --> <!-- disable warning CA1308: Normalize strings to uppercase -->
<Rule Id="CA1308" Action="None" /> <Rule Id="CA1308" Action="None" />
<!-- disable warning CA1848: Use the LoggerMessage delegates -->
<Rule Id="CA1848" Action="None" />
<!-- disable warning CA2101: Specify marshaling for P/Invoke string arguments --> <!-- disable warning CA2101: Specify marshaling for P/Invoke string arguments -->
<Rule Id="CA2101" Action="None" /> <Rule Id="CA2101" Action="None" />
<!-- disable warning CA2234: Pass System.Uri objects instead of strings --> <!-- disable warning CA2234: Pass System.Uri objects instead of strings -->

View File

@ -15,8 +15,8 @@
<PackageReference Include="AutoFixture" Version="4.17.0" /> <PackageReference Include="AutoFixture" Version="4.17.0" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" /> <PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" />
<PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" /> <PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />

View File

@ -40,7 +40,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Equal(MediaTypeNames.Text.Html, response.Content.Headers.ContentType?.MediaType); Assert.Equal(MediaTypeNames.Text.Html, response.Content.Headers.ContentType?.MediaType);
StreamReader reader = new StreamReader(typeof(TestPlugin).Assembly.GetManifestResourceStream("Jellyfin.Server.Integration.Tests.TestPage.html")!); StreamReader reader = new StreamReader(typeof(TestPlugin).Assembly.GetManifestResourceStream("Jellyfin.Server.Integration.Tests.TestPage.html")!);
Assert.Equal(await response.Content.ReadAsStringAsync(), reader.ReadToEnd()); Assert.Equal(await response.Content.ReadAsStringAsync().ConfigureAwait(false), await reader.ReadToEndAsync().ConfigureAwait(false));
} }
[Fact] [Fact]

View File

@ -9,8 +9,8 @@
<PackageReference Include="AutoFixture" Version="4.17.0" /> <PackageReference Include="AutoFixture" Version="4.17.0" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" /> <PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" />
<PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" /> <PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />

View File

@ -10,8 +10,8 @@
<PackageReference Include="AutoFixture" Version="4.17.0" /> <PackageReference Include="AutoFixture" Version="4.17.0" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" /> <PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" />
<PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" /> <PackageReference Include="AutoFixture.Xunit2" Version="4.17.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0-rc.2*" /> <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />