From b366dc2e6e5be2b93f2b6fcc4549a32b655c3806 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Thu, 13 Oct 2022 19:08:00 +0200 Subject: Use ArgumentException.ThrowIfNullOrEmpty --- Jellyfin.Api/Helpers/TranscodingJobHelper.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'Jellyfin.Api/Helpers/TranscodingJobHelper.cs') diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs index cb3442ccb..77dd51860 100644 --- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs +++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs @@ -136,10 +136,7 @@ namespace Jellyfin.Api.Helpers /// Play session id is null. 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) -- cgit v1.2.3