Merge pull request #15250 from jakobkukla/ci-format
Some checks failed
Format / format-check (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Artifact (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled
Stale Issue Labeler / Check for stale issues (push) Has been cancelled

Add CI format check
This commit is contained in:
Bond-009
2026-05-21 21:33:31 +02:00
committed by GitHub
93 changed files with 501 additions and 471 deletions

25
.github/workflows/ci-format.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Format
on:
push:
branches:
- master
# Run formatter against the forked branch, but
# do not allow access to secrets
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflows-in-forked-repositories
pull_request:
env:
SDK_VERSION: "10.0.x"
jobs:
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
with:
dotnet-version: ${{ env.SDK_VERSION }}
- name: Run DotNet Format
run: dotnet format --verify-no-changes --verbosity minimal

View File

@@ -70,7 +70,7 @@ namespace Emby.Naming.ExternalFiles
if (lastSeparator == -1) if (lastSeparator == -1)
{ {
break; break;
} }
string currentSlice = languageString[lastSeparator..]; string currentSlice = languageString[lastSeparator..];

View File

@@ -132,7 +132,7 @@ namespace Emby.Server.Implementations.AppBase
} }
else else
{ {
_configurationFactories = [.._configurationFactories, factory]; _configurationFactories = [.. _configurationFactories, factory];
} }
_configurationStores = _configurationFactories _configurationStores = _configurationFactories

View File

@@ -240,15 +240,15 @@ public class ChapterManager : IChapterManager
public void SaveChapters(BaseItem item, IReadOnlyList<ChapterInfo> chapters) public void SaveChapters(BaseItem item, IReadOnlyList<ChapterInfo> chapters)
{ {
if (!Supports(item)) if (!Supports(item))
{ {
_logger.LogWarning("Attempted to save chapters for unsupported item type {Type}: {Name} ({Id})", item.GetType().Name, item.Name, item.Id); _logger.LogWarning("Attempted to save chapters for unsupported item type {Type}: {Name} ({Id})", item.GetType().Name, item.Name, item.Id);
return; return;
} }
// Remove any chapters that are outside of the runtime of the item // Remove any chapters that are outside of the runtime of the item
var validChapters = chapters.Where(c => c.StartPositionTicks < item.RunTimeTicks).ToList(); var validChapters = chapters.Where(c => c.StartPositionTicks < item.RunTimeTicks).ToList();
_chapterRepository.SaveChapters(item.Id, validChapters); _chapterRepository.SaveChapters(item.Id, validChapters);
} }
/// <inheritdoc /> /// <inheritdoc />
public ChapterInfo? GetChapter(Guid baseItemId, int index) public ChapterInfo? GetChapter(Guid baseItemId, int index)

View File

