De-dupe test room list & respect #test tag

dev
gravel 2 years ago
parent 46d85b059f
commit af3a86b324
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -22,16 +22,6 @@ import {
// Hidden communities for transparency. // Hidden communities for transparency.
const filteredCommunities = { const filteredCommunities = {
tests: [
"fishing+8e2e", // Example group from PySOGS documentation
"test+118d", // Testing 1, 2, 3
"test+13f6", // Testing room2
"test+fe93", // 测试Test)
"xyz+7908", // XYZ Room
"testingroom+22fd",
"TOKEN_fortest1+4567",
],
offensive: [ offensive: [
"aiunlimited+fc30", // illegal material "aiunlimited+fc30", // illegal material
"AlexMed+e093", // drug trading? "AlexMed+e093", // drug trading?
@ -389,13 +379,20 @@ function createJoinLinkButtons() {
function hideBadCommunities() { function hideBadCommunities() {
let numberOfHiddenCommunities = 0; let numberOfHiddenCommunities = 0;
for (const category of ['tests', 'offensive']) { for (const category of ['offensive']) {
numberOfHiddenCommunities += numberOfHiddenCommunities +=
filteredCommunities[category] filteredCommunities[category]
.map(hideCommunity) .map(hideCommunity)
.reduce((a, b) => a + b); .reduce((a, b) => a + b);
} }
for (const row of dom.tbl_communities_content_rows()) {
const rowInfo = dom.row_info(row);
if (rowInfo.tags.some((tag) => tag.text === "test")) {
numberOfHiddenCommunities += hideCommunity(rowInfo.identifier);
}
}
const summary = dom.servers_hidden(); const summary = dom.servers_hidden();
summary.innerText = `(${numberOfHiddenCommunities} hidden)`; summary.innerText = `(${numberOfHiddenCommunities} hidden)`;
} }

@ -564,7 +564,7 @@
); );
} }
if ($this->matched_by_list($TESTING_INCLUDE)) { if (in_array("test", $this->tags) || $this->matched_by_list($TESTING_INCLUDE)) {
$derived_tags[] = $derived_tags[] =
new CommunityTag( new CommunityTag(
"test", "test",

Loading…
Cancel
Save