[SMARTPL] add 'random' in 'order by' clause
'random' tag in 'order by' clause to request SQLite to random select data rows from result set "random 3 pop" { genre is "Pop" and media_kind is music order by random desc limit 3 }
This commit is contained in:
parent
86d49a7028
commit
4147e302a8
|
@ -37,6 +37,7 @@ ordertag : STRTAG
|
||||||
| INTTAG
|
| INTTAG
|
||||||
| DATETAG
|
| DATETAG
|
||||||
| ENUMTAG
|
| ENUMTAG
|
||||||
|
| RANDOMTAG
|
||||||
| (XXX)? NeverUsedRule
|
| (XXX)? NeverUsedRule
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -117,6 +118,9 @@ GROUPTAG : 'track_count'
|
||||||
| 'album_count'
|
| 'album_count'
|
||||||
;
|
;
|
||||||
|
|
||||||
|
RANDOMTAG : 'random'
|
||||||
|
;
|
||||||
|
|
||||||
INCLUDES : 'includes'
|
INCLUDES : 'includes'
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -345,6 +345,11 @@ ordertag returns [ pANTLR3_STRING result ]
|
||||||
$result->append8($result, "f.");
|
$result->append8($result, "f.");
|
||||||
$result->appendS($result, $ENUMTAG.text->toUTF8($ENUMTAG.text));
|
$result->appendS($result, $ENUMTAG.text->toUTF8($ENUMTAG.text));
|
||||||
}
|
}
|
||||||
|
| RANDOMTAG
|
||||||
|
{
|
||||||
|
$result = $RANDOMTAG.text->factory->newRaw($RANDOMTAG.text->factory);
|
||||||
|
$result->append8($result, "random()");
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
dateval returns [ pANTLR3_STRING result ]
|
dateval returns [ pANTLR3_STRING result ]
|
||||||
|
|
Loading…
Reference in New Issue