aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorcvium <clausvium@gmail.com>2021-09-10 11:54:26 +0200
committercvium <clausvium@gmail.com>2021-09-10 11:54:26 +0200
commit026a7af0e8cc15f889ba94079c8bc9566a74d505 (patch)
treeb2044214de9b5bdd929b264fc4975c65d639254d /Emby.Server.Implementations
parent1a5a74d2a95506249cf071c659e3c6cf01f28f78 (diff)
Don't throw when livestream file isn't found
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Library/MediaSourceManager.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs
index 8e4b32a9c..d6d67fcf4 100644
--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs
+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs
@@ -602,7 +602,8 @@ namespace Emby.Server.Implementations.Library
public async Task<MediaSourceInfo> GetLiveStreamMediaInfo(string id, CancellationToken cancellationToken)
{
- var liveStreamInfo = GetLiveStreamInfo(id);
+ // TODO probably shouldn't throw here but it is kept for "backwards compatibility"
+ var liveStreamInfo = GetLiveStreamInfo(id) ?? throw new ResourceNotFoundException();
var mediaSource = liveStreamInfo.MediaSource;
@@ -778,7 +779,8 @@ namespace Emby.Server.Implementations.Library
throw new ArgumentNullException(nameof(id));
}
- var info = GetLiveStreamInfo(id);
+ // TODO probably shouldn't throw here but it is kept for "backwards compatibility"
+ var info = GetLiveStreamInfo(id) ?? throw new ResourceNotFoundException();
return Task.FromResult(new Tuple<MediaSourceInfo, IDirectStreamProvider>(info.MediaSource, info as IDirectStreamProvider));
}
@@ -794,7 +796,7 @@ namespace Emby.Server.Implementations.Library
return info;
}
- throw new ResourceNotFoundException();
+ return null;
}
public async Task<MediaSourceInfo> GetLiveStream(string id, CancellationToken cancellationToken)