[db] Add support for resetting play- and skip-count

This commit is contained in:
chme 2019-01-23 09:25:34 +01:00 committed by ejurgensen
parent b9a7ce7dd2
commit 7d0e48eb0e
2 changed files with 21 additions and 0 deletions

View File

@ -2585,6 +2585,24 @@ db_file_inc_skipcount(int id)
#undef Q_TMPL_WITH_RATING #undef Q_TMPL_WITH_RATING
} }
void
db_file_reset_playskip_count(int id)
{
#define Q_TMPL "UPDATE files SET play_count = 0, skip_count = 0, time_played = 0, time_skipped = 0 WHERE id = %d;"
char *query;
query = sqlite3_mprintf(Q_TMPL, id);
if (!query)
{
DPRINTF(E_LOG, L_DB, "Out of memory for query string\n");
return;
}
db_query_run(query, 1, 0);
#undef Q_TMPL
}
void void
db_file_ping(int id) db_file_ping(int id)
{ {

View File

@ -566,6 +566,9 @@ db_file_inc_playcount(int id);
void void
db_file_inc_skipcount(int id); db_file_inc_skipcount(int id);
void
db_file_reset_playskip_count(int id);
void void
db_file_ping(int id); db_file_ping(int id);