Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2026-03-05 20:10:02 -05:00
2 changed files with 29 additions and 4 deletions

View File

@@ -17,21 +17,46 @@ module.exports = {
);
const bulkRemove = [];
const deleteTids = new Set();
uids.forEach((uid, index) => {
const userTids = userInboxes[index];
userTids.forEach((tid, tidIndex) => {
if (!exists[index][tidIndex]) {
bulkRemove.push([`uid:${uid}:inbox`, tid]);
deleteTids.add(tid);
}
});
});
await db.sortedSetRemoveBulk(bulkRemove);
await db.deleteAll(Array.from(deleteTids).map(tid => `tid:${tid}:recipients`));
progress.incr(uids.length);
}, {
batch: 500,
});
const tidKeys = await db.scan({ match: 'tid:*:recipients' });
progress.total = tidKeys.length;
progress.current = 0;
progress.counter = 0;
await batch.processArray(tidKeys, async (keys) => {
const tids = [];
keys.forEach((key) => {
const tid = key.split(':')[1];
if (tid) {
tids.push(tid);
}
});
const exists = await db.exists(tids.map(tid => `topic:${tid}`));
const bulkDelete = [];
tids.forEach((tid, index) => {
if (!exists[index]) {
bulkDelete.push(`tid:${tid}:recipients`);
}
});
await db.deleteAll(bulkDelete);
progress.incr(keys.length);
}, {
batch: 500,
});
},
};

View File

@@ -10,7 +10,7 @@
<div component="topic/thumb/list" class="position-absolute end-0 bottom-0 p-3 d-flex gap-2 pe-none {{{ if greaterthan(./topic.thumbs.length, "4") }}}thumbs-collapsed{{{ end }}}">
{{{ each ./topic.thumbs }}}
{{{ if (@index != 0) }}}
<img class="rounded-1" style="max-height: 64px; object-fit: contain;" src="{./url}">
<img class="rounded-1 bg-light" style="width:auto; max-width: 5.33rem; height: 3.33rem; object-fit: contain;" src="{./url}">
{{{ end }}}
{{{ end }}}
{{{ if greaterthan(./topic.thumbs.length, "4") }}}