summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-17 22:56:56 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-17 22:56:56 +0100
commit70cd6a9f822308a416fefb051c4bbb83e6fd37e4 (patch)
treef9ae7ae1d3ac2d57632cd23946cf3f733c37cb76
parentI have now django 1.1.1 ^^ (diff)
downloadpyload-70cd6a9f822308a416fefb051c4bbb83e6fd37e4.tar.xz
create only one links.txt package
-rw-r--r--module/thread_list.py8
-rwxr-xr-xpyLoadCore.py14
2 files changed, 16 insertions, 6 deletions
diff --git a/module/thread_list.py b/module/thread_list.py
index c486ad8ee..1020f9ce1 100644
--- a/module/thread_list.py
+++ b/module/thread_list.py
@@ -107,16 +107,14 @@ class Thread_List(object):
if pyfile.status.type == "finished":
if pyfile.plugin.props['type'] == "container":
- #works(!) but adds many packs to queue
- self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.data["id"])
newLinks = 0
if pyfile.plugin.links:
- newPackager = self.list.packager.addNewPackage(pyfile.status.filename)
for link in pyfile.plugin.links:
newFile = self.list.collector.addLink(link)
- self.list.packager.addFileToPackage(newPackager, self.list.collector.popFile(newFile))
+ self.list.packager.addFileToPackage(pyfile.package.data["id"], self.list.collector.popFile(newFile))
newLinks += 1
- self.list.packager.pushPackage2Queue(newPackager)
+ self.list.packager.pushPackage2Queue(pyfile.package.data["id"])
+ self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.data["id"])
if newLinks:
self.parent.logger.info("Parsed link from %s: %i" % (pyfile.status.filename, newLinks))
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 7e1b9ebfc..fc196c587 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -145,7 +145,19 @@ class Core(object):
# pid = package id
# lid = link/file id
linkFile = self.config['general']['link_file']
- pid = self.file_list.packager.addNewPackage(package_name=linkFile)
+ packs = self.server_methods.get_queue()
+ found = False
+ print linkFile
+ for data in packs:
+ print data["package_name"]
+ if data["package_name"] == linkFile:
+ found = data["id"]
+ print "found", found
+ break
+ if found == False:
+ pid = self.file_list.packager.addNewPackage(package_name=linkFile)
+ else:
+ pid = found
lid = self.file_list.collector.addLink(linkFile)
self.file_list.packager.addFileToPackage(pid, self.file_list.collector.popFile(lid))
self.file_list.packager.pushPackage2Queue(pid)