Normal
Nice!My fault, forgot to request the information from the DB Thought I already fixed it I do:[code]public dynamic Process(IHttpRequest request) { HttpParam httpParam = request.Param; string programId = httpParam["programId"].Value; if (programId == null) throw new BadRequestException("CancelSchedule: programId is null"); int programIdInt; if (!int.TryParse(programId, out programIdInt)) throw new BadRequestException(string.Format("CancelSchedule: Couldn't parse programId to int: {0}", programId)); if (!ServiceRegistration.IsRegistered<ITvProvider>()) throw new BadRequestException("CancelSchedule: ITvProvider not found"); IProgramInfo programInfo = ServiceRegistration.Get<ITvProvider>() as IProgramInfo; IScheduleControl scheduleControl = ServiceRegistration.Get<ITvProvider>() as IScheduleControl; IProgram program; programInfo.GetProgram(programIdInt, out program); bool result = scheduleControl.RemoveScheduleForProgram(program, ScheduleRecordingType.Once); // TODO: not sure if ScheduleRecordingType is right return new WebBoolResult { Result = result }; }[/code]I only throw the error if the id is null or couldn't be parsed. I will create a new build with the Genre fix
Nice!
My fault, forgot to request the information from the DB Thought I already fixed it
I do:
[code]public dynamic Process(IHttpRequest request)
{
HttpParam httpParam = request.Param;
string programId = httpParam["programId"].Value;
if (programId == null)
throw new BadRequestException("CancelSchedule: programId is null");
int programIdInt;
if (!int.TryParse(programId, out programIdInt))
throw new BadRequestException(string.Format("CancelSchedule: Couldn't parse programId to int: {0}", programId));
if (!ServiceRegistration.IsRegistered<ITvProvider>())
throw new BadRequestException("CancelSchedule: ITvProvider not found");
IProgramInfo programInfo = ServiceRegistration.Get<ITvProvider>() as IProgramInfo;
IScheduleControl scheduleControl = ServiceRegistration.Get<ITvProvider>() as IScheduleControl;
IProgram program;
programInfo.GetProgram(programIdInt, out program);
bool result = scheduleControl.RemoveScheduleForProgram(program, ScheduleRecordingType.Once); // TODO: not sure if ScheduleRecordingType is right
return new WebBoolResult { Result = result };
}[/code]
I only throw the error if the id is null or couldn't be parsed. I will create a new build with the Genre fix