This makes the scanner more flexible when matching paths in playlists

with the library paths.
This commit is contained in:
ejurgensen
2013-08-20 21:58:35 +02:00
parent abb0908c6f
commit 6e9cf3a243
3 changed files with 60 additions and 45 deletions

View File

@@ -1723,6 +1723,30 @@ db_file_id_bypath(char *path)
#undef Q_TMPL
}
int
db_file_id_bypathpattern(char *path)
{
#define Q_TMPL "SELECT f.id FROM files f WHERE f.path LIKE '%%%q';"
char *query;
int ret;
query = sqlite3_mprintf(Q_TMPL, path);
if (!query)
{
DPRINTF(E_LOG, L_DB, "Out of memory for query string\n");
return 0;
}
ret = db_file_id_byquery(query);
sqlite3_free(query);
return ret;
#undef Q_TMPL
}
int
db_file_id_byfilebase(char *filename, char *base)
{