aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-13 18:04:06 -0700
committercrobibero <cody@robibe.ro>2020-11-13 18:04:06 -0700
commit73d2cb1c2a3a7cd1a30840a2b52921a3b81c6809 (patch)
tree922229602e0dbff30c371e70ed16512fb27eaa1e /Jellyfin.Api/Helpers/TranscodingJobHelper.cs
parent24ac5cc353dd5b9930d43a5659d97037644fa58a (diff)
Updated based on review feedback
Diffstat (limited to 'Jellyfin.Api/Helpers/TranscodingJobHelper.cs')
-rw-r--r--Jellyfin.Api/Helpers/TranscodingJobHelper.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
index 846624183..168dc27a8 100644
--- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
+++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs
@@ -196,7 +196,7 @@ namespace Jellyfin.Api.Helpers
/// <param name="state">The state.</param>
private async void OnTranscodeKillTimerStopped(object? state)
{
- var job = state as TranscodingJobDto ?? throw new ResourceNotFoundException(nameof(state));
+ var job = state as TranscodingJobDto ?? throw new ArgumentException($"{nameof(state)} is not of type {nameof(TranscodingJobDto)}", nameof(state));
if (!job.HasExited && job.Type != TranscodingJobType.Progressive)
{
var timeSinceLastPing = (DateTime.UtcNow - job.LastPingDate).TotalMilliseconds;
@@ -489,7 +489,7 @@ namespace Jellyfin.Api.Helpers
CancellationTokenSource cancellationTokenSource,
string? workingDirectory = null)
{
- var directory = Path.GetDirectoryName(outputPath) ?? throw new ResourceNotFoundException(nameof(outputPath));
+ var directory = Path.GetDirectoryName(outputPath) ?? throw new ArgumentException($"Provided path ({outputPath}) is not valid.", nameof(outputPath));
Directory.CreateDirectory(directory);
await AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);