From 82458ae8594ae1eda54d15c779aa961bf4f3870e Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Sun, 27 Aug 2023 13:22:08 +0300 Subject: [PATCH] filter erotic movies from movies catalog --- catalogs/lib/repository.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/catalogs/lib/repository.js b/catalogs/lib/repository.js index 320b7fe..74a58c7 100644 --- a/catalogs/lib/repository.js +++ b/catalogs/lib/repository.js @@ -16,10 +16,13 @@ async function getIds(providers, type, startDate, endDate) { const providersCondition = providers && providers.length ? `AND provider in (${providers.map(it => `'${it}'`).join(',')})` : ''; + const titleCondition = type === Type.MOVIE + ? 'AND torrents.title NOT LIKE \'%[Erotic]%\'' + : ''; const sortCondition = type === Type.MOVIE ? 'sum(torrents.seeders)' : 'max(torrents.seeders)'; const query = `SELECT files."${idName}" FROM (SELECT torrents."infoHash", torrents.seeders FROM torrents - WHERE seeders > 0 AND type = '${type}' ${providersCondition} ${dateCondition} + WHERE seeders > 0 AND type = '${type}' ${providersCondition} ${dateCondition} ${titleCondition} ) as torrents JOIN files ON torrents."infoHash" = files."infoHash" WHERE files."${idName}" IS NOT NULL ${episodeCondition}