Switch to less complicated track randomizer
This commit is contained in:
parent
087a06a20c
commit
14d915fb7c
@ -10,7 +10,7 @@ class SqliteBackend {
|
||||
|
||||
find(tag, callback) {
|
||||
this.db.run("INSERT INTO tags (tag) VALUES (?)", tag);
|
||||
this.db.get("SELECT uuid, tag, label FROM library WHERE tag = ? AND _ROWID_ >= (abs(random()) % (SELECT max(_ROWID_) FROM tags)) LIMIT 1", tag, (err, row) => {
|
||||
this.db.get("SELECT uuid, tag, label FROM library WHERE tag = ? ORDER BY RANDOM() LIMIT 1", tag, (err, row) => {
|
||||
if (typeof row === 'undefined') {
|
||||
return callback();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user