@@ -45,7 +45,7 @@ namespace Emby.Server.Implementations.Library
'[' => ']', '[' => ']',
'(' => ')', '(' => ')',
'{' => '}', '{' => '}',
_ => '\0' _ => '\0'
}; };
if (attributeCloser != '\0' && (str[attributeEnd] == '=' || str[attributeEnd] == '-')) if (attributeCloser != '\0' && (str[attributeEnd] == '=' || str[attributeEnd] == '-'))
{ {

View File

@@ -31,7 +31,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
/// </summary> /// </summary>
/// <param name="logger">The logger.</param> /// <param name="logger">The logger.</param>
/// <param name="namingOptions">The naming options.</param> /// <param name="namingOptions">The naming options.</param>
public SeriesResolver(ILogger<SeriesResolver> logger, NamingOptions namingOptions) public SeriesResolver(ILogger<SeriesResolver> logger, NamingOptions namingOptions)
{ {
_logger = logger; _logger = logger;
_namingOptions = namingOptions; _namingOptions = namingOptions;

View File

@@ -318,13 +318,13 @@ namespace Emby.Server.Implementations.Localization
// A lot of countries don't explicitly have a separate rating for adult content // A lot of countries don't explicitly have a separate rating for adult content
if (ratings.All(x => x.RatingScore?.Score != 1000)) if (ratings.All(x => x.RatingScore?.Score != 1000))
{ {
ratings.Add(new ParentalRating("XXX", new(1000, null))); ratings.Add(new ParentalRating("XXX", new(1000, null)));
} }
// A lot of countries don't explicitly have a separate rating for banned content // A lot of countries don't explicitly have a separate rating for banned content
if (ratings.All(x => x.RatingScore?.Score != 1001)) if (ratings.All(x => x.RatingScore?.Score != 1001))
{ {
ratings.Add(new ParentalRating("Banned", new(1001, null))); ratings.Add(new ParentalRating("Banned", new(1001, null)));
} }
return [.. ratings.OrderBy(r => r.RatingScore?.Score).ThenBy(r => r.RatingScore?.SubScore)]; return [.. ratings.OrderBy(r => r.RatingScore?.Score).ThenBy(r => r.RatingScore?.SubScore)];

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading; using System.Threading;

View File

@@ -386,7 +386,7 @@ namespace Emby.Server.Implementations.Session
{ {
if (session is null) if (session is null)
{ {
return; return;
} }
if (string.IsNullOrEmpty(info.MediaSourceId)) if (string.IsNullOrEmpty(info.MediaSourceId))

View File

@@ -89,11 +89,11 @@ public class SystemManager : ISystemManager
.GetVirtualFolders() .GetVirtualFolders()
.Where(e => !string.IsNullOrWhiteSpace(e.ItemId)) // this should not be null but for some users it is. .Where(e => !string.IsNullOrWhiteSpace(e.ItemId)) // this should not be null but for some users it is.
.Select(e => new LibraryStorageInfo() .Select(e => new LibraryStorageInfo()
{ {
Id = Guid.Parse(e.ItemId), Id = Guid.Parse(e.ItemId),
Name = e.Name, Name = e.Name,
Folders = e.Locations.Select(f => StorageHelper.GetFreeSpaceOf(f)).ToArray() Folders = e.Locations.Select(f => StorageHelper.GetFreeSpaceOf(f)).ToArray()
}); });
return new SystemStorageInfo() return new SystemStorageInfo()
{ {

View File

@@ -91,18 +91,18 @@ public class AudioController : BaseJellyfinApiController
[ProducesAudioFile] [ProducesAudioFile]
public async Task<ActionResult> GetAudioStream( public async Task<ActionResult> GetAudioStream(
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? container, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? container,
[FromQuery] bool? @static, [FromQuery] bool? @static,
[FromQuery] string? @params, [FromQuery] string? @params,
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -112,7 +112,7 @@ public class AudioController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -131,8 +131,8 @@ public class AudioController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -255,18 +255,18 @@ public class AudioController : BaseJellyfinApiController
[ProducesAudioFile] [ProducesAudioFile]
public async Task<ActionResult> GetAudioStreamByContainer( public async Task<ActionResult> GetAudioStreamByContainer(
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromRoute, Required] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container, [FromRoute, Required][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container,
[FromQuery] bool? @static, [FromQuery] bool? @static,
[FromQuery] string? @params, [FromQuery] string? @params,
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -276,7 +276,7 @@ public class AudioController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -295,8 +295,8 @@ public class AudioController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,

View File

@@ -167,18 +167,18 @@ public class DynamicHlsController : BaseJellyfinApiController
[ProducesPlaylistFile] [ProducesPlaylistFile]
public async Task<ActionResult> GetLiveHlsStream( public async Task<ActionResult> GetLiveHlsStream(
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? container, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? container,
[FromQuery] bool? @static, [FromQuery] bool? @static,
[FromQuery] string? @params, [FromQuery] string? @params,
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -188,7 +188,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -207,8 +207,8 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -413,12 +413,12 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery, Required] string mediaSourceId, [FromQuery, Required] string mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -428,7 +428,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -449,8 +449,8 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -586,12 +586,12 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery, Required] string mediaSourceId, [FromQuery, Required] string mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -602,7 +602,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -621,8 +621,8 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -753,12 +753,12 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -768,7 +768,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -789,8 +789,8 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -922,12 +922,12 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -938,7 +938,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -957,8 +957,8 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -1092,7 +1092,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromRoute, Required] string playlistId, [FromRoute, Required] string playlistId,
[FromRoute, Required] int segmentId, [FromRoute, Required] int segmentId,
[FromRoute, Required] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container, [FromRoute, Required][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container,
[FromQuery, Required] long runtimeTicks, [FromQuery, Required] long runtimeTicks,
[FromQuery, Required] long actualSegmentLengthTicks, [FromQuery, Required] long actualSegmentLengthTicks,
[FromQuery] bool? @static, [FromQuery] bool? @static,
@@ -1100,12 +1100,12 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -1115,7 +1115,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -1136,8 +1136,8 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -1274,7 +1274,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromRoute, Required] string playlistId, [FromRoute, Required] string playlistId,
[FromRoute, Required] int segmentId, [FromRoute, Required] int segmentId,
[FromRoute, Required] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container, [FromRoute, Required][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container,
[FromQuery, Required] long runtimeTicks, [FromQuery, Required] long runtimeTicks,
[FromQuery, Required] long actualSegmentLengthTicks, [FromQuery, Required] long actualSegmentLengthTicks,
[FromQuery] bool? @static, [FromQuery] bool? @static,
@@ -1282,12 +1282,12 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -1298,7 +1298,7 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -1317,8 +1317,8 @@ public class DynamicHlsController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,

View File

@@ -271,7 +271,7 @@ public class ItemsController : BaseJellyfinApiController
&& user.GetPreference(PreferenceKind.AllowedTags).Length != 0 && user.GetPreference(PreferenceKind.AllowedTags).Length != 0
&& !fields.Contains(ItemFields.Tags)) && !fields.Contains(ItemFields.Tags))
{ {
fields = [..fields, ItemFields.Tags]; fields = [.. fields, ItemFields.Tags];
} }
var dtoOptions = new DtoOptions { Fields = fields } var dtoOptions = new DtoOptions { Fields = fields }

View File

@@ -102,13 +102,13 @@ public class UniversalAudioController : BaseJellyfinApiController
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] Guid? userId, [FromQuery] Guid? userId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] int? transcodingAudioChannels, [FromQuery] int? transcodingAudioChannels,
[FromQuery] int? maxStreamingBitrate, [FromQuery] int? maxStreamingBitrate,
[FromQuery] int? audioBitRate, [FromQuery] int? audioBitRate,
[FromQuery] long? startTimeTicks, [FromQuery] long? startTimeTicks,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? transcodingContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? transcodingContainer,
[FromQuery] MediaStreamProtocol? transcodingProtocol, [FromQuery] MediaStreamProtocol? transcodingProtocol,
[FromQuery] int? maxAudioSampleRate, [FromQuery] int? maxAudioSampleRate,
[FromQuery] int? maxAudioBitDepth, [FromQuery] int? maxAudioBitDepth,

View File

@@ -88,7 +88,7 @@ public class UserViewsController : BaseJellyfinApiController
var folders = _userViewManager.GetUserViews(query); var folders = _userViewManager.GetUserViews(query);
var dtoOptions = new DtoOptions(); var dtoOptions = new DtoOptions();
dtoOptions.Fields = [..dtoOptions.Fields, ItemFields.PrimaryImageAspectRatio, ItemFields.DisplayPreferencesId]; dtoOptions.Fields = [.. dtoOptions.Fields, ItemFields.PrimaryImageAspectRatio, ItemFields.DisplayPreferencesId];
var dtos = Array.ConvertAll(folders, i => _dtoService.GetBaseItemDto(i, dtoOptions, user)); var dtos = Array.ConvertAll(folders, i => _dtoService.GetBaseItemDto(i, dtoOptions, user));

View File

@@ -317,18 +317,18 @@ public class VideosController : BaseJellyfinApiController
[ProducesVideoFile] [ProducesVideoFile]
public async Task<ActionResult> GetVideoStream( public async Task<ActionResult> GetVideoStream(
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? container, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? container,
[FromQuery] bool? @static, [FromQuery] bool? @static,
[FromQuery] string? @params, [FromQuery] string? @params,
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery, ParameterObsolete] string? deviceProfileId, [FromQuery, ParameterObsolete] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -338,7 +338,7 @@ public class VideosController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -359,8 +359,8 @@ public class VideosController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
@@ -555,18 +555,18 @@ public class VideosController : BaseJellyfinApiController
[ProducesVideoFile] [ProducesVideoFile]
public Task<ActionResult> GetVideoStreamByContainer( public Task<ActionResult> GetVideoStreamByContainer(
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromRoute, Required] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container, [FromRoute, Required][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string container,
[FromQuery] bool? @static, [FromQuery] bool? @static,
[FromQuery] string? @params, [FromQuery] string? @params,
[FromQuery] string? tag, [FromQuery] string? tag,
[FromQuery] string? deviceProfileId, [FromQuery] string? deviceProfileId,
[FromQuery] string? playSessionId, [FromQuery] string? playSessionId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? segmentContainer,
[FromQuery] int? segmentLength, [FromQuery] int? segmentLength,
[FromQuery] int? minSegments, [FromQuery] int? minSegments,
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] string? deviceId, [FromQuery] string? deviceId,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? audioCodec,
[FromQuery] bool? enableAutoStreamCopy, [FromQuery] bool? enableAutoStreamCopy,
[FromQuery] bool? allowVideoStreamCopy, [FromQuery] bool? allowVideoStreamCopy,
[FromQuery] bool? allowAudioStreamCopy, [FromQuery] bool? allowAudioStreamCopy,
@@ -576,7 +576,7 @@ public class VideosController : BaseJellyfinApiController
[FromQuery] int? audioChannels, [FromQuery] int? audioChannels,
[FromQuery] int? maxAudioChannels, [FromQuery] int? maxAudioChannels,
[FromQuery] string? profile, [FromQuery] string? profile,
[FromQuery] [RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level, [FromQuery][RegularExpression(EncodingHelper.LevelValidationRegexStr)] string? level,
[FromQuery] float? framerate, [FromQuery] float? framerate,
[FromQuery] float? maxFramerate, [FromQuery] float? maxFramerate,
[FromQuery] bool? copyTimestamps, [FromQuery] bool? copyTimestamps,
@@ -597,8 +597,8 @@ public class VideosController : BaseJellyfinApiController
[FromQuery] int? cpuCoreLimit, [FromQuery] int? cpuCoreLimit,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] bool? enableMpegtsM2TsMode, [FromQuery] bool? enableMpegtsM2TsMode,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? videoCodec,
[FromQuery] [RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec, [FromQuery][RegularExpression(EncodingHelper.ContainerValidationRegexStr)] string? subtitleCodec,
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,

View File

@@ -62,12 +62,12 @@ public static class FileStreamResponseHelpers
if (response.Headers.TryGetValues(HeaderNames.AcceptRanges, out var acceptRangesHeaders)) if (response.Headers.TryGetValues(HeaderNames.AcceptRanges, out var acceptRangesHeaders))
{ {
// Prefer upstream server's Accept-Ranges header if available // Prefer upstream server's Accept-Ranges header if available
acceptRangesValue = string.Join(", ", acceptRangesHeaders); acceptRangesValue = string.Join(", ", acceptRangesHeaders);
upstreamSupportsRange |= acceptRangesValue.Contains("bytes", StringComparison.OrdinalIgnoreCase); upstreamSupportsRange |= acceptRangesValue.Contains("bytes", StringComparison.OrdinalIgnoreCase);
} }
else if (upstreamSupportsRange) // If we got 206 but no Accept-Ranges header, assume bytes else if (upstreamSupportsRange) // If we got 206 but no Accept-Ranges header, assume bytes
{ {
acceptRangesValue = "bytes"; acceptRangesValue = "bytes";
} }
// Set Accept-Ranges header for the client based on upstream support // Set Accept-Ranges header for the client based on upstream support
@@ -76,13 +76,13 @@ public static class FileStreamResponseHelpers
// Set Content-Range header if upstream provided it (implies partial content) // Set Content-Range header if upstream provided it (implies partial content)
if (response.Content.Headers.ContentRange is not null) if (response.Content.Headers.ContentRange is not null)
{ {
httpContext.Response.Headers[HeaderNames.ContentRange] = response.Content.Headers.ContentRange.ToString(); httpContext.Response.Headers[HeaderNames.ContentRange] = response.Content.Headers.ContentRange.ToString();
} }
// Set Content-Length header. For partial content, this is the length of the partial segment. // Set Content-Length header. For partial content, this is the length of the partial segment.
if (response.Content.Headers.ContentLength.HasValue) if (response.Content.Headers.ContentLength.HasValue)
{ {
httpContext.Response.ContentLength = response.Content.Headers.ContentLength.Value; httpContext.Response.ContentLength = response.Content.Headers.ContentLength.Value;
} }
// Set Content-Type header // Set Content-Type header

View File

@@ -10,7 +10,7 @@ namespace Jellyfin.Api.Models.SystemInfoDtos;
/// </summary> /// </summary>
public record LibraryStorageDto public record LibraryStorageDto
{ {
/// <summary> /// <summary>
/// Gets or sets the Library Id. /// Gets or sets the Library Id.
/// </summary> /// </summary>
public required Guid Id { get; set; } public required Guid Id { get; set; }

View File

@@ -1,4 +1,4 @@
namespace Jellyfin.Data.Enums; namespace Jellyfin.Data.Enums;
/// <summary> /// <summary>
/// Activity log sorting options. /// Activity log sorting options.

View File

@@ -58,9 +58,9 @@ public class ActivityManager : IActivityManager
{ {
// TODO switch to LeftJoin in .NET 10. // TODO switch to LeftJoin in .NET 10.
var entries = from a in dbContext.ActivityLogs var entries = from a in dbContext.ActivityLogs
join u in dbContext.Users on a.UserId equals u.Id into ugj join u in dbContext.Users on a.UserId equals u.Id into ugj
from u in ugj.DefaultIfEmpty() from u in ugj.DefaultIfEmpty()
select new ExpandedActivityLog { ActivityLog = a, Username = u.Username }; select new ExpandedActivityLog { ActivityLog = a, Username = u.Username };
if (query.HasUserId is not null) if (query.HasUserId is not null)
{ {

View File

@@ -75,9 +75,9 @@ namespace Jellyfin.Server.Implementations.Events.Consumers.Session
eventArgs.DeviceName), eventArgs.DeviceName),
notificationType, notificationType,
user.Id) user.Id)
{ {
ItemId = eventArgs.Item?.Id.ToString("N", CultureInfo.InvariantCulture), ItemId = eventArgs.Item?.Id.ToString("N", CultureInfo.InvariantCulture),
}) })
.ConfigureAwait(false); .ConfigureAwait(false);
} }

View File

@@ -110,10 +110,10 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I
using var context = _dbProvider.CreateDbContext(); using var context = _dbProvider.CreateDbContext();
using var transaction = context.Database.BeginTransaction(); using var transaction = context.Database.BeginTransaction();
var existingPersons = context.Peoples.Select(e => new var existingPersons = context.Peoples.Select(e => new
{ {
item = e, item = e,
SelectionKey = e.Name.ToLower() + "-" + e.PersonType SelectionKey = e.Name.ToLower() + "-" + e.PersonType
}) })
.Where(p => personKeys.Contains(p.SelectionKey)) .Where(p => personKeys.Contains(p.SelectionKey))
.Select(f => f.item) .Select(f => f.item)
.ToArray(); .ToArray();

View File

@@ -302,7 +302,7 @@ namespace Jellyfin.Server.Implementations.Security
} }
else if (!escaped && token == '=') else if (!escaped && token == '=')
{ {
key = authorizationHeader[start.. i].Trim().ToString(); key = authorizationHeader[start..i].Trim().ToString();
start = i + 1; start = i + 1;
} }
} }

View File

@@ -68,7 +68,7 @@ internal sealed class CachingOpenApiProvider : ISwaggerProvider
try try
{ {
openApiDocument = _swaggerGenerator.GetSwagger(documentName); openApiDocument = _swaggerGenerator.GetSwagger(documentName);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -16,7 +16,7 @@ namespace Jellyfin.Server.Migrations
Applied = new List<(Guid Id, string Name)>(); Applied = new List<(Guid Id, string Name)>();
} }
// .Net xml serializer can't handle interfaces // .Net xml serializer can't handle interfaces
#pragma warning disable CA1002 // Do not expose generic lists #pragma warning disable CA1002 // Do not expose generic lists
/// <summary> /// <summary>
/// Gets the list of applied migration routine names. /// Gets the list of applied migration routine names.

View File

@@ -34,7 +34,7 @@ namespace MediaBrowser.Controller.Entities
} }
else else
{ {
item.RemoteTrailers = [..item.RemoteTrailers, mediaUrl]; item.RemoteTrailers = [.. item.RemoteTrailers, mediaUrl];
} }
} }
} }

