diff --git a/src/db.c b/src/db.c index 3bad1517..d0b21f47 100644 --- a/src/db.c +++ b/src/db.c @@ -2585,6 +2585,24 @@ db_file_inc_skipcount(int id) #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 db_file_ping(int id) { diff --git a/src/db.h b/src/db.h index 5e3ecc63..d28dfac6 100644 --- a/src/db.h +++ b/src/db.h @@ -566,6 +566,9 @@ db_file_inc_playcount(int id); void db_file_inc_skipcount(int id); +void +db_file_reset_playskip_count(int id); + void db_file_ping(int id);