Drive provider filters from the archive dataset
This commit is contained in:
@@ -23,7 +23,7 @@ import { BackfillQueue } from "../src/backfill.js";
|
||||
import { extractMedia } from "../src/extract.js";
|
||||
import { PuppetBackend } from "../src/puppet-backend.js";
|
||||
import { betterCandidate, sortCandidates } from "../src/dedupe.js";
|
||||
import { aspectCondition, resolutionCondition } from "../src/filter-presets.js";
|
||||
import { aspectCondition, PROVIDER_FILTERS, resolutionCondition } from "../src/filter-presets.js";
|
||||
import { isNearLimit, planRetention } from "../src/retention.js";
|
||||
import { isoFromSnowflake, snowflakeFromIso } from "../src/snowflake.js";
|
||||
import {
|
||||
@@ -1347,6 +1347,20 @@ void (async () => {
|
||||
store.close();
|
||||
});
|
||||
|
||||
await test("provider filters are the curated archive list", () => {
|
||||
assert.ok(PROVIDER_FILTERS.length >= 8 && PROVIDER_FILTERS.length <= 12, PROVIDER_FILTERS.length);
|
||||
assert.equal(new Set(PROVIDER_FILTERS).size, PROVIDER_FILTERS.length);
|
||||
|
||||
for (const value of PROVIDER_FILTERS) {
|
||||
assert.equal(value, value.toLowerCase());
|
||||
assert.ok(!value.includes(" ") && !value.includes("."), `host-like entry: ${value}`);
|
||||
}
|
||||
|
||||
for (const required of ["discord", "youtube", "twitch", "tenor"]) {
|
||||
assert.ok((PROVIDER_FILTERS as readonly string[]).includes(required), required);
|
||||
}
|
||||
});
|
||||
|
||||
await test("store exclusion, size, and length filters", () => {
|
||||
const dir = join(root, "exclude-test");
|
||||
mkdirSync(dir, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user