Browse Source

Make minimum seeders configurable

fix #3202
pull/4201/head
Ruud 11 years ago
parent
commit
d7f43c2cf8
  1. 20
      couchpotato/core/media/_base/searcher/__init__.py
  2. 7
      couchpotato/core/plugins/release/main.py

20
couchpotato/core/media/_base/searcher/__init__.py

@ -73,4 +73,24 @@ config = [{
], ],
}, },
], ],
}, {
'name': 'torrent',
'groups': [
{
'tab': 'searcher',
'name': 'searcher',
'wizard': True,
'options': [
{
'name': 'minimum_seeders',
'advanced': True,
'label': 'Minimum seeders',
'description': 'Ignore torrents with seeders below this number',
'default': 1,
'type': 'int',
'unit': 'seeders'
},
],
},
],
}] }]

7
couchpotato/core/plugins/release/main.py

@ -8,7 +8,7 @@ from couchpotato import md5, get_db
from couchpotato.api import addApiView from couchpotato.api import addApiView
from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.encoding import toUnicode, sp from couchpotato.core.helpers.encoding import toUnicode, sp
from couchpotato.core.helpers.variable import getTitle from couchpotato.core.helpers.variable import getTitle, tryInt
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin from couchpotato.core.plugins.base import Plugin
from .index import ReleaseIndex, ReleaseStatusIndex, ReleaseIDIndex, ReleaseDownloadIndex from .index import ReleaseIndex, ReleaseStatusIndex, ReleaseIDIndex, ReleaseDownloadIndex
@ -380,6 +380,7 @@ class Release(Plugin):
wait_for = False wait_for = False
let_through = False let_through = False
filtered_results = [] filtered_results = []
minimum_seeders = tryInt(Env.setting('minimum_seeders', section = 'torrent', default = 1))
# Filter out ignored and other releases we don't want # Filter out ignored and other releases we don't want
for rel in results: for rel in results:
@ -396,8 +397,8 @@ class Release(Plugin):
log.info('Ignored, size "%sMB" to low: %s', (rel['size'], rel['name'])) log.info('Ignored, size "%sMB" to low: %s', (rel['size'], rel['name']))
continue continue
if 'seeders' in rel and rel.get('seeders') <= 0: if 'seeders' in rel and rel.get('seeders') < minimum_seeders:
log.info('Ignored, no seeders: %s', (rel['name'])) log.info('Ignored, not enough seeders, has %s needs %s: %s', (rel.get('seeders'), minimum_seeders, rel['name']))
continue continue
# If a single release comes through the "wait for", let through all # If a single release comes through the "wait for", let through all

Loading…
Cancel
Save