[db] Make db_file_add/update + library_media_save return id of mfi
This commit is contained in:
parent
b6a686866a
commit
21c80fbf10
11
src/db.c
11
src/db.c
|
@ -3099,9 +3099,16 @@ db_file_add(struct media_file_info *mfi)
|
|||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
ret = (int)sqlite3_last_insert_rowid(hdl);
|
||||
if (ret == 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_DB, "Successful file insert but no last_insert_rowid!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
library_update_trigger(LISTENER_DATABASE);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -3129,7 +3136,7 @@ db_file_update(struct media_file_info *mfi)
|
|||
|
||||
library_update_trigger(LISTENER_DATABASE);
|
||||
|
||||
return 0;
|
||||
return mfi->id;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -120,7 +120,7 @@ struct library_source
|
|||
* Adds a mfi if mfi->id == 0, otherwise updates.
|
||||
*
|
||||
* @param mfi Media to save
|
||||
* @return 0 if operation succeeded, -1 on failure.
|
||||
* @return mfi id if operation succeeded, -1 on failure.
|
||||
*/
|
||||
int
|
||||
library_media_save(struct media_file_info *mfi);
|
||||
|
|
Loading…
Reference in New Issue