[db] Add method db_pl_ping_items_bymatch()

This commit is contained in:
ejurgensen 2017-10-02 23:02:25 +02:00
parent b9621102f4
commit 65b4c579f3
2 changed files with 15 additions and 0 deletions

View File

@ -2634,6 +2634,18 @@ db_pl_ping_bymatch(const char *path, int isdir)
#undef Q_TMPL_NODIR #undef Q_TMPL_NODIR
} }
void
db_pl_ping_items_bymatch(const char *path, int id)
{
#define Q_TMPL "UPDATE files SET db_timestamp = %" PRIi64 ", disabled = 0 WHERE path IN (SELECT filepath FROM playlistitems WHERE filepath LIKE '%q%%' AND playlistid = %d);"
char *query;
query = sqlite3_mprintf(Q_TMPL, (int64_t)time(NULL), path, id);
db_query_run(query, 1, 0);
#undef Q_TMPL
}
int int
db_pl_id_bypath(const char *path) db_pl_id_bypath(const char *path)
{ {

View File

@ -575,6 +575,9 @@ db_pl_ping(int id);
void void
db_pl_ping_bymatch(const char *path, int isdir); db_pl_ping_bymatch(const char *path, int isdir);
void
db_pl_ping_items_bymatch(const char *path, int id);
int int
db_pl_id_bypath(const char *path); db_pl_id_bypath(const char *path);