aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2022-10-13 19:08:00 +0200
committerBond_009 <bond.009@outlook.com>2022-12-07 16:43:59 +0100
commitb366dc2e6e5be2b93f2b6fcc4549a32b655c3806 (patch)
tree8f7ee8407e31e58db9aabe74bfc21936275ec45e /Jellyfin.Api
parent93fd462b581207d937c5d4eb939b1cc96c86c1f2 (diff)
Use ArgumentException.ThrowIfNullOrEmpty
Diffstat (limited to 'Jellyfin.Api')
-rw-r--r--Jellyfin.Api/Controllers/SessionController.cs5
-rw-r--r--Jellyfin.Api/Helpers/TranscodingJobHelper.cs10
2 files changed, 3 insertions, 12 deletions
diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs
index 9218c3b5cf..085ac808b4 100644
--- a/Jellyfin.Api/Controllers/SessionController.cs
+++ b/Jellyfin.Api/Controllers/SessionController.cs
@@ -294,10 +294,7 @@ namespace Jellyfin.Api.Controllers
{
var currentSession = await RequestHelpers.GetSession(_sessionManager, _userManager, HttpContext).ConfigureAwait(false);
- if (command is null)
- {
- throw new ArgumentException("Request body may not be null");
- }
+ ArgumentNullException.ThrowIfNull(command, "Request body may not be null");
command.ControllingUserId = currentSession.UserId;
diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
index cb3442ccb8..77dd518608 100644
--- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
+++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
@@ -136,10 +136,7 @@ namespace Jellyfin.Api.Helpers
/// <exception cref="ArgumentNullException">Play session id is null.</exception>
public void PingTranscodingJob(string playSessionId, bool? isUserPaused)
{
- if (string.IsNullOrEmpty(playSessionId))
- {
- throw new ArgumentNullException(nameof(playSessionId));
- }
+ ArgumentException.ThrowIfNullOrEmpty(playSessionId);
_logger.LogDebug("PingTranscodingJob PlaySessionId={0} isUsedPaused: {1}", playSessionId, isUserPaused);
@@ -522,10 +519,7 @@ namespace Jellyfin.Api.Helpers
}
}
- if (string.IsNullOrEmpty(_mediaEncoder.EncoderPath))
- {
- throw new ArgumentException("FFmpeg path not set.");
- }
+ ArgumentException.ThrowIfNullOrEmpty(_mediaEncoder.EncoderPath);
// If subtitles get burned in fonts may need to be extracted from the media file
if (state.SubtitleStream is not null && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode)