Skip to content

Commit

Permalink
fix bug:wrong index in addtask;uniq add files
Browse files Browse the repository at this point in the history
  • Loading branch information
chliny committed Jan 5, 2014
1 parent 0850c8c commit cfc920b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xfdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def __pushtor(self,myfile,filename):
ires = self.__getrawlist()

oldfiles = []
if not ires:
if ires:
for fileinfo in ires["data"]:
oldfiles.append(fileinfo["file_name"])

Expand All @@ -411,10 +411,11 @@ def __pushtor(self,myfile,filename):

aversize = totalsize / len(torinfo["files"])
_print ("序号\t大小\t文件名")
index = -1
for fileentry in torinfo["files"]:
name = fileentry["file_name"]
size = fileentry["file_size"]
index = fileentry["file_index"]
index += 1
try:
_print ("%d\t%s\t%s" % (index,size,name))
except:
Expand Down

0 comments on commit cfc920b

Please # to comment.