code design
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Artem Anufrij 2023-09-27 21:43:52 +02:00
parent 97fcdcce5d
commit cd0b9a7f55
2 changed files with 3 additions and 5 deletions

View File

@ -10,12 +10,12 @@
"http://localhost"
],
"database": {
"host": "localhost",
"host": "database",
"port": 27017,
"name": "webplay"
},
"redis": {
"host": "localhost",
"host": "redis",
"port": 6379
},
"album_cover_files": [

View File

@ -320,11 +320,9 @@ exports.randomCovers = function (count, size, callback) {
.toArray((err, result) => {
let res = [];
if (result.length > count) {
let i = 0;
while (i < count) {
while (count-- > 0) {
let rnd = randomNumber(0, result.length);
res.push(result[rnd]);
i++;
}
callback(res);
} else {