From 84ac2ebfdb8ec5fe092abc94f92943e1e3126ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Thu, 18 Oct 2012 11:04:45 +0200 Subject: [PATCH] Add notify_reload() helper --- src/dvr/dvr_autorec.c | 6 ++---- src/notify.c | 9 +++++++++ src/notify.h | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/dvr/dvr_autorec.c b/src/dvr/dvr_autorec.c index 447cbcba..e4902d92 100644 --- a/src/dvr/dvr_autorec.c +++ b/src/dvr/dvr_autorec.c @@ -520,10 +520,8 @@ _dvr_autorec_add(const char *config_name, htsmsg_destroy(m); /* Notify web clients that we have messed with the tables */ - - m = htsmsg_create_map(); - htsmsg_add_u32(m, "reload", 1); - notify_by_msg("autorec", m); + + notify_reload("autorec"); dvr_autorec_changed(dae); } diff --git a/src/notify.c b/src/notify.c index bdad26ef..b2d8701a 100644 --- a/src/notify.c +++ b/src/notify.c @@ -33,3 +33,12 @@ notify_by_msg(const char *class, htsmsg_t *m) comet_mailbox_add_message(m, 0); htsmsg_destroy(m); } + + +void +notify_reload(const char *class) +{ + htsmsg_t *m = htsmsg_create_map(); + htsmsg_add_u32(m, "reload", 1); + notify_by_msg(class, m); +} diff --git a/src/notify.h b/src/notify.h index cf278393..1a41a43a 100644 --- a/src/notify.h +++ b/src/notify.h @@ -23,4 +23,6 @@ void notify_by_msg(const char *class, htsmsg_t *m); +void notify_reload(const char *class); + #endif /* NOTIFY_H_ */