CLI: Implemented delete command for bookmarks and playlists.
This commit is contained in:
@ -637,6 +637,11 @@ public class DbApi {
|
||||
return sql.rows(query, sqlParams)
|
||||
.collect { recordToModel(Playlist, it) } }
|
||||
|
||||
public int delete(Playlist p) {
|
||||
return withTransaction {
|
||||
removeAllFromPlaylist(p.id)
|
||||
delete((Model) p) } }
|
||||
|
||||
public int getNextPlaylistPosition(UUID playlistId) {
|
||||
String query = """\
|
||||
SELECT COALESCE(MAX(position), 0) + 1
|
||||
@ -740,7 +745,8 @@ public class DbApi {
|
||||
logger.debug(
|
||||
'Finding media file playlist position.\n\tSQL: {}\n\tPARAMS: {}',
|
||||
getPositionQuery, params)
|
||||
int position = sql.firstRow(getPositionQuery, params)[0]
|
||||
def row = sql.firstRow(getPositionQuery, params)
|
||||
int position = row ? row[0] : 0
|
||||
|
||||
logger.debug(
|
||||
'Removing media file from playlist.\n\tSQL: {}\n\tPARAMS: {}',
|
||||
|
Reference in New Issue
Block a user