Skip to content

Commit

Permalink
fix(filters): fix filter cleanup on categories #51
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jul 21, 2018
1 parent c20b3b5 commit 7ec95cb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
2 changes: 2 additions & 0 deletions src/background/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = async ({
removeTorrentFromDB,
updateTorrentToDB,
checkTorrent,
setupTorrentRecord,
p2pStore,
feed
}) => {
Expand Down Expand Up @@ -828,6 +829,7 @@ module.exports = async ({
}

forBigTable(sphinx, 'torrents', (torrent) => {
setupTorrentRecord(torrent)
if(!checkTorrent(torrent))
toRemove.push(torrent)
}, done)
Expand Down
20 changes: 13 additions & 7 deletions src/background/spider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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))
{
Expand Down Expand Up @@ -754,6 +759,7 @@ app.get('*', function(req, res)
removeTorrentFromDB,
updateTorrentToDB,
checkTorrent,
setupTorrentRecord,
p2pStore,
feed
})
Expand Down
3 changes: 2 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
3 changes: 2 additions & 1 deletion translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Торрентов для очистки"
}
}
3 changes: 2 additions & 1 deletion translations/ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 7ec95cb

Please sign in to comment.