aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2019-12-13 23:33:59 +0900
committerGitHub <noreply@github.com>2019-12-13 23:33:59 +0900
commitdc32050a2ee04c76a4dff00716b4a096f33dcfad (patch)
treef629a014dab172b12610e6f450f33e7ee35490fe
parent96a5dda9ffe714e170e97bb93d72d68ed55791bb (diff)
parenta4ca259a64d12629d88a1c801c4bc869c8a5d44b (diff)
Merge pull request #2142 from Bond-009/livetverrormsg
Add improved error message for #2141
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index 2ecf4e184..ee7db1413 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -304,9 +304,12 @@ namespace Emby.Server.Implementations.LiveTv
}
private ILiveTvService GetService(string name)
- {
- return _services.FirstOrDefault(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase));
- }
+ => Array.Find(_services, x => string.Equals(x.Name, name, StringComparison.OrdinalIgnoreCase))
+ ?? throw new KeyNotFoundException(
+ string.Format(
+ CultureInfo.InvariantCulture,
+ "No service with the name '{0}' can be found.",
+ name));
private static void Normalize(MediaSourceInfo mediaSource, ILiveTvService service, bool isVideo)
{