1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

Add previewd file extention and type to cache. And clean code.

This commit is contained in:
xiez
2012-07-19 17:18:40 +08:00
parent 32f65f5ae9
commit 5e64e4b503
3 changed files with 28 additions and 11 deletions

View File

@@ -845,7 +845,7 @@ def repo_view_file(request, repo_id):
zipped = gen_path_link(path, repo.name)
# determin whether file can preview on web
can_preview, filetype = valid_previewed_file(filename)
filetype = valid_previewed_file(filename)
# raw path
tmp_str = '%s/access?repo_id=%s&id=%s&filename=%s&op=%s&t=%s&u=%s'
@@ -880,7 +880,6 @@ def repo_view_file(request, repo_id):
'view_history': view_history,
'current_commit': current_commit,
'token': token,
'can_preview': can_preview,
'filetype': filetype,
'raw_path': raw_path,
'fileshare': fileshare,
@@ -1895,7 +1894,7 @@ def view_shared_file(request, token):
access_token = gen_token()
seafserv_rpc.web_save_access_token(access_token, obj_id)
can_preview, filetype = valid_previewed_file(filename)
filetype = valid_previewed_file(filename)
# Raw path
tmp_str = '%s/access?repo_id=%s&id=%s&filename=%s&op=%s&t=%s&u=%s'
@@ -1917,7 +1916,6 @@ def view_shared_file(request, token):
'file_name': filename,
'shared_token': token,
'access_token': access_token,
'can_preview': can_preview,
'filetype': filetype,
'raw_path': raw_path,
'username': username,