本文整理汇总了C#中MediaBrowser.Controller.LiveTv.SeriesTimerInfo.ToScheduleType方法的典型用法代码示例。如果您正苦于以下问题:C# SeriesTimerInfo.ToScheduleType方法的具体用法?C# SeriesTimerInfo.ToScheduleType怎么用?C# SeriesTimerInfo.ToScheduleType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaBrowser.Controller.LiveTv.SeriesTimerInfo
的用法示例。
在下文中一共展示了SeriesTimerInfo.ToScheduleType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChangeSeriesSchedule
public void ChangeSeriesSchedule(CancellationToken cancellationToken, SeriesTimerInfo schedule)
{
var timerData = GetSchedule(cancellationToken, schedule.Id);
if (timerData == null)
{
throw ExceptionHelper.CreateArgumentException("schedule.Id", "The schedule id {0} could not be found", schedule.Id);
}
var builder = new StringBuilder("AddScheduleDetailed?");
builder.AppendFormat("channelid={0}&", timerData.ChannelId);
builder.AppendFormat("title={0}&", timerData.Title);
builder.AppendFormat("starttime={0}&", timerData.StartTime.ToLocalTime().ToUrlDate());
builder.AppendFormat("endtime={0}&", timerData.EndTime.ToLocalTime().ToUrlDate());
builder.AppendFormat("scheduletype={0}&", (Int32)schedule.ToScheduleType());
if (schedule.IsPrePaddingRequired & schedule.PrePaddingSeconds > 0)
{
builder.AppendFormat("preRecordInterval={0}&", TimeSpan.FromSeconds(schedule.PrePaddingSeconds).RoundUpMinutes());
}
if (schedule.IsPostPaddingRequired & schedule.PostPaddingSeconds > 0)
{
builder.AppendFormat("postRecordInterval={0}&", TimeSpan.FromSeconds(schedule.PostPaddingSeconds).RoundUpMinutes());
}
builder.Remove(builder.Length - 1, 1);
Plugin.Logger.Info("Creating series schedule with StartTime: {0}, EndTime: {1}, ProgramData from MP: {2}",
schedule.StartDate, schedule.EndDate, builder.ToString());
Plugin.TvProxy.DeleteSchedule(cancellationToken, schedule.Id);
var response = GetFromService<WebBoolResult>(cancellationToken, builder.ToString());
if (!response.Result)
{
throw new LiveTvConflictException();
}
}