public override Task <AsyncResult <ISchedule> > CreateScheduleDetailedAsync(IChannel channel, string title, DateTime from, DateTime to, ScheduleRecordingType recordingType, int preRecordInterval, int postRecordInterval, string directory, int priority) { IScheduleService scheduleService = GlobalServiceProvider.Get <IScheduleService>(); Schedule tvSchedule = ScheduleFactory.CreateSchedule(channel.ChannelId, title, from, to); tvSchedule.PreRecordInterval = preRecordInterval >= 0 ? preRecordInterval : ServiceAgents.Instance.SettingServiceAgent.GetValue("preRecordInterval", 5); tvSchedule.PostRecordInterval = postRecordInterval >= 0 ? postRecordInterval : ServiceAgents.Instance.SettingServiceAgent.GetValue("postRecordInterval", 5); if (!String.IsNullOrEmpty(directory)) { tvSchedule.Directory = directory; } if (priority >= 0) { tvSchedule.Priority = priority; } tvSchedule.PreRecordInterval = preRecordInterval; tvSchedule.PostRecordInterval = postRecordInterval; tvSchedule.ScheduleType = (int)recordingType; tvSchedule.Directory = directory; tvSchedule.Priority = priority; scheduleService.SaveSchedule(tvSchedule); ISchedule schedule = tvSchedule.ToSchedule(); return(Task.FromResult(new AsyncResult <ISchedule>(true, schedule))); }
public override bool CreateScheduleByTime(IChannel channel, DateTime from, DateTime to, out ISchedule schedule) { IScheduleService scheduleService = GlobalServiceProvider.Get <IScheduleService>(); Schedule tvSchedule = ScheduleFactory.CreateSchedule(channel.ChannelId, "Manual", from, to); tvSchedule.PreRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("preRecordInterval", 5); tvSchedule.PostRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("postRecordInterval", 5); tvSchedule.ScheduleType = (int)ScheduleRecordingType.Once; scheduleService.SaveSchedule(tvSchedule); schedule = tvSchedule.ToSchedule(); return(true); }
public override bool CreateSchedule(IProgram program, ScheduleRecordingType recordingType, out ISchedule schedule) { IScheduleService scheduleService = GlobalServiceProvider.Instance.Get <IScheduleService>(); Schedule tvschedule = ScheduleFactory.CreateSchedule(program.ChannelId, program.Title, program.StartTime, program.EndTime); tvschedule.PreRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("preRecordInterval", 5); tvschedule.PostRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("postRecordInterval", 5); tvschedule.ScheduleType = (int)recordingType; scheduleService.SaveSchedule(tvschedule); schedule = tvschedule.ToSchedule(); return(true); }
public override Task <AsyncResult <ISchedule> > CreateScheduleByTimeAsync(IChannel channel, string title, DateTime from, DateTime to, ScheduleRecordingType recordingType) { IScheduleService scheduleService = GlobalServiceProvider.Get <IScheduleService>(); Schedule tvSchedule = ScheduleFactory.CreateSchedule(channel.ChannelId, title, from, to); tvSchedule.PreRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("preRecordInterval", 5); tvSchedule.PostRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("postRecordInterval", 5); tvSchedule.ScheduleType = (int)recordingType; scheduleService.SaveSchedule(tvSchedule); var schedule = tvSchedule.ToSchedule(); return(Task.FromResult(new AsyncResult <ISchedule>(true, schedule))); }
public override Task <AsyncResult <ISchedule> > CreateScheduleAsync(IProgram program, ScheduleRecordingType recordingType) { IScheduleService scheduleService = GlobalServiceProvider.Instance.Get <IScheduleService>(); Schedule tvschedule = ScheduleFactory.CreateSchedule(program.ChannelId, program.Title, program.StartTime, program.EndTime); tvschedule.PreRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("preRecordInterval", 5); tvschedule.PostRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("postRecordInterval", 5); tvschedule.ScheduleType = (int)recordingType; scheduleService.SaveSchedule(tvschedule); var schedule = tvschedule.ToSchedule(); var success = schedule != null; return(Task.FromResult(new AsyncResult <ISchedule>(success, schedule))); }
public bool CreateScheduleByTime(IChannel channel, DateTime from, DateTime to, out ISchedule schedule) { #if TVE3 TvDatabase.Schedule tvSchedule = _tvBusiness.AddSchedule(channel.ChannelId, "Manual", from, to, (int)ScheduleRecordingType.Once); tvSchedule.PreRecordInterval = Int32.Parse(_tvBusiness.GetSetting("preRecordInterval", "5").Value); tvSchedule.PostRecordInterval = Int32.Parse(_tvBusiness.GetSetting("postRecordInterval", "5").Value); tvSchedule.Persist(); _tvControl.OnNewSchedule(); #else IScheduleService scheduleService = GlobalServiceProvider.Get <IScheduleService>(); Schedule tvSchedule = ScheduleFactory.CreateSchedule(channel.ChannelId, "Manual", from, to); tvSchedule.PreRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("preRecordInterval", 5); tvSchedule.PostRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("postRecordInterval", 5); tvSchedule.ScheduleType = (int)ScheduleRecordingType.Once; scheduleService.SaveSchedule(tvSchedule); #endif schedule = tvSchedule.ToSchedule(); return(true); }
public bool CreateSchedule(IProgram program, ScheduleRecordingType recordingType, out ISchedule schedule) { #if TVE3 TvDatabase.Schedule tvSchedule = _tvBusiness.AddSchedule(program.ChannelId, program.Title, program.StartTime, program.EndTime, (int)recordingType); tvSchedule.ScheduleType = (int)recordingType; tvSchedule.PreRecordInterval = Int32.Parse(_tvBusiness.GetSetting("preRecordInterval", "5").Value); tvSchedule.PostRecordInterval = Int32.Parse(_tvBusiness.GetSetting("postRecordInterval", "5").Value); tvSchedule.Persist(); _tvControl.OnNewSchedule(); schedule = tvSchedule.ToSchedule(); return(true); #else IScheduleService scheduleService = GlobalServiceProvider.Instance.Get <IScheduleService>(); Schedule tvschedule = ScheduleFactory.CreateSchedule(program.ChannelId, program.Title, program.StartTime, program.EndTime); tvschedule.PreRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("preRecordInterval", 5); tvschedule.PostRecordInterval = ServiceAgents.Instance.SettingServiceAgent.GetValue("postRecordInterval", 5); tvschedule.ScheduleType = (int)recordingType; scheduleService.SaveSchedule(tvschedule); schedule = tvschedule.ToSchedule(); return(true); #endif }