summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-17 15:44:50 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-06-17 15:44:50 +0200
commit84aa569a2ec5d5fbe61270ef11e539d62ab1374e (patch)
treed0553c62738e2a0dd3aa8e9695ea4a5d16e0a498 /module/plugins
parentfilesonic fix (diff)
downloadpyload-84aa569a2ec5d5fbe61270ef11e539d62ab1374e.tar.xz
skip files across packages
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Plugin.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 0c98845c4..bdb1af77b 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -510,25 +510,28 @@ class Plugin(object):
def checkForSameFiles(self, starting=False):
- """ checks if same file was/is downloaded within same package and raise exception """
+ """ checks if same file was/is downloaded within same package
+
+ :param starting: indicates that the current download is going to start
+ :raises SkipDownload:
+ """
pack = self.pyfile.package()
cache = self.core.files.cache.values()
for pyfile in cache:
- if pyfile != self.pyfile and pyfile.name == self.pyfile.name and pyfile.package().folder == pack.folder:
+ if pyfile != self.pyfile and pyfile.package().folder == pack.folder:
if pyfile.status in (0, 12): #finished or downloading
raise SkipDownload(pyfile.pluginname)
- elif pyfile.status in (5, 7) and starting: #a download is waiting and was appenrently started before
+ elif pyfile.status in (5, 7) and starting: #a download is waiting/starting and was appenrently started before
raise SkipDownload(pyfile.pluginname)
- #TODO check same packagenames
- pyfile = self.core.db.findDuplicates(self.pyfile.id, self.pyfile.packageid, self.pyfile.name)
+ pyfile = self.core.db.findDuplicates(self.pyfile.id, self.pyfile.package().folder, self.pyfile.name)
if pyfile:
download_folder = self.config['general']['download_folder']
location = save_join(download_folder, pack.folder)
- if exists(save_join(location, self.pyfile.name)):
+ if exists(join(location, fs_encode(self.pyfile.name))):
raise SkipDownload(pyfile[0])
self.log.debug("File %s not skipped, because it does not exists." % self.pyfile.name)