Add the ability to list untagged files in core.

This commit is contained in:
Jonathan Bernard 2016-03-16 02:14:58 -05:00
parent eb17561d77
commit 26922edd12

View File

@ -503,6 +503,17 @@ public class ORM {
return sql.rows(query, sqlParams).collect {
recordToModel(MediaFile, it) } }
public List<MediaFile> getUntaggedFiles() {
String query = """
SELECT mf.*
FROM media_files mf LEFT JOIN
media_files_tags mft ON
mf.id = mft.media_file_id
WHERE mft.media_file_id IS NULL"""
logger.debug('Finding untagged media files.\n\tSQL: {}', query)
return sql.rows(query).collect { recordToModel(MediaFile, it) } }
public def associateMediaFileWithAlbum(int mediaFileId, int albumId) {
return associate(Album, MediaFile, albumId, mediaFileId) }