refactor: move post uploads to post hash (#13533)

* refactor: move post uploads to post hash

* test: add uploads to api definition

* refactor: move thumbs to topic hash

* chore: up composer

* refactor: dont use old zset
This commit is contained in:
Barış Uşaklı
2025-07-07 10:22:24 -04:00
committed by GitHub
parent bfcc36f7cb
commit 24e7cf4a00
24 changed files with 393 additions and 429 deletions

View File

@@ -34,6 +34,7 @@ module.exports = function (utils, Benchpress, relative_path) {
humanReadableNumber,
formattedNumber,
txEscape,
uploadBasename,
generatePlaceholderWave,
register,
__escape: identity,
@@ -379,6 +380,12 @@ module.exports = function (utils, Benchpress, relative_path) {
return String(text).replace(/%/g, '%').replace(/,/g, ',');
}
function uploadBasename(str, sep = '/') {
const hasTimestampPrefix = /^\d+-/;
const name = str.substr(str.lastIndexOf(sep) + 1);
return hasTimestampPrefix.test(name) ? name.slice(14) : name;
}
function generatePlaceholderWave(items) {
const html = items.map((i) => {
if (i === 'divider') {