From 8f3c99ec43dfb691125af86c4599188a2041dd5a Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Thu, 8 Aug 2024 20:03:06 +0200 Subject: [PATCH] [mpd] add option enable_httpd_plugin Signed-off-by: Fabian Groffen --- owntone.conf.in | 4 ++++ src/conffile.c | 1 + src/mpd.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/owntone.conf.in b/owntone.conf.in index 70c2ef5d..8f44e30a 100644 --- a/owntone.conf.in +++ b/owntone.conf.in @@ -437,6 +437,10 @@ mpd { # clients and will need additional configuration in the MPD client to # work). Set to 0 to disable serving artwork over http. # http_port = 0 + + # Whether to emit an output with plugin type "httpd" to tell clients + # that a stream is available for local playback. +# enable_httpd_plugin = false } # SQLite configuration (allows to modify the operation of the SQLite databases) diff --git a/src/conffile.c b/src/conffile.c index cdae2408..da49f03d 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -238,6 +238,7 @@ static cfg_opt_t sec_mpd[] = { CFG_INT("port", 6600, CFGF_NONE), CFG_INT("http_port", 0, CFGF_NONE), + CFG_BOOL("enable_httpd_plugin", cfg_false, CFGF_NONE), CFG_BOOL("clear_queue_on_stop_disable", cfg_false, CFGF_NODEFAULT | CFGF_DEPRECATED), CFG_BOOL("allow_modifying_stored_playlists", cfg_false, CFGF_NODEFAULT | CFGF_DEPRECATED), CFG_STR("default_playlist_directory", NULL, CFGF_NODEFAULT | CFGF_DEPRECATED), diff --git a/src/mpd.c b/src/mpd.c index e9d306aa..21868d5d 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -77,6 +77,7 @@ static struct evhttp *evhttpd; static struct evconnlistener *mpd_listener; static int mpd_sockfd; +static bool mpd_plugin_httpd; // Virtual path to the default playlist directory static char *default_pl_dir; @@ -4859,6 +4860,8 @@ mpd_init(void) if (pl_dir) default_pl_dir = safe_asprintf("/file:%s", pl_dir); + mpd_plugin_httpd = cfg_getbool(cfg_getsec(cfg, "mpd"), "enable_httpd_plugin"); + /* Handle deprecated config options */ if (0 < cfg_opt_size(cfg_getopt(cfg_getsec(cfg, "mpd"), "allow_modifying_stored_playlists"))) {