TorrentDownloads plugin performance improvement

This commit is contained in:
Christophe Dumez 2010-09-27 19:47:17 +00:00
parent 76a22fabcd
commit 1596dc5206
2 changed files with 7 additions and 4 deletions

View file

@ -1,4 +1,4 @@
#VERSION: 1.04 #VERSION: 1.05
#AUTHORS: Christophe Dumez (chris@qbittorrent.org) #AUTHORS: Christophe Dumez (chris@qbittorrent.org)
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -72,6 +72,8 @@ class torrentdownloads(object):
self.current_item = None self.current_item = None
self.results = results self.results = results
self.what = what.upper().split('+') self.what = what.upper().split('+')
if len(self.what) == 0:
self.what = None
def start_a(self, attr): def start_a(self, attr):
params = dict(attr) params = dict(attr)
@ -113,6 +115,7 @@ class torrentdownloads(object):
self.current_item['leech'] = 0 self.current_item['leech'] = 0
# Search should use AND operator as a default # Search should use AND operator as a default
tmp = self.current_item['name'].upper(); tmp = self.current_item['name'].upper();
if self.what is not None:
for w in self.what: for w in self.what:
if tmp.find(w) < 0: return if tmp.find(w) < 0: return
prettyPrinter(self.current_item) prettyPrinter(self.current_item)

View file

@ -4,4 +4,4 @@ btjunkie: 2.21
mininova: 1.40 mininova: 1.40
piratebay: 1.30 piratebay: 1.30
vertor: 1.0 vertor: 1.0
torrentdownloads: 1.04 torrentdownloads: 1.05