mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-26 23:25:56 -05:00
In group?group-type=artists type queries return better persistent id
- this is a temporary solution until real persistent id's can be used. This change uses a hash of album_artist instead of returning a fixed value of 1. Thank you SquallyDoc, author of Retune, for helping out with this and suggesting this solution.
This commit is contained in:
parent
a925268d50
commit
ec2637285d
8
src/db.c
8
src/db.c
@ -1106,13 +1106,13 @@ db_build_query_group_artists(struct query_params *qp, char **q)
|
||||
sort = sort_clause[qp->sort];
|
||||
|
||||
if (idx && qp->filter)
|
||||
query = sqlite3_mprintf("SELECT 1, 1, f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 AND %s GROUP BY f.album_artist %s %s;", qp->filter, sort, idx);
|
||||
query = sqlite3_mprintf("SELECT 1, daap_songalbumid(f.album_artist, ''), f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 AND %s GROUP BY f.album_artist %s %s;", qp->filter, sort, idx);
|
||||
else if (idx)
|
||||
query = sqlite3_mprintf("SELECT 1, 1, f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 GROUP BY f.album_artist %s %s;", sort, idx);
|
||||
query = sqlite3_mprintf("SELECT 1, daap_songalbumid(f.album_artist, ''), f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 GROUP BY f.album_artist %s %s;", sort, idx);
|
||||
else if (qp->filter)
|
||||
query = sqlite3_mprintf("SELECT 1, 1, f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 AND %s GROUP BY f.album_artist %s;", qp->filter, sort);
|
||||
query = sqlite3_mprintf("SELECT 1, daap_songalbumid(f.album_artist, ''), f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 AND %s GROUP BY f.album_artist %s;", qp->filter, sort);
|
||||
else
|
||||
query = sqlite3_mprintf("SELECT 1, 1, f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 GROUP BY f.album_artist %s;", sort);
|
||||
query = sqlite3_mprintf("SELECT 1, daap_songalbumid(f.album_artist, ''), f.album_artist, COUNT(*), COUNT(DISTINCT f.album), f.album_artist FROM files f WHERE f.disabled = 0 GROUP BY f.album_artist %s;", sort);
|
||||
|
||||
if (!query)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user