mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-30 13:42:58 -05:00
[db] Speed up Q_PL query used by e.g. '/databases/1/containers' request
The previous solution would use subqueries to count the number of items and streams in each playlist, which means that response time gets pretty slow if there are many playlists. This commit also includes a number of lesser db code changes.
This commit is contained in:
@@ -1032,7 +1032,7 @@ source_item_ownpl_get(struct artwork_ctx *ctx)
|
||||
mfi_path = ctx->dbmfi->path;
|
||||
|
||||
format = ART_E_NONE;
|
||||
while (((ret = db_query_fetch_pl(&qp, &dbpli, 0)) == 0) && (dbpli.id) && (format == ART_E_NONE))
|
||||
while (((ret = db_query_fetch_pl(&qp, &dbpli)) == 0) && (dbpli.id) && (format == ART_E_NONE))
|
||||
{
|
||||
if (!dbpli.path)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user