mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-27 13:54:49 -04:00
Version the plugins, to stop from loading old versions, plus fix up search paths for ipkg based installs
This commit is contained in:
parent
491d1038eb
commit
196ac7b468
@ -20,7 +20,7 @@
|
|||||||
#define PLUGIN_EVENT_ABORTSTREAM 6
|
#define PLUGIN_EVENT_ABORTSTREAM 6
|
||||||
#define PLUGIN_EVENT_ENDSTREAM 7
|
#define PLUGIN_EVENT_ENDSTREAM 7
|
||||||
|
|
||||||
#define PLUGIN_VERSION 1
|
#define PLUGIN_VERSION 2
|
||||||
|
|
||||||
|
|
||||||
#endif /* _FF_PLUGIN_EVENTS_ */
|
#endif /* _FF_PLUGIN_EVENTS_ */
|
||||||
|
@ -307,6 +307,7 @@ int main(int argc, char *argv[]) {
|
|||||||
char *apppath;
|
char *apppath;
|
||||||
|
|
||||||
int debuglevel=0;
|
int debuglevel=0;
|
||||||
|
int plugins_loaded = 0;
|
||||||
|
|
||||||
config.use_mdns=1;
|
config.use_mdns=1;
|
||||||
err_setlevel(2);
|
err_setlevel(2);
|
||||||
@ -455,15 +456,21 @@ int main(int argc, char *argv[]) {
|
|||||||
* and load each of them */
|
* and load each of them */
|
||||||
if(!load_plugin_dir(plugindir)) {
|
if(!load_plugin_dir(plugindir)) {
|
||||||
DPRINTF(E_LOG,L_MAIN,"Warning: Could not load plugins\n");
|
DPRINTF(E_LOG,L_MAIN,"Warning: Could not load plugins\n");
|
||||||
|
} else {
|
||||||
|
plugins_loaded = TRUE;
|
||||||
}
|
}
|
||||||
free(plugindir);
|
free(plugindir);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if(!plugins_loaded) {
|
||||||
if((!load_plugin_dir("/usr/lib/firefly/plugins")) &&
|
if((!load_plugin_dir("/usr/lib/firefly/plugins")) &&
|
||||||
(!load_plugin_dir("/usr/lib/mt-daapd/plugins")) &&
|
(!load_plugin_dir("/usr/lib/mt-daapd/plugins")) &&
|
||||||
(!load_plugin_dir("/lib/mt-daapd/plugins")) &&
|
(!load_plugin_dir("/lib/mt-daapd/plugins")) &&
|
||||||
(!load_plugin_dir("/lib/mt-daapd/plugins")) &&
|
(!load_plugin_dir("/lib/mt-daapd/plugins")) &&
|
||||||
(!load_plugin_dir("/usr/local/lib/mt-daapd/plugins")) &&
|
(!load_plugin_dir("/usr/local/lib/mt-daapd/plugins")) &&
|
||||||
(!load_plugin_dir("/usr/local/lib/mt-daapd/plugins")) &&
|
(!load_plugin_dir("/usr/local/lib/mt-daapd/plugins")) &&
|
||||||
|
(!load_plugin_dir("/opt/share/firefly/plugins")) &&
|
||||||
|
(!load_plugin_dir("/opt/share/mt-daapd/plugins")) &&
|
||||||
(!load_plugin_dir("/opt/lib/firefly/plugins")) &&
|
(!load_plugin_dir("/opt/lib/firefly/plugins")) &&
|
||||||
(!load_plugin_dir("/opt/lib/mt-daapd/plugins")) &&
|
(!load_plugin_dir("/opt/lib/mt-daapd/plugins")) &&
|
||||||
(!load_plugin_dir("plugins/.libs"))) {
|
(!load_plugin_dir("plugins/.libs"))) {
|
||||||
|
@ -260,6 +260,14 @@ int plugin_load(char **pe, char *path) {
|
|||||||
return PLUGIN_E_NOLOAD;
|
return PLUGIN_E_NOLOAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pinfo->version != PLUGIN_VERSION) {
|
||||||
|
DPRINTF(E_INF,L_PLUG,"Plugin is too old: version %d, expecting %d\n",
|
||||||
|
pinfo->version, PLUGIN_VERSION);
|
||||||
|
os_unload(phandle);
|
||||||
|
free(ppi);
|
||||||
|
return PLUGIN_E_NOLOAD;
|
||||||
|
}
|
||||||
|
|
||||||
DPRINTF(E_INF,L_PLUG,"Loaded plugin %s (%s)\n",path,pinfo->server);
|
DPRINTF(E_INF,L_PLUG,"Loaded plugin %s (%s)\n",path,pinfo->server);
|
||||||
|
|
||||||
if(!_plugin_initialized) {
|
if(!_plugin_initialized) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user