View File

@@ -25,7 +25,7 @@ namespace MediaBrowser.Controller.Entities
} }
else else
{ {
item.Tags = [..current, name]; item.Tags = [.. current, name];
} }
} }
} }

View File

@@ -117,7 +117,7 @@ namespace MediaBrowser.Controller.Library
get get
{ {
var paths = string.IsNullOrEmpty(Path) ? Array.Empty<string>() : [Path]; var paths = string.IsNullOrEmpty(Path) ? Array.Empty<string>() : [Path];
return AdditionalLocations is null ? paths : [..paths, ..AdditionalLocations]; return AdditionalLocations is null ? paths : [.. paths, .. AdditionalLocations];
} }
} }

View File

@@ -1763,13 +1763,13 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
param += encoderPreset switch param += encoderPreset switch
{ {
EncoderPreset.veryslow => " -preset p7", EncoderPreset.veryslow => " -preset p7",
EncoderPreset.slower => " -preset p6", EncoderPreset.slower => " -preset p6",
EncoderPreset.slow => " -preset p5", EncoderPreset.slow => " -preset p5",
EncoderPreset.medium => " -preset p4", EncoderPreset.medium => " -preset p4",
EncoderPreset.fast => " -preset p3", EncoderPreset.fast => " -preset p3",
EncoderPreset.faster => " -preset p2", EncoderPreset.faster => " -preset p2",
_ => " -preset p1" _ => " -preset p1"
}; };
} }
else if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase) // h264 (h264_amf) else if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase) // h264 (h264_amf)
@@ -1779,11 +1779,11 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
param += encoderPreset switch param += encoderPreset switch
{ {
EncoderPreset.veryslow => " -quality quality", EncoderPreset.veryslow => " -quality quality",
EncoderPreset.slower => " -quality quality", EncoderPreset.slower => " -quality quality",
EncoderPreset.slow => " -quality quality", EncoderPreset.slow => " -quality quality",
EncoderPreset.medium => " -quality balanced", EncoderPreset.medium => " -quality balanced",
_ => " -quality speed" _ => " -quality speed"
}; };
if (string.Equals(videoEncoder, "hevc_amf", StringComparison.OrdinalIgnoreCase) if (string.Equals(videoEncoder, "hevc_amf", StringComparison.OrdinalIgnoreCase)
@@ -1803,11 +1803,11 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
param += encoderPreset switch param += encoderPreset switch
{ {
EncoderPreset.veryslow => " -prio_speed 0", EncoderPreset.veryslow => " -prio_speed 0",
EncoderPreset.slower => " -prio_speed 0", EncoderPreset.slower => " -prio_speed 0",
EncoderPreset.slow => " -prio_speed 0", EncoderPreset.slow => " -prio_speed 0",
EncoderPreset.medium => " -prio_speed 0", EncoderPreset.medium => " -prio_speed 0",
_ => " -prio_speed 1" _ => " -prio_speed 1"
}; };
} }
@@ -2759,25 +2759,29 @@ namespace MediaBrowser.Controller.MediaEncoding
|| string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase) || string.Equals(audioCodec, "ac3", StringComparison.OrdinalIgnoreCase)
|| string.Equals(audioCodec, "eac3", StringComparison.OrdinalIgnoreCase)) || string.Equals(audioCodec, "eac3", StringComparison.OrdinalIgnoreCase))
{ {
#pragma warning disable SA1008
return (inputChannels, outputChannels) switch return (inputChannels, outputChannels) switch
{ {
(>= 6, >= 6 or 0) => Math.Min(640000, bitrate), ( >= 6, >= 6 or 0) => Math.Min(640000, bitrate),
(> 0, > 0) => Math.Min(outputChannels * 128000, bitrate), ( > 0, > 0) => Math.Min(outputChannels * 128000, bitrate),
(> 0, _) => Math.Min(inputChannels * 128000, bitrate), ( > 0, _) => Math.Min(inputChannels * 128000, bitrate),
(_, _) => Math.Min(384000, bitrate) (_, _) => Math.Min(384000, bitrate)
}; };
#pragma warning restore SA1008
} }
if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase) if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase)
|| string.Equals(audioCodec, "dca", StringComparison.OrdinalIgnoreCase)) || string.Equals(audioCodec, "dca", StringComparison.OrdinalIgnoreCase))
{ {
#pragma warning disable SA1008
return (inputChannels, outputChannels) switch return (inputChannels, outputChannels) switch
{ {
(>= 6, >= 6 or 0) => Math.Min(768000, bitrate), ( >= 6, >= 6 or 0) => Math.Min(768000, bitrate),
(> 0, > 0) => Math.Min(outputChannels * 136000, bitrate), ( > 0, > 0) => Math.Min(outputChannels * 136000, bitrate),
(> 0, _) => Math.Min(inputChannels * 136000, bitrate), ( > 0, _) => Math.Min(inputChannels * 136000, bitrate),
(_, _) => Math.Min(672000, bitrate) (_, _) => Math.Min(672000, bitrate)
}; };
#pragma warning restore SA1008
} }
// Empty bitrate area is not allow on iOS // Empty bitrate area is not allow on iOS

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@@ -141,7 +141,8 @@ namespace MediaBrowser.Controller.SyncPlay.GroupStates
_logger.LogError("Unable to set playing queue in group {GroupId}.", context.GroupId.ToString()); _logger.LogError("Unable to set playing queue in group {GroupId}.", context.GroupId.ToString());
// Ignore request and return to previous state. // Ignore request and return to previous state.
IGroupState newState = prevState switch { IGroupState newState = prevState switch
{
GroupStateType.Playing => new PlayingGroupState(LoggerFactory), GroupStateType.Playing => new PlayingGroupState(LoggerFactory),
GroupStateType.Paused => new PausedGroupState(LoggerFactory), GroupStateType.Paused => new PausedGroupState(LoggerFactory),
_ => new IdleGroupState(LoggerFactory) _ => new IdleGroupState(LoggerFactory)

View File

@@ -143,16 +143,16 @@ namespace MediaBrowser.LocalMetadata.Parsers
item.Name = reader.ReadNormalizedString(); item.Name = reader.ReadNormalizedString();
break; break;
case "CriticRating": case "CriticRating":
{
var text = reader.ReadElementContentAsString();
if (float.TryParse(text, CultureInfo.InvariantCulture, out var value))
{ {
item.CriticRating = value; var text = reader.ReadElementContentAsString();
}
break; if (float.TryParse(text, CultureInfo.InvariantCulture, out var value))
} {
item.CriticRating = value;
}
break;
}
case "SortTitle": case "SortTitle":
item.ForcedSortName = reader.ReadNormalizedString(); item.ForcedSortName = reader.ReadNormalizedString();
@@ -176,55 +176,55 @@ namespace MediaBrowser.LocalMetadata.Parsers
break; break;
case "LockedFields": case "LockedFields":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{ {
item.LockedFields = val.Split('|').Select(i => var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{ {
if (Enum.TryParse(i, true, out MetadataField field)) item.LockedFields = val.Split('|').Select(i =>
{ {
return (MetadataField?)field; if (Enum.TryParse(i, true, out MetadataField field))
} {
return (MetadataField?)field;
}
return null; return null;
}).Where(i => i.HasValue).Select(i => i!.Value).ToArray(); }).Where(i => i.HasValue).Select(i => i!.Value).ToArray();
}
break;
} }
break;
}
case "TagLines": case "TagLines":
{
if (!reader.IsEmptyElement)
{ {
using (var subtree = reader.ReadSubtree()) if (!reader.IsEmptyElement)
{ {
FetchFromTaglinesNode(subtree, item); using (var subtree = reader.ReadSubtree())
{
FetchFromTaglinesNode(subtree, item);
}
}
else
{
reader.Read();
} }
}
else
{
reader.Read();
}
break; break;
} }
case "Countries": case "Countries":
{
if (!reader.IsEmptyElement)
{ {
reader.Skip(); if (!reader.IsEmptyElement)
} {
else reader.Skip();
{ }
reader.Read(); else
} {
reader.Read();
}
break; break;
} }
case "ContentRating": case "ContentRating":
case "MPAARating": case "MPAARating":
@@ -307,19 +307,19 @@ namespace MediaBrowser.LocalMetadata.Parsers
break; break;
case "Trailers": case "Trailers":
{
if (!reader.IsEmptyElement)
{ {
using var subtree = reader.ReadSubtree(); if (!reader.IsEmptyElement)
FetchDataFromTrailersNode(subtree, item); {
} using var subtree = reader.ReadSubtree();
else FetchDataFromTrailersNode(subtree, item);
{ }
reader.Read(); else
} {
reader.Read();
}
break; break;
} }
case "ProductionYear": case "ProductionYear":
if (reader.TryReadInt(out var productionYear) && productionYear > 1850) if (reader.TryReadInt(out var productionYear) && productionYear > 1850)
@@ -330,20 +330,20 @@ namespace MediaBrowser.LocalMetadata.Parsers
break; break;
case "Rating": case "Rating":
case "IMDBrating": case "IMDBrating":
{
var rating = reader.ReadNormalizedString();
if (!string.IsNullOrEmpty(rating))
{ {
// All external meta is saving this as '.' for decimal I believe...but just to be sure var rating = reader.ReadNormalizedString();
if (float.TryParse(rating.Replace(',', '.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var val))
{
item.CommunityRating = val;
}
}
break; if (!string.IsNullOrEmpty(rating))
} {
// All external meta is saving this as '.' for decimal I believe...but just to be sure
if (float.TryParse(rating.Replace(',', '.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var val))
{
item.CommunityRating = val;
}
}
break;
}
case "BirthDate": case "BirthDate":
case "PremiereDate": case "PremiereDate":
@@ -370,144 +370,144 @@ namespace MediaBrowser.LocalMetadata.Parsers
break; break;
case "Genres": case "Genres":
{
if (!reader.IsEmptyElement)
{ {
using var subtree = reader.ReadSubtree(); if (!reader.IsEmptyElement)
FetchFromGenresNode(subtree, item); {
} using var subtree = reader.ReadSubtree();
else FetchFromGenresNode(subtree, item);
{ }
reader.Read(); else
} {
reader.Read();
}
break; break;
} }
case "Tags": case "Tags":
{
if (!reader.IsEmptyElement)
{ {
using var subtree = reader.ReadSubtree(); if (!reader.IsEmptyElement)
FetchFromTagsNode(subtree, item); {
} using var subtree = reader.ReadSubtree();
else FetchFromTagsNode(subtree, item);
{ }
reader.Read(); else
} {
reader.Read();
}
break; break;
} }
case "Persons": case "Persons":
{
if (!reader.IsEmptyElement)
{ {
using var subtree = reader.ReadSubtree(); if (!reader.IsEmptyElement)
FetchDataFromPersonsNode(subtree, itemResult); {
} using var subtree = reader.ReadSubtree();
else FetchDataFromPersonsNode(subtree, itemResult);
{ }
reader.Read(); else
} {
reader.Read();
}
break; break;
} }
case "Studios": case "Studios":
{
if (!reader.IsEmptyElement)
{ {
using var subtree = reader.ReadSubtree(); if (!reader.IsEmptyElement)
FetchFromStudiosNode(subtree, item); {
} using var subtree = reader.ReadSubtree();
else FetchFromStudiosNode(subtree, item);
{ }
reader.Read(); else
} {
reader.Read();
}
break; break;
} }
case "Shares": case "Shares":
{
if (!reader.IsEmptyElement)
{ {
using var subtree = reader.ReadSubtree(); if (!reader.IsEmptyElement)
if (item is IHasShares hasShares)
{ {
FetchFromSharesNode(subtree, hasShares); using var subtree = reader.ReadSubtree();
if (item is IHasShares hasShares)
{
FetchFromSharesNode(subtree, hasShares);
}
}
else
{
reader.Read();
} }
}
else
{
reader.Read();
}
break; break;
} }
case "OwnerUserId": case "OwnerUserId":
{
var val = reader.ReadNormalizedString();
if (Guid.TryParse(val, out var guid) && !guid.Equals(Guid.Empty))
{ {
if (item is Playlist playlist) var val = reader.ReadNormalizedString();
{
playlist.OwnerUserId = guid;
}
}
break; if (Guid.TryParse(val, out var guid) && !guid.Equals(Guid.Empty))
} {
if (item is Playlist playlist)
{
playlist.OwnerUserId = guid;
}
}
break;
}
case "Format3D": case "Format3D":
{
var val = reader.ReadNormalizedString();
if (item is Video video)
{ {
if (string.Equals("HSBS", val, StringComparison.OrdinalIgnoreCase)) var val = reader.ReadNormalizedString();
{
video.Video3DFormat = Video3DFormat.HalfSideBySide;
}
else if (string.Equals("HTAB", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.HalfTopAndBottom;
}
else if (string.Equals("FTAB", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.FullTopAndBottom;
}
else if (string.Equals("FSBS", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.FullSideBySide;
}
else if (string.Equals("MVC", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.MVC;
}
}
break; if (item is Video video)
} {
if (string.Equals("HSBS", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.HalfSideBySide;
}
else if (string.Equals("HTAB", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.HalfTopAndBottom;
}
else if (string.Equals("FTAB", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.FullTopAndBottom;
}
else if (string.Equals("FSBS", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.FullSideBySide;
}
else if (string.Equals("MVC", val, StringComparison.OrdinalIgnoreCase))
{
video.Video3DFormat = Video3DFormat.MVC;
}
}
break;
}
default: default:
{
string readerName = reader.Name;
if (_validProviderIds!.TryGetValue(readerName, out string? providerIdValue))
{ {
var id = reader.ReadNormalizedString(); string readerName = reader.Name;
item.TrySetProviderId(providerIdValue, id); if (_validProviderIds!.TryGetValue(readerName, out string? providerIdValue))
} {
else var id = reader.ReadNormalizedString();
{ item.TrySetProviderId(providerIdValue, id);
reader.Skip(); }
} else
{
reader.Skip();
}
break; break;
} }
} }
} }
@@ -526,31 +526,31 @@ namespace MediaBrowser.LocalMetadata.Parsers
switch (reader.Name) switch (reader.Name)
{ {
case "Share": case "Share":
{
if (reader.IsEmptyElement)
{ {
reader.Read(); if (reader.IsEmptyElement)
continue;
}
using (var subReader = reader.ReadSubtree())
{
var child = GetShare(subReader);
if (child is not null)
{ {
list.Add(child); reader.Read();
continue;
} }
}
break; using (var subReader = reader.ReadSubtree())
} {
var child = GetShare(subReader);
if (child is not null)
{
list.Add(child);
}
}
break;
}
default: default:
{ {
reader.Skip(); reader.Skip();
break; break;
} }
} }
} }
else else

View File

@@ -64,32 +64,32 @@ namespace MediaBrowser.LocalMetadata.Parsers
switch (reader.Name) switch (reader.Name)
{ {
case "CollectionItem": case "CollectionItem":
{
if (!reader.IsEmptyElement)
{ {
using (var subReader = reader.ReadSubtree()) if (!reader.IsEmptyElement)
{ {
var child = GetLinkedChild(subReader); using (var subReader = reader.ReadSubtree())
if (child is not null)
{ {
list.Add(child); var child = GetLinkedChild(subReader);
if (child is not null)
{
list.Add(child);
}
} }
} }
} else
else {
{ reader.Read();
reader.Read(); }
}
break; break;
} }
default: default:
{ {
reader.Skip(); reader.Skip();
break; break;
} }
} }
} }
else else

View File

@@ -76,25 +76,25 @@ namespace MediaBrowser.LocalMetadata.Parsers
switch (reader.Name) switch (reader.Name)
{ {
case "PlaylistItem": case "PlaylistItem":
{
if (reader.IsEmptyElement)
{ {
reader.Read(); if (reader.IsEmptyElement)
continue;
}
using (var subReader = reader.ReadSubtree())
{
var child = GetLinkedChild(subReader);
if (child is not null)
{ {
list.Add(child); reader.Read();
continue;
} }
}
break; using (var subReader = reader.ReadSubtree())
} {
var child = GetLinkedChild(subReader);
if (child is not null)
{
list.Add(child);
}
}
break;
}
default: default:
reader.Skip(); reader.Skip();

View File

@@ -163,19 +163,19 @@ namespace MediaBrowser.MediaEncoding.Attachments
int exitCode; int exitCode;
using (var process = new Process using (var process = new Process
{
StartInfo = new ProcessStartInfo
{ {
StartInfo = new ProcessStartInfo Arguments = processArgs,
{ FileName = _mediaEncoder.EncoderPath,
Arguments = processArgs, UseShellExecute = false,
FileName = _mediaEncoder.EncoderPath, CreateNoWindow = true,
UseShellExecute = false, WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true, WorkingDirectory = outputFolder,
WindowStyle = ProcessWindowStyle.Hidden, ErrorDialog = false
WorkingDirectory = outputFolder, },
ErrorDialog = false EnableRaisingEvents = true
}, })
EnableRaisingEvents = true
})
{ {
_logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments); _logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments);
@@ -295,18 +295,18 @@ namespace MediaBrowser.MediaEncoding.Attachments
int exitCode; int exitCode;
using (var process = new Process using (var process = new Process
{
StartInfo = new ProcessStartInfo
{ {
StartInfo = new ProcessStartInfo Arguments = processArgs,
{ FileName = _mediaEncoder.EncoderPath,
Arguments = processArgs, UseShellExecute = false,
FileName = _mediaEncoder.EncoderPath, CreateNoWindow = true,
UseShellExecute = false, WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true, ErrorDialog = false
WindowStyle = ProcessWindowStyle.Hidden, },
ErrorDialog = false EnableRaisingEvents = true
}, })
EnableRaisingEvents = true
})
{ {
_logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments); _logger.LogInformation("{File} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments);

View File

@@ -190,10 +190,10 @@ namespace MediaBrowser.MediaEncoding.Subtitles
await using (stream.ConfigureAwait(false)) await using (stream.ConfigureAwait(false))
{ {
using var reader = new StreamReader(stream, detected.Encoding); using var reader = new StreamReader(stream, detected.Encoding);
var text = await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false); var text = await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false);
return new MemoryStream(Encoding.UTF8.GetBytes(text)); return new MemoryStream(Encoding.UTF8.GetBytes(text));
} }
} }
} }
@@ -1027,20 +1027,20 @@ namespace MediaBrowser.MediaEncoding.Subtitles
switch (protocol) switch (protocol)
{ {
case MediaProtocol.Http: case MediaProtocol.Http:
{ {
using var stream = await _httpClientFactory using var stream = await _httpClientFactory
.CreateClient(NamedClient.Default) .CreateClient(NamedClient.Default)
.GetStreamAsync(new Uri(path), cancellationToken) .GetStreamAsync(new Uri(path), cancellationToken)
.ConfigureAwait(false); .ConfigureAwait(false);
return await CharsetDetector.DetectFromStreamAsync(stream, cancellationToken).ConfigureAwait(false); return await CharsetDetector.DetectFromStreamAsync(stream, cancellationToken).ConfigureAwait(false);
} }
case MediaProtocol.File: case MediaProtocol.File:
{ {
return await CharsetDetector.DetectFromFileAsync(path, cancellationToken) return await CharsetDetector.DetectFromFileAsync(path, cancellationToken)
.ConfigureAwait(false); .ConfigureAwait(false);
} }
default: default:
throw new ArgumentOutOfRangeException(nameof(protocol), protocol, "Unsupported protocol"); throw new ArgumentOutOfRangeException(nameof(protocol), protocol, "Unsupported protocol");

View File

@@ -50,7 +50,7 @@ namespace MediaBrowser.Model.Extensions
return 0; return 0;
}) })
.ThenByDescending(i => Math.Round(i.CommunityRating ?? 0, 1) ) .ThenByDescending(i => Math.Round(i.CommunityRating ?? 0, 1))
.ThenByDescending(i => i.VoteCount ?? 0); .ThenByDescending(i => i.VoteCount ?? 0);
} }
} }

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Jellyfin.Database.Implementations.Entities; using Jellyfin.Database.Implementations.Entities;
using MediaBrowser.Model.MediaSegments; using MediaBrowser.Model.MediaSegments;

