mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 19:01:42 +00:00
[file] Increase view count when size exceed limits in viewing shared file
This commit is contained in:
@@ -661,17 +661,17 @@ def view_shared_file(request, token):
|
|||||||
elif filetype == PDF:
|
elif filetype == PDF:
|
||||||
handle_pdf(inner_path, obj_id, fileext, ret_dict)
|
handle_pdf(inner_path, obj_id, fileext, ret_dict)
|
||||||
|
|
||||||
# Increase file shared link view_cnt, this operation should be atomic
|
# Increase file shared link view_cnt, this operation should be atomic
|
||||||
fileshare.view_cnt = F('view_cnt') + 1
|
fileshare.view_cnt = F('view_cnt') + 1
|
||||||
fileshare.save()
|
fileshare.save()
|
||||||
|
|
||||||
# send statistic messages
|
# send statistic messages
|
||||||
if ret_dict['filetype'] != 'Unknown':
|
if ret_dict['filetype'] != 'Unknown':
|
||||||
try:
|
try:
|
||||||
send_message('seahub.stats', 'file-view\t%s\t%s\t%s\t%s' % \
|
send_message('seahub.stats', 'file-view\t%s\t%s\t%s\t%s' % \
|
||||||
(repo.id, shared_by, obj_id, file_size))
|
(repo.id, shared_by, obj_id, file_size))
|
||||||
except SearpcError, e:
|
except SearpcError, e:
|
||||||
logger.error('Error when sending file-view message: %s' % str(e))
|
logger.error('Error when sending file-view message: %s' % str(e))
|
||||||
|
|
||||||
accessible_repos = get_unencry_rw_repos_by_user(request)
|
accessible_repos = get_unencry_rw_repos_by_user(request)
|
||||||
save_to_link = reverse('save_shared_link') + '?t=' + token
|
save_to_link = reverse('save_shared_link') + '?t=' + token
|
||||||
|
Reference in New Issue
Block a user