downloaders respect folders

This commit is contained in:
Ville Rantanen
2018-03-10 16:09:14 +02:00
parent 00008c9c7d
commit 4d43fc1a5b
2 changed files with 20 additions and 31 deletions

View File

@@ -12,12 +12,14 @@ def file_date_human(num):
).strftime(app.config['DATE_FORMAT'])
def file_stat(filename):
s = os.stat(filename)
def file_stat(path, filename):
full_path = os.path.join(path, filename)
s = os.stat(full_path)
return {
'size': file_size_MB(s.st_size),
'mtime': file_date_human(s.st_mtime),
'name': os.path.basename(filename)
'name': filename,
'url': path2url(filename)
}