diff --git a/src/db.c b/src/db.c index 9a51e1e0..d01aa96e 100644 --- a/src/db.c +++ b/src/db.c @@ -2634,6 +2634,18 @@ db_pl_ping_bymatch(const char *path, int isdir) #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 db_pl_id_bypath(const char *path) { diff --git a/src/db.h b/src/db.h index e83beeb6..2786d282 100644 --- a/src/db.h +++ b/src/db.h @@ -575,6 +575,9 @@ db_pl_ping(int id); void db_pl_ping_bymatch(const char *path, int isdir); +void +db_pl_ping_items_bymatch(const char *path, int id); + int db_pl_id_bypath(const char *path);