Add function for removing all log entries for completed recordings

This commit is contained in:
Andreas Öman 2008-02-13 18:30:16 +00:00
parent a05063bf65
commit d092d4ef53
3 changed files with 34 additions and 4 deletions

View file

@ -831,6 +831,10 @@ page_pvr(http_connection_t *hc, const char *remain, void *opaque)
if(!html_verify_access(hc, "record-events"))
return HTTP_STATUS_UNAUTHORIZED;
if(http_arg_get(&hc->hc_url_args, "clearall")) {
pvr_clear_all_completed();
}
op = -1;
pvrr_tgt = NULL;
LIST_FOREACH(ra, &hc->hc_url_args, link) {
@ -1004,10 +1008,10 @@ page_pvr(http_connection_t *hc, const char *remain, void *opaque)
divid++;
}
tcp_qprintf(&tq,
"<br><div style=\"text-align: center\">"
"<input type=\"submit\" class=\"knapp\" name=\"clearall\" "
"value=\"Remove all completed recordings\"></div>");
tcp_qprintf(&tq,
"<br><div style=\"text-align: center\">"
"<input type=\"submit\" class=\"knapp\" name=\"clearall\" "
"value=\"Remove all completed recording log entries\"></div>");
tcp_qprintf(&tq, "</div>\r\n");

24
pvr.c
View file

@ -220,6 +220,30 @@ pvr_do_op(pvr_rec_t *pvrr, recop_t op)
}
/**
* Remove log info about all completed recordings
*/
void
pvr_clear_all_completed(void)
{
pvr_rec_t *pvrr, *next;
for(pvrr = LIST_FIRST(&pvrr_global_list); pvrr != NULL; pvrr = next) {
next = LIST_NEXT(pvrr, pvrr_global_link);
switch(pvrr->pvrr_status) {
case HTSTV_PVR_STATUS_SCHEDULED:
case HTSTV_PVR_STATUS_RECORDING:
break;
default:
pvr_database_erase(pvrr);
pvr_free(pvrr);
break;
}
}
}
void
pvr_event_record_op(th_channel_t *ch, event_t *e, recop_t op)
{

2
pvr.h
View file

@ -119,4 +119,6 @@ int pvr_op2int(const char *op);
void pvr_do_op(pvr_rec_t *pvrr, recop_t op);
void pvr_clear_all_completed(void);
#endif /* PVR_H */