mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-01 02:03:45 -04: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++)
|
for (i = 0; sources[i]; i++)
|
||||||
{
|
{
|
||||||
if (!sources[i]->init)
|
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();
|
ret = sources[i]->init();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user