diff --git a/htmlui.c b/htmlui.c index 44caa4ae..bd7f0a47 100644 --- a/htmlui.c +++ b/htmlui.c @@ -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, - "
" - "
"); + tcp_qprintf(&tq, + "
" + "
"); tcp_qprintf(&tq, "\r\n"); diff --git a/pvr.c b/pvr.c index 9cc53313..0c357639 100644 --- a/pvr.c +++ b/pvr.c @@ -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) { diff --git a/pvr.h b/pvr.h index cca8d0f4..a82a7b9f 100644 --- a/pvr.h +++ b/pvr.h @@ -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 */