mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-26 12:59:19 -05:00
[library] Let library_media_save() return errors
This commit is contained in:
parent
c5988665b0
commit
ba1c536ca3
@ -108,14 +108,14 @@ static short deferred_update_events;
|
|||||||
|
|
||||||
/* ------------------- CALLED BY LIBRARY SOURCE MODULES -------------------- */
|
/* ------------------- CALLED BY LIBRARY SOURCE MODULES -------------------- */
|
||||||
|
|
||||||
void
|
int
|
||||||
library_media_save(struct media_file_info *mfi)
|
library_media_save(struct media_file_info *mfi)
|
||||||
{
|
{
|
||||||
if (!mfi->path || !mfi->fname)
|
if (!mfi->path || !mfi->fname)
|
||||||
{
|
{
|
||||||
DPRINTF(E_LOG, L_LIB, "Ignoring media file with missing values (path='%s', fname='%s', data_kind='%d')\n",
|
DPRINTF(E_LOG, L_LIB, "Ignoring media file with missing values (path='%s', fname='%s', data_kind='%d')\n",
|
||||||
mfi->path, mfi->fname, mfi->data_kind);
|
mfi->path, mfi->fname, mfi->data_kind);
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mfi->directory_id || !mfi->virtual_path)
|
if (!mfi->directory_id || !mfi->virtual_path)
|
||||||
@ -126,9 +126,9 @@ library_media_save(struct media_file_info *mfi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mfi->id == 0)
|
if (mfi->id == 0)
|
||||||
db_file_add(mfi);
|
return db_file_add(mfi);
|
||||||
else
|
else
|
||||||
db_file_update(mfi);
|
return db_file_update(mfi);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -94,7 +94,7 @@ struct library_source
|
|||||||
|
|
||||||
/* --------------------- Interface towards source backends ----------------- */
|
/* --------------------- Interface towards source backends ----------------- */
|
||||||
|
|
||||||
void
|
int
|
||||||
library_media_save(struct media_file_info *mfi);
|
library_media_save(struct media_file_info *mfi);
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user