mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 07:05:57 -05:00
[library] validate mandatory methods for source or die
This commit is contained in:
parent
6120551cf5
commit
a1a49b9497
@ -747,7 +747,16 @@ library_init(void)
|
||||
for (i = 0; sources[i]; i++)
|
||||
{
|
||||
if (!sources[i]->init)
|
||||
continue;
|
||||
{
|
||||
DPRINTF(E_LOG, L_LIB, "BUG: library source '%s' has no init()\n", sources[i]->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!sources[i]->metarescan)
|
||||
{
|
||||
DPRINTF(E_LOG, L_LIB, "BUG: library source '%s' has no metarescan()\n", sources[i]->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = sources[i]->init();
|
||||
if (ret < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user