[db] Instantly notify about rating changes

This commit is contained in:
chme 2017-12-15 17:12:19 +01:00 committed by ejurgensen
parent e00a4a1995
commit 5a57a564a4
1 changed files with 8 additions and 2 deletions

View File

@ -2508,7 +2508,10 @@ db_file_rating_update_byid(uint32_t id, uint32_t rating)
query = sqlite3_mprintf(Q_TMPL, rating, id);
ret = db_query_run(query, 1, LISTENER_RATING);
ret = db_query_run(query, 1, 0);
if (ret == 0)
listener_notify(LISTENER_RATING);
return ((ret < 0) ? -1 : sqlite3_changes(hdl));
#undef Q_TMPL
@ -2523,7 +2526,10 @@ db_file_rating_update_byvirtualpath(const char *virtual_path, uint32_t rating)
query = sqlite3_mprintf(Q_TMPL, rating, virtual_path);
ret = db_query_run(query, 1, LISTENER_RATING);
ret = db_query_run(query, 1, 0);
if (ret == 0)
listener_notify(LISTENER_RATING);
return ((ret < 0) ? -1 : sqlite3_changes(hdl));
#undef Q_TMPL