diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 5fcfd1f..bd89c99 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -4618,11 +4618,11 @@ window.cancelAnimFrame = (function () { ]; const getNavXdTier = (s) => { s = +s; - if (s <= 0) return 0; - if (s < 5) return 1; - if (s < 15) return 2; - if (s < 30) return 3; - if (s < 60) return 4; + if (s < 5) return 0; + if (s < 200) return 1; + if (s < 1000) return 2; + if (s < 100000) return 3; + if (s < 200000000) return 4; return 5; }; const XD_TIER_COLORS = ['#888', '#5a9e5a', '#8ac449', '#d4a017', '#e07b2a', '#ff5500']; @@ -4770,19 +4770,19 @@ window.cancelAnimFrame = (function () { // 2. Any grid thumbnail indicators for that item (on any page) const XD_TIER_META = [ null, - { cls: 'xd-tier-1', label: 'xD', min: 1 }, - { cls: 'xd-tier-2', label: 'xDD', min: 5 }, - { cls: 'xd-tier-3', label: 'xDDD', min: 15 }, - { cls: 'xd-tier-4', label: 'xDDDD', min: 30 }, - { cls: 'xd-tier-5', label: 'xDDDDD+', min: 60 }, + { cls: 'xd-tier-1', label: 'xD', min: 5 }, + { cls: 'xd-tier-2', label: 'xDD', min: 200 }, + { cls: 'xd-tier-3', label: 'xDDD', min: 1000 }, + { cls: 'xd-tier-4', label: 'xDDDD', min: 100000 }, + { cls: 'xd-tier-5', label: 'xDDDDD+', min: 200000000 }, ]; const getXdTierFromScore = (score) => { - if (score <= 0) return 0; - if (score < 5) return 1; - if (score < 15) return 2; - if (score < 30) return 3; - if (score < 60) return 4; + if (score < 5) return 0; + if (score < 200) return 1; + if (score < 1000) return 2; + if (score < 100000) return 3; + if (score < 200000000) return 4; return 5; }; diff --git a/public/s/js/settings.js b/public/s/js/settings.js index 242666d..4654612 100644 --- a/public/s/js/settings.js +++ b/public/s/js/settings.js @@ -1332,11 +1332,11 @@ const getXdTier = (score) => { score = +score; - if (score <= 0) return 0; - if (score < 5) return 1; - if (score < 15) return 2; - if (score < 30) return 3; - if (score < 60) return 4; + if (score < 5) return 0; + if (score < 200) return 1; + if (score < 1000) return 2; + if (score < 100000) return 3; + if (score < 200000000) return 4; return 5; }; diff --git a/src/inc/routeinc/f0cklib.mjs b/src/inc/routeinc/f0cklib.mjs index c020e05..97fb4ed 100644 --- a/src/inc/routeinc/f0cklib.mjs +++ b/src/inc/routeinc/f0cklib.mjs @@ -79,19 +79,19 @@ const computeXdScore = (comments) => { for (const c of comments) { if (!c.content || c.is_deleted) continue; for (const m of c.content.matchAll(xdRegex)) { - score += m[1].length; // 1pt per D: xD=1, xDD=2, xDDD=3, ... + score += m[1].length; } } return score; }; const xdScoreMeta = (score) => { - if (score <= 0) return { tier: 0, label: '' }; - if (score < 5) return { tier: 1, label: 'xD' }; - if (score < 15) return { tier: 2, label: 'xDD' }; - if (score < 30) return { tier: 3, label: 'xDDD' }; - if (score < 60) return { tier: 4, label: 'xDDDD' }; - return { tier: 5, label: 'xDDDDD+' }; + if (score < 5) return { tier: 0, label: '' }; + if (score < 200) return { tier: 1, label: 'xD' }; + if (score < 1000) return { tier: 2, label: 'xDD' }; + if (score < 100000) return { tier: 3, label: 'xDDD' }; + if (score < 200000000) return { tier: 4, label: 'xDDDD' }; + return { tier: 5, label: 'xDDDDD+' }; }; export default { @@ -260,6 +260,12 @@ export default { limit ${eps} `; + for (const row of rows) { + const meta = xdScoreMeta(row.xd_score); + row.xd_tier = meta.tier; + row.xd_label = meta.label; + } + // Dynamic thumb sizing: only on the unfiltered main feed. // Profile pages, tag searches, halls, favorites, mime filters all use tier 1 (1×1). const isMainFeed = cfg.websrv.enable_dynamic_thumbs diff --git a/views/index-partial.html b/views/index-partial.html index f398bea..7d1ca0e 100644 --- a/views/index-partial.html +++ b/views/index-partial.html @@ -11,8 +11,8 @@ @if(item.is_oc) OC @endif - @if(enable_xd_score && item.xd_score > 0) - xD + @if(enable_xd_score && item.xd_tier > 0) + xD @endif

diff --git a/views/snippets/items-grid.html b/views/snippets/items-grid.html index cf8084b..cfeed99 100644 --- a/views/snippets/items-grid.html +++ b/views/snippets/items-grid.html @@ -7,8 +7,8 @@ @if(item.is_oc) OC @endif - @if(enable_xd_score && item.xd_score > 0) - xD + @if(enable_xd_score && item.xd_tier > 0) + xD @endif