Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: limit the dvr entry update messages
  • Loading branch information
perexg committed Nov 4, 2015
1 parent 838fc53 commit 8f493cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/dvr/dvr.h
Expand Up @@ -249,6 +249,11 @@ typedef struct dvr_entry {
*/
time_t de_last_notify;

/**
* Update notification limit
*/
tvhlog_limit_t de_update_limit;

} dvr_entry_t;

#define DVR_CH_NAME(e) ((e)->de_channel == NULL ? (e)->de_channel_name : channel_get_name((e)->de_channel))
Expand Down
9 changes: 8 additions & 1 deletion src/dvr/dvr_db.c
Expand Up @@ -1456,10 +1456,17 @@ static dvr_entry_t *_dvr_entry_update
if (save) {
idnode_changed(&de->de_id);
htsp_dvr_entry_update(de);
tvhlog(LOG_INFO, "dvr", "\"%s\" on \"%s\": Updated%s (%s)",
if (tvhlog_limit(&de->de_update_limit, 60)) {
tvhlog(LOG_INFO, "dvr", "\"%s\" on \"%s\": Updated%s (%s)",
lang_str_get(de->de_title, NULL), DVR_CH_NAME(de),
updated ? " Timer" : "",
dvr_updated_str(buf, sizeof(buf), save));
} else {
tvhtrace("dvr", "\"%s\" on \"%s\": Updated%s (%s)",
lang_str_get(de->de_title, NULL), DVR_CH_NAME(de),
updated ? " Timer" : "",
dvr_updated_str(buf, sizeof(buf), save));
}
}

return de;
Expand Down

0 comments on commit 8f493cc

Please sign in to comment.