encapsulate validity in tv providers

This commit is contained in:
Luke Pulverenti
2015-10-21 01:09:50 -04:00
parent cf8b820508
commit 0c7e06648c
5 changed files with 159 additions and 109 deletions

View File

@@ -607,8 +607,18 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
throw new ArgumentNullException("timer");
}
if (string.IsNullOrWhiteSpace(timer.ProgramId))
{
throw new InvalidOperationException("timer.ProgramId is null. Cannot record.");
}
var info = GetProgramInfoFromCache(timer.ChannelId, timer.ProgramId);
if (info == null)
{
throw new InvalidOperationException(string.Format("Program with Id {0} not found", timer.ProgramId));
}
var recordPath = RecordingPath;
if (info.IsMovie)