Fix tag retrieval.
This commit is contained in:
parent
e1f64b7b86
commit
fe80bed570
@ -738,7 +738,7 @@ public class ORM {
|
||||
def query = new StringBuilder()
|
||||
def sqlParams = []
|
||||
|
||||
query.append('SELECT DISTINCT t.* FROM tags ')
|
||||
query.append('SELECT DISTINCT t.* FROM tags t ')
|
||||
|
||||
if (params.mediaFileId || params.artistId || params.albumId ||
|
||||
params.playlistId)
|
||||
@ -768,7 +768,12 @@ public class ORM {
|
||||
|
||||
if (params.name) {
|
||||
query.append(' WHERE t.name = ? ')
|
||||
sqlParams << params.name } }
|
||||
sqlParams << params.name }
|
||||
|
||||
query = query.toString()
|
||||
logger.debug('Selecting tags.\n\tSQL: {}\n\tPARAMS: {}',
|
||||
query, sqlParams)
|
||||
return sql.rows(query, sqlParams).collect { recordToModel(Tag, it) } }
|
||||
|
||||
public def tagMediaFiles(List<Integer> mediaFileIds, List<String> tagNames) {
|
||||
String insertQuery = 'INSERT INTO media_files_tags VALUES (?, ?)'
|
||||
|
Loading…
Reference in New Issue
Block a user