This commit is contained in:
parent
97fcdcce5d
commit
cd0b9a7f55
@ -10,12 +10,12 @@
|
|||||||
"http://localhost"
|
"http://localhost"
|
||||||
],
|
],
|
||||||
"database": {
|
"database": {
|
||||||
"host": "localhost",
|
"host": "database",
|
||||||
"port": 27017,
|
"port": 27017,
|
||||||
"name": "webplay"
|
"name": "webplay"
|
||||||
},
|
},
|
||||||
"redis": {
|
"redis": {
|
||||||
"host": "localhost",
|
"host": "redis",
|
||||||
"port": 6379
|
"port": 6379
|
||||||
},
|
},
|
||||||
"album_cover_files": [
|
"album_cover_files": [
|
||||||
|
@ -320,11 +320,9 @@ exports.randomCovers = function (count, size, callback) {
|
|||||||
.toArray((err, result) => {
|
.toArray((err, result) => {
|
||||||
let res = [];
|
let res = [];
|
||||||
if (result.length > count) {
|
if (result.length > count) {
|
||||||
let i = 0;
|
while (count-- > 0) {
|
||||||
while (i < count) {
|
|
||||||
let rnd = randomNumber(0, result.length);
|
let rnd = randomNumber(0, result.length);
|
||||||
res.push(result[rnd]);
|
res.push(result[rnd]);
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
callback(res);
|
callback(res);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user