fix(filters): fix filter cleanup on categories #51

This commit is contained in:
Alexey Kasyanchuk 2018-07-21 20:27:09 +03:00
parent bc64e73c45
commit cb4787b2c5
5 changed files with 21 additions and 10 deletions

View File

@ -19,6 +19,7 @@ module.exports = async ({
removeTorrentFromDB,
updateTorrentToDB,
checkTorrent,
setupTorrentRecord,
p2pStore,
feed
}) => {
@ -828,6 +829,7 @@ module.exports = async ({
}
forBigTable(sphinx, 'torrents', (torrent) => {
setupTorrentRecord(torrent)
if(!checkTorrent(torrent))
toRemove.push(torrent)
}, done)

View File

@ -442,13 +442,7 @@ app.get('*', function(req, res)
return true
}
const insertTorrentToDB = (torrent, silent) => new Promise((resolve) => {
if(!torrent)
{
resolve()
return
}
const setupTorrentRecord = (torrent) => {
// fix cases for low cases letters
if(torrent.contentcategory)
{
@ -464,6 +458,17 @@ app.get('*', function(req, res)
// clean download info if added
if(torrent.download)
delete torrent.download
}
const insertTorrentToDB = (torrent, silent) => new Promise((resolve) => {
if(!torrent)
{
resolve()
return
}
// setup torrent record if it from db
setupTorrentRecord(torrent)
if(!checkTorrent(torrent))
{
@ -754,6 +759,7 @@ app.get('*', function(req, res)
removeTorrentFromDB,
updateTorrentToDB,
checkTorrent,
setupTorrentRecord,
p2pStore,
feed
})

View File

@ -180,6 +180,7 @@
"Enable torrents replication server for other rats clients (required for replication)": "Enable torrents replication server for other rats clients (required for replication)",
"* - enabled means ignoring all adult content": "* - enabled means ignoring all adult content",
"disable some categories": "disable some categories",
"Discs/ISO": "Discs/ISO"
"Discs/ISO": "Discs/ISO",
"Torrents to clean": "Torrents to clean"
}
}

View File

@ -180,6 +180,7 @@
"Enable torrents replication server for other rats clients (required for replication)": "Включить сервер репликации для остальных крысиных клиентов (необходим для репликации)",
"* - enabled means ignoring all adult content": "* - означает игнорирование всего контента для взрослых",
"disable some categories": "отключить некоторые категории",
"Discs/ISO": "Диски/Образы"
"Discs/ISO": "Диски/Образы",
"Torrents to clean": "Торрентов для очистки"
}
}

View File

@ -180,6 +180,7 @@
"Enable torrents replication server for other rats clients (required for replication)": "Enable torrents replication server for other rats clients (required for replication)",
"* - enabled means ignoring all adult content": "* - enabled means ignoring all adult content",
"disable some categories": "disable some categories",
"Discs/ISO": "Discs/ISO"
"Discs/ISO": "Discs/ISO",
"Torrents to clean": "Torrents to clean"
}
}