mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
[db] db_pl_delete_bypath() must also delete disabled playlists
Otherwise we end up with a bunch of disabled playlists in the db.
This commit is contained in:
parent
5bd32135ee
commit
f61dfa0529
9
src/db.c
9
src/db.c
@ -1664,10 +1664,14 @@ db_build_query_clause(struct query_params *qp)
|
|||||||
else
|
else
|
||||||
qc->group = sqlite3_mprintf("");
|
qc->group = sqlite3_mprintf("");
|
||||||
|
|
||||||
if (qp->filter)
|
if (qp->filter && !qp->with_disabled)
|
||||||
qc->where = sqlite3_mprintf("WHERE f.disabled = 0 AND %s", qp->filter);
|
qc->where = sqlite3_mprintf("WHERE f.disabled = 0 AND %s", qp->filter);
|
||||||
else
|
else if (!qp->with_disabled)
|
||||||
qc->where = sqlite3_mprintf("WHERE f.disabled = 0");
|
qc->where = sqlite3_mprintf("WHERE f.disabled = 0");
|
||||||
|
else if (qp->filter)
|
||||||
|
qc->where = sqlite3_mprintf("WHERE %s", qp->filter);
|
||||||
|
else
|
||||||
|
qc->where = sqlite3_mprintf("");
|
||||||
|
|
||||||
if (qp->having && (qp->type & (Q_GROUP_ALBUMS | Q_GROUP_ARTISTS)))
|
if (qp->having && (qp->type & (Q_GROUP_ALBUMS | Q_GROUP_ARTISTS)))
|
||||||
qc->having = sqlite3_mprintf("HAVING %s", qp->having);
|
qc->having = sqlite3_mprintf("HAVING %s", qp->having);
|
||||||
@ -3653,6 +3657,7 @@ db_pl_delete_bypath(const char *path)
|
|||||||
memset(&qp, 0, sizeof(struct query_params));
|
memset(&qp, 0, sizeof(struct query_params));
|
||||||
|
|
||||||
qp.type = Q_PL;
|
qp.type = Q_PL;
|
||||||
|
qp.with_disabled = 1;
|
||||||
CHECK_NULL(L_DB, qp.filter = db_mprintf("path = '%q'", path));
|
CHECK_NULL(L_DB, qp.filter = db_mprintf("path = '%q'", path));
|
||||||
|
|
||||||
ret = db_query_start(&qp);
|
ret = db_query_start(&qp);
|
||||||
|
Loading…
Reference in New Issue
Block a user