return 0;
}
+
+
+
+/*
+ *
+ */
+static int
+cr_channel_record(client_t *c, char **argv, int argc)
+{
+ th_channel_t *ch;
+ int duration;
+
+ if(argc < 2)
+ return 1;
+
+ if((ch = channel_by_index(atoi(argv[0]))) == NULL)
+ return 1;
+
+ duration = atoi(argv[1]);
+
+ pvr_channel_record_op(ch, duration);
+ return 0;
+}
+
/*
*
*/
{ "channel.info", cr_channel_info },
{ "channel.subscribe", cr_channel_subscribe },
{ "channel.unsubscribe", cr_channel_unsubscribe },
+ { "channel.record", cr_channel_record },
{ "event.info", cr_event_info },
{ "event.record", cr_event_record },
{ "pvr.getlog", cr_pvr_getlog },
+void
+pvr_channel_record_op(th_channel_t *ch, int duration)
+{
+ time_t now = dispatch_clock;
+ time_t start = now;
+ time_t stop = now + duration;
+ pvr_rec_t *pvrr;
+
+ pvrr = calloc(1, sizeof(pvr_rec_t));
+ pvrr->pvrr_status = HTSTV_PVR_STATUS_SCHEDULED;
+ pvrr->pvrr_channel = ch;
+ pvrr->pvrr_start = start;
+ pvrr->pvrr_stop = stop;
+ pvrr->pvrr_title = strdup("Manual recording");
+ pvrr->pvrr_desc = NULL;
+
+ pvr_link_pvrr(pvrr);
+ pvr_database_save();
+}
+
+
+
+
/*****************************************************************************
*
* Plain text "database" of pvr programmes
void pvrr_set_rec_state(pvr_rec_t *pvrr, pvrr_rec_status_t status);
+void pvr_channel_record_op(th_channel_t *ch, int duration);
+
#endif /* PVR_H */