CustomNodes and SQL
Posted: Mon Nov 20, 2023 2:02 pm
I currently try to figure out how to modify the CustomNodes:
To further specify this query by inserting the e.g. DateAdded element and using the SQL editor from MM5, I was able to successfully extend this query using the SQL editor in MM5.
However if I insert this into the customNodesDefinitions:
I always get an error message.
What's wrong in line ?:
Every hint is appreciated
Carsten
Code: Select all
var customNodesDefinitions = {
tracks: [{
title: 'Show 5 most played tracks',
description: 'Currently showing 5 most played tracks',
sql: 'Songs.PlayCounter > 0 ORDER BY Songs.PlayCounter DESC LIMIT 5'
},
.....
{
Code: Select all
SELECT
Songs.PlayCounter, strftime('%Y',julianday(DateAdded + 2415018.5),'localtime') as addedyear
FROM
Songs
WHERE addedyear = '2015' AND Songs.PlayCounter > 0 ORDER BY Songs.PlayCounter DESC LIMIT 5
Code: Select all
var customNodesDefinitions = {
tracks: [{
title: 'Show 5 most played tracks in 2015',
description: 'Currently showing 5 most played tracks',
sql: 'strftime('%Y',julianday(DateAdded + 2415018.5),'localtime') = '2015' AND Songs.PlayCounter > 0 ORDER BY Songs.PlayCounter DESC LIMIT 5'
},
....
{
What's wrong in line ?:
Code: Select all
sql: 'strftime('%Y',julianday(DateAdded + 2415018.5),'localtime') = '2015' AND Songs.PlayCounter > 0 ORDER BY Songs.PlayCounter DESC LIMIT 5'
Carsten