mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -05:00
[db] Add support for resetting play- and skip-count
This commit is contained in:
parent
b9a7ce7dd2
commit
7d0e48eb0e
18
src/db.c
18
src/db.c
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user