The m3u playlist scanner improvements in commit 6e9cf3a resulted in

too many database lookups. This is a more efficient version.
This commit is contained in:
ejurgensen
2013-08-21 23:16:25 +02:00
parent 0abc9f04f2
commit 9d0962407a
3 changed files with 52 additions and 8 deletions

View File

@@ -1524,6 +1524,26 @@ db_files_get_count(void)
return db_get_count("SELECT COUNT(*) FROM files f WHERE f.disabled = 0;");
}
int
db_files_get_count_bypathpattern(char *path)
{
char *query;
int count;
query = sqlite3_mprintf("SELECT COUNT(*) FROM files f WHERE f.path LIKE '%%%q';", path);
if (!query)
{
DPRINTF(E_LOG, L_DB, "Out of memory making count query string.\n");
return;
}
count = db_get_count(query);
sqlite3_free(query);
return count;
}
void
db_files_update_songalbumid(void)
{