[db] Add method db_pl_ping_items_bymatch()
This commit is contained in:
parent
b9621102f4
commit
65b4c579f3
12
src/db.c
12
src/db.c
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
3
src/db.h
3
src/db.h
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue