Add db_pl_fetch_bytitlepath

This commit is contained in:
Julien BLACHE 2009-11-22 12:34:37 +01:00
parent 04ce09e5be
commit ecb2991881
2 changed files with 27 additions and 0 deletions

View File

@ -1688,6 +1688,30 @@ db_pl_fetch_bypath(char *path)
#undef Q_TMPL #undef Q_TMPL
} }
struct playlist_info *
db_pl_fetch_bytitlepath(char *title, char *path)
{
#define Q_TMPL "SELECT * FROM playlists WHERE title = '%q' AND path = '%q';"
struct playlist_info *pli;
char *query;
query = sqlite3_mprintf(Q_TMPL, title, path);
if (!query)
{
DPRINTF(E_LOG, L_DB, "Out of memory for query string\n");
return NULL;
}
pli = db_pl_fetch_byquery(query);
sqlite3_free(query);
return pli;
#undef Q_TMPL
}
int int
db_pl_add(char *title, char *path, int *id) db_pl_add(char *title, char *path, int *id)
{ {

View File

@ -275,6 +275,9 @@ db_pl_ping(int id);
struct playlist_info * struct playlist_info *
db_pl_fetch_bypath(char *path); db_pl_fetch_bypath(char *path);
struct playlist_info *
db_pl_fetch_bytitlepath(char *title, char *path);
int int
db_pl_add(char *title, char *path, int *id); db_pl_add(char *title, char *path, int *id);