fancy-banner. fix #18 #21

Merged
artem merged 4 commits from fancy-banner into main 2023-09-27 21:46:40 +02:00
Showing only changes of commit 94a6893444 - Show all commits

View File

@ -318,8 +318,8 @@ exports.randomCovers = function (count, size, callback) {
.find({ "covers.cover64": { $exists: true } }) .find({ "covers.cover64": { $exists: true } })
.project({ "covers.cover64": true }) .project({ "covers.cover64": true })
.toArray((err, result) => { .toArray((err, result) => {
let res = [];
if (result.length > count) { if (result.length > count) {
let res = [];
while (count-- > 0) { while (count-- > 0) {
let rnd = randomNumber(0, result.length); let rnd = randomNumber(0, result.length);
res.push(result[rnd]); res.push(result[rnd]);