mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 09:58:39 +00:00
Sort files by date when using 'add' command autocompletion, listing newest on top
This commit is contained in:
parent
e6e0eefaa4
commit
ba7e36c719
1 changed files with 3 additions and 0 deletions
|
@ -139,6 +139,9 @@ class Command(BaseCommand):
|
||||||
else: # \o/ Unix
|
else: # \o/ Unix
|
||||||
p += "/"
|
p += "/"
|
||||||
ret.append(p)
|
ret.append(p)
|
||||||
|
|
||||||
|
ret = sorted(ret, key=lambda p: os.stat(p).st_mtime, reverse=True)
|
||||||
|
|
||||||
for i in range(0, len(ret)):
|
for i in range(0, len(ret)):
|
||||||
ret[i] = ret[i].replace(" ", r"\ ")
|
ret[i] = ret[i].replace(" ", r"\ ")
|
||||||
return ret
|
return ret
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue