Merge pull request #2142 from Bond-009/livetverrormsg

Add improved error message for #2141
This commit is contained in:
dkanada 2019-12-13 23:33:59 +09:00 committed by GitHub
commit dc32050a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -304,9 +304,12 @@ namespace Emby.Server.Implementations.LiveTv
} }
private ILiveTvService GetService(string name) private ILiveTvService GetService(string name)
{ => Array.Find(_services, x => string.Equals(x.Name, name, StringComparison.OrdinalIgnoreCase))
return _services.FirstOrDefault(i => string.Equals(i.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) private static void Normalize(MediaSourceInfo mediaSource, ILiveTvService service, bool isVideo)
{ {