mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-26 22:23:17 -05:00
shorten name mangling on rsp
This commit is contained in:
parent
b03942bfba
commit
0285f0bdc0
@ -406,6 +406,8 @@ int plugin_rend_register(char *name, int port, char *iface, char *txt) {
|
|||||||
PLUGIN_REND_INFO *pri;
|
PLUGIN_REND_INFO *pri;
|
||||||
char *supplied_txt;
|
char *supplied_txt;
|
||||||
char *new_name;
|
char *new_name;
|
||||||
|
char *ver;
|
||||||
|
char *slash;
|
||||||
int name_len;
|
int name_len;
|
||||||
|
|
||||||
|
|
||||||
@ -431,7 +433,12 @@ int plugin_rend_register(char *name, int port, char *iface, char *txt) {
|
|||||||
memset(new_name,0,name_len);
|
memset(new_name,0,name_len);
|
||||||
|
|
||||||
if(conf_get_int("plugins","mangle_rendezvous",1)) {
|
if(conf_get_int("plugins","mangle_rendezvous",1)) {
|
||||||
snprintf(new_name,name_len,"%s (%s)",name,ppi->versionstring);
|
ver = strdup(ppi->versionstring);
|
||||||
|
if(strchr(ver,'/')) {
|
||||||
|
*strchr(ver,'/') = '\0';
|
||||||
|
}
|
||||||
|
snprintf(new_name,name_len,"%s (%s)",name,ver);
|
||||||
|
free(ver);
|
||||||
} else {
|
} else {
|
||||||
snprintf(new_name,name_len,"%s",name);
|
snprintf(new_name,name_len,"%s",name);
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ PLUGIN_REND_INFO _pri[] = {
|
|||||||
PLUGIN_INFO _pi = {
|
PLUGIN_INFO _pi = {
|
||||||
PLUGIN_VERSION, /* version */
|
PLUGIN_VERSION, /* version */
|
||||||
PLUGIN_OUTPUT, /* type */
|
PLUGIN_OUTPUT, /* type */
|
||||||
"rsp/" RSP_VERSION, /* server */
|
"rsp/" VERSION, /* server */
|
||||||
"/rsp/.*", /* url */
|
"/rsp/.*", /* url */
|
||||||
&_pofn, /* output fns */
|
&_pofn, /* output fns */
|
||||||
NULL, /* event fns */
|
NULL, /* event fns */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user