View File

@@ -50,7 +50,7 @@ namespace MediaBrowser.Model.SyncPlay
/// </summary> /// </summary>
Seek = 8, Seek = 8,
/// <summary> /// <summary>
/// A user is signaling that playback is buffering. /// A user is signaling that playback is buffering.
/// </summary> /// </summary>
Buffer = 9, Buffer = 9,

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
namespace MediaBrowser.Model.SyncPlay; namespace MediaBrowser.Model.SyncPlay;

View File

@@ -187,7 +187,7 @@ namespace MediaBrowser.Model.Users
[Required(AllowEmptyStrings = false)] [Required(AllowEmptyStrings = false)]
public string AuthenticationProviderId { get; set; } public string AuthenticationProviderId { get; set; }
[Required(AllowEmptyStrings= false)] [Required(AllowEmptyStrings = false)]
public string PasswordResetProviderId { get; set; } public string PasswordResetProviderId { get; set; }
/// <summary> /// <summary>

View File

@@ -1,4 +1,4 @@
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml; using System.Xml;

View File

@@ -19,7 +19,7 @@ public class MusicBrainzReleaseGroupExternalUrlProvider : IExternalUrlProvider
{ {
if (item is MusicAlbum) if (item is MusicAlbum)
{ {
if (item.TryGetProviderId(MetadataProvider.MusicBrainzReleaseGroup, out var externalId)) if (item.TryGetProviderId(MetadataProvider.MusicBrainzReleaseGroup, out var externalId))
{ {
yield return Plugin.Instance!.Configuration.Server + $"/release-group/{externalId}"; yield return Plugin.Instance!.Configuration.Server + $"/release-group/{externalId}";
} }

View File

@@ -19,7 +19,7 @@ public class MusicBrainzTrackExternalUrlProvider : IExternalUrlProvider
{ {
if (item is Audio) if (item is Audio)
{ {
if (item.TryGetProviderId(MetadataProvider.MusicBrainzTrack, out var externalId)) if (item.TryGetProviderId(MetadataProvider.MusicBrainzTrack, out var externalId))
{ {
yield return Plugin.Instance!.Configuration.Server + $"/track/{externalId}"; yield return Plugin.Instance!.Configuration.Server + $"/track/{externalId}";
} }

View File

@@ -19,6 +19,6 @@ public class Zap2ItExternalUrlProvider : IExternalUrlProvider
if (item.TryGetProviderId(MetadataProvider.Zap2It, out var externalId)) if (item.TryGetProviderId(MetadataProvider.Zap2It, out var externalId))
{ {
yield return $"http://tvlistings.zap2it.com/overview.html?programSeriesId={externalId}"; yield return $"http://tvlistings.zap2it.com/overview.html?programSeriesId={externalId}";
} }
} }
} }

View File

@@ -96,7 +96,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var artist = reader.ReadNormalizedString(); var artist = reader.ReadNormalizedString();
if (!string.IsNullOrEmpty(artist) && item is MusicVideo artistVideo) if (!string.IsNullOrEmpty(artist) && item is MusicVideo artistVideo)
{ {
artistVideo.Artists = [..artistVideo.Artists, artist]; artistVideo.Artists = [.. artistVideo.Artists, artist];
} }
break; break;

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using System; using System;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -1,4 +1,4 @@
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable

View File

@@ -234,20 +234,20 @@ public class SkiaEncoder : IImageEncoder
return default; return default;
default: default:
{
var boundsInfo = SKBitmap.DecodeBounds(safePath);
if (boundsInfo.Width > 0 && boundsInfo.Height > 0)
{ {
return new ImageDimensions(boundsInfo.Width, boundsInfo.Height); var boundsInfo = SKBitmap.DecodeBounds(safePath);
if (boundsInfo.Width > 0 && boundsInfo.Height > 0)
{
return new ImageDimensions(boundsInfo.Width, boundsInfo.Height);
}
_logger.LogWarning(
"Unable to determine image dimensions for {FilePath}: {SkCodecResult}",
path,
result);
return default;
} }
_logger.LogWarning(
"Unable to determine image dimensions for {FilePath}: {SkCodecResult}",
path,
result);
return default;
}
} }
} }
finally finally
@@ -398,7 +398,7 @@ public class SkiaEncoder : IImageEncoder
try try
{ {
// If we have to resize these they often end up distorted // If we have to resize these they often end up distorted
if (resultBitmap.ColorType == SKColorType.Gray8) if (resultBitmap.ColorType == SKColorType.Gray8)
{ {
using (resultBitmap) using (resultBitmap)

View File

@@ -1129,7 +1129,7 @@ namespace Jellyfin.LiveTv.Channels
{ {
if (!item.Tags.Contains("livestream", StringComparison.OrdinalIgnoreCase)) if (!item.Tags.Contains("livestream", StringComparison.OrdinalIgnoreCase))
{ {
item.Tags = [..item.Tags, "livestream"]; item.Tags = [.. item.Tags, "livestream"];
_logger.LogDebug("Forcing update due to Tags {0}", item.Name); _logger.LogDebug("Forcing update due to Tags {0}", item.Name);
forceUpdate = true; forceUpdate = true;
} }

View File

@@ -67,7 +67,7 @@ public class ListingsManager : IListingsManager
if (index == -1 || string.IsNullOrWhiteSpace(info.Id)) if (index == -1 || string.IsNullOrWhiteSpace(info.Id))
{ {
info.Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture); info.Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
config.ListingProviders = [..list, info]; config.ListingProviders = [.. list, info];
} }
else else
{ {
@@ -255,7 +255,7 @@ public class ListingsManager : IListingsManager
Name = tunerChannelNumber, Name = tunerChannelNumber,
Value = providerChannelNumber Value = providerChannelNumber
}; };
listingsProviderInfo.ChannelMappings = [..listingsProviderInfo.ChannelMappings, newItem]; listingsProviderInfo.ChannelMappings = [.. listingsProviderInfo.ChannelMappings, newItem];
} }
_config.SaveConfiguration("livetv", config); _config.SaveConfiguration("livetv", config);

View File

@@ -116,7 +116,7 @@ namespace Jellyfin.LiveTv.Timers
throw new ArgumentException("item already exists", nameof(item)); throw new ArgumentException("item already exists", nameof(item));
} }
_items = [.._items, item]; _items = [.. _items, item];
SaveList(); SaveList();
} }
@@ -131,7 +131,7 @@ namespace Jellyfin.LiveTv.Timers
int index = Array.FindIndex(_items, i => EqualityComparer(i, item)); int index = Array.FindIndex(_items, i => EqualityComparer(i, item));
if (index == -1) if (index == -1)
{ {
_items = [.._items, item]; _items = [.. _items, item];
} }
else else
{ {

View File

@@ -83,7 +83,7 @@ public class TunerHostManager : ITunerHostManager
if (index == -1 || string.IsNullOrWhiteSpace(info.Id)) if (index == -1 || string.IsNullOrWhiteSpace(info.Id))
{ {
info.Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture); info.Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
config.TunerHosts = [..list, info]; config.TunerHosts = [.. list, info];
} }
else else
{ {

View File

@@ -356,7 +356,7 @@ public class NetworkManager : INetworkManager, IDisposable
{ {
lock (_initLock) lock (_initLock)
{ {
_interfaces = FilterBindSettings(config, _interfaces, IsIPv4Enabled, IsIPv6Enabled).ToList(); _interfaces = FilterBindSettings(config, _interfaces, IsIPv4Enabled, IsIPv6Enabled).ToList();
} }
} }

View File

@@ -37,9 +37,9 @@ public class FFProbeVideoInfoTests
{ {
Assert.Throws<ArgumentException>( Assert.Throws<ArgumentException>(
() => _fFProbeVideoInfo.CreateDummyChapters(new Video() () => _fFProbeVideoInfo.CreateDummyChapters(new Video()
{ {
RunTimeTicks = runtime RunTimeTicks = runtime
})); }));
} }
[Theory] [Theory]
@@ -53,9 +53,9 @@ public class FFProbeVideoInfoTests
public void CreateDummyChapters_ValidRuntime_CorrectChaptersCount(long? runtime, int chaptersCount) public void CreateDummyChapters_ValidRuntime_CorrectChaptersCount(long? runtime, int chaptersCount)
{ {
var chapters = _fFProbeVideoInfo.CreateDummyChapters(new Video() var chapters = _fFProbeVideoInfo.CreateDummyChapters(new Video()
{ {
RunTimeTicks = runtime RunTimeTicks = runtime
}); });
Assert.Equal(chaptersCount, chapters.Length); Assert.Equal(chaptersCount, chapters.Length);
} }
@@ -69,9 +69,9 @@ public class FFProbeVideoInfoTests
public void CreateDummyChapters_PositiveRuntime_NoChapterBeyondRuntime(long runtime) public void CreateDummyChapters_PositiveRuntime_NoChapterBeyondRuntime(long runtime)
{ {
var chapters = _fFProbeVideoInfo.CreateDummyChapters(new Video() var chapters = _fFProbeVideoInfo.CreateDummyChapters(new Video()
{ {
RunTimeTicks = runtime RunTimeTicks = runtime
}); });
Assert.All(chapters, chapter => Assert.True(chapter.StartPositionTicks < runtime)); Assert.All(chapters, chapter => Assert.True(chapter.StartPositionTicks < runtime));
} }