Update F95_BRATR_Management_Ratings_Helper.js

Added 200 char check when user mentions it
This commit is contained in:
Ryahn 2025-09-18 03:23:34 +00:00
parent aaa36886c9
commit b3fac15c8f

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name F95 BRATR Management Ratings Helper
// @namespace Ryahn
// @version 1.4.1
// @version 1.4.2
// @description Triage panel for /bratr-ratings/management: highlight low-effort reviews, filter, export CSV.
// @match https://f95zone.to/bratr-ratings/management*
// @match https://f95zone.to/bratr-ratings/*/management*
@ -73,7 +73,8 @@
{ label: 'amazing', rx: /\bamazing!?(\b|$)/i },
{ label: 'top N', rx: /\btop\s+\d+\b/i },
{ label: 'pretty sex scenes', rx: /\bpretty sex scenes\b/i },
{ label: 'downloads flex', rx: /\bdownload(ed)? hundreds of games\b/i }
{ label: 'downloads flex', rx: /\bdownload(ed)? hundreds of games\b/i },
{ label: 'mentions 200 (char rule)', rx: /\b200(?:\s*[- ]?(?:char(?:s|acters?)?|word(?:s)?|limit|minimum|min))?\b/i }
];
// Spam/bypass heuristics
@ -156,7 +157,7 @@
}
// Diagnose low-effort
function diagnoseLowEffort(r, cutoff=220) {
function diagnoseLowEffort(r, cutoff=200) {
const reasons = [];
const body = r.bodyTxt || '';
@ -195,7 +196,7 @@
<div class="bh-body">
<div class="bh-controls">
<label>Min <input type="number" step="0.5" min="0" max="5" class="bh-minrating" value="0"></label>
<label>Low-effort length cutoff <input type="number" min="0" class="bh-maxlen" value="220"></label>
<label>Low-effort length cutoff <input type="number" min="0" class="bh-maxlen" value="200"></label>
<label>User <input type="text" class="bh-user" placeholder="author contains"></label>
<label>Date from <input type="datetime-local" class="bh-from"></label>
<label>Date to <input type="datetime-local" class="bh-to"></label>
@ -261,7 +262,7 @@
else { body.style.display = 'none'; panel.querySelector('.bh-collapse').textContent = '+'; }
});
panel.querySelector('.bh-reset').addEventListener('click', () => {
ui.min.value = 0; ui.maxlen.value = 220; ui.user.value = ''; ui.lowonly.checked = true; ui.from.value = ''; ui.to.value = '';
ui.min.value = 0; ui.maxlen.value = 200; ui.user.value = ''; ui.lowonly.checked = true; ui.from.value = ''; ui.to.value = '';
render();
});
['input','change'].forEach(ev => {
@ -295,7 +296,7 @@
}
function render() {
const maxlen = parseInt(ui.maxlen.value || '220', 10);
const maxlen = parseInt(ui.maxlen.value || '200', 10);
const live = reviews.filter(r => !r.deleted);
const lowCount = live.filter(r => diagnoseLowEffort(r, maxlen).low).length;
const avgRating = avg(live.map(r => r.rating || 0)).toFixed(2);
@ -363,7 +364,7 @@
// Tint live page with reasons as tooltip
function retint() {
const maxlen = parseInt(ui.maxlen?.value || '220', 10);
const maxlen = parseInt(ui.maxlen?.value || '200', 10);
reviews.forEach(r => {
if (r.deleted) {
r.node.style.outline = '';
@ -388,7 +389,7 @@
// Copy CSV of current view, with reasons column
panel.querySelector('.bh-copy').addEventListener('click', () => {
const rows = currentRows();
const maxlen = parseInt(ui.maxlen?.value || '220', 10);
const maxlen = parseInt(ui.maxlen?.value || '200', 10);
const header = ['author','rating','thread','threadUrl','timeIso','effLen','rawLen','deleted','low','reasons','body'];
const lines = [header.join(',')];
rows.forEach(r => {