diff options
| author | Bond-009 <bond.009@outlook.com> | 2022-12-07 16:39:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 16:39:40 +0100 |
| commit | f3c57e6a0ae015dc51cf548a0380d1bed33959c2 (patch) | |
| tree | 1052ce5b7646e4fea7b20768213e89c0e38126ec /Jellyfin.Api/Helpers/TranscodingJobHelper.cs | |
| parent | 681be595cea8254cbac5bbb3bdc9083c4780db21 (diff) | |
| parent | 52194f56b5f07e3ae01e2fb6d121452e37d1e93f (diff) | |
Merge pull request #8511 from Bond-009/isnull
Diffstat (limited to 'Jellyfin.Api/Helpers/TranscodingJobHelper.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/TranscodingJobHelper.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs index c663c6e31..cb3442ccb 100644 --- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs +++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs @@ -416,7 +416,7 @@ namespace Jellyfin.Api.Helpers } } - if (exs != null) + if (exs is not null) { throw new AggregateException("Error deleting HLS files", exs); } @@ -443,7 +443,7 @@ namespace Jellyfin.Api.Helpers { var ticks = transcodingPosition?.Ticks; - if (job != null) + if (job is not null) { job.Framerate = framerate; job.CompletionPercentage = percentComplete; @@ -510,11 +510,11 @@ namespace Jellyfin.Api.Helpers await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false); - if (state.VideoRequest != null && !EncodingHelper.IsCopyCodec(state.OutputVideoCodec)) + if (state.VideoRequest is not null && !EncodingHelper.IsCopyCodec(state.OutputVideoCodec)) { var userId = request.HttpContext.User.GetUserId(); var user = userId.Equals(default) ? null : _userManager.GetUserById(userId); - if (user != null && !user.HasPermission(PermissionKind.EnableVideoPlaybackTranscoding)) + if (user is not null && !user.HasPermission(PermissionKind.EnableVideoPlaybackTranscoding)) { this.OnTranscodeFailedToStart(outputPath, transcodingJobType, state); @@ -528,7 +528,7 @@ namespace Jellyfin.Api.Helpers } // If subtitles get burned in fonts may need to be extracted from the media file - if (state.SubtitleStream != null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode) + if (state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode) { var attachmentPath = Path.Combine(_appPaths.CachePath, "attachments", state.MediaSource.Id); await _attachmentExtractor.ExtractAllAttachments(state.MediaPath, state.MediaSource, attachmentPath, cancellationTokenSource.Token).ConfigureAwait(false); @@ -577,7 +577,7 @@ namespace Jellyfin.Api.Helpers _logger.LogInformation("{Filename} {Arguments}", process.StartInfo.FileName, process.StartInfo.Arguments); var logFilePrefix = "FFmpeg.Transcode-"; - if (state.VideoRequest != null + if (state.VideoRequest is not null && EncodingHelper.IsCopyCodec(state.OutputVideoCodec)) { logFilePrefix = EncodingHelper.IsCopyCodec(state.OutputAudioCodec) @@ -748,7 +748,7 @@ namespace Jellyfin.Api.Helpers { var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase)); - if (job != null) + if (job is not null) { _activeTranscodingJobs.Remove(job); } @@ -805,7 +805,7 @@ namespace Jellyfin.Api.Helpers _encodingHelper.AttachMediaSourceInfo(state, encodingOptions, liveStreamResponse.MediaSource, state.RequestedUrl); - if (state.VideoRequest != null) + if (state.VideoRequest is not null) { _encodingHelper.TryStreamCopy(state); } @@ -829,7 +829,7 @@ namespace Jellyfin.Api.Helpers { var job = _activeTranscodingJobs.FirstOrDefault(j => j.Type == type && string.Equals(j.Path, path, StringComparison.OrdinalIgnoreCase)); - if (job == null) + if (job is null) { return null; } |
