mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-18 00:00:00 +00:00
[web-api] Use p and size as args
This commit is contained in:
@@ -36,7 +36,7 @@ urlpatterns = patterns('',
|
||||
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/dir/sub_repo/$', DirSubRepoView.as_view()),
|
||||
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/dir/share/$', DirShareView.as_view()),
|
||||
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/dir/download/$', DirDownloadView.as_view()),
|
||||
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/thumbnail/(?P<path>.+)$', ThumbnailView.as_view(), name='api2-thumbnail'),
|
||||
url(r'^repos/(?P<repo_id>[-0-9-a-f]{36})/thumbnail/$', ThumbnailView.as_view(), name='api2-thumbnail'),
|
||||
url(r'^starredfiles/', StarredFileView.as_view(), name='starredfiles'),
|
||||
url(r'^shared-repos/$', SharedRepos.as_view(), name='sharedrepos'),
|
||||
url(r'^shared-repos/(?P<repo_id>[-0-9-a-f]{36})/$', SharedRepo.as_view(), name='sharedrepo'),
|
||||
|
@@ -3474,7 +3474,7 @@ class ThumbnailView(APIView):
|
||||
permission_classes = (IsAuthenticated,)
|
||||
throttle_classes = (UserRateThrottle, )
|
||||
|
||||
def get(self, request, repo_id, path):
|
||||
def get(self, request, repo_id):
|
||||
|
||||
repo = get_repo(repo_id)
|
||||
if not repo:
|
||||
@@ -3489,10 +3489,14 @@ class ThumbnailView(APIView):
|
||||
return api_error(status.HTTP_403_FORBIDDEN,
|
||||
'Thumbnail function is not enabled.')
|
||||
|
||||
size = request.GET.get('s', None)
|
||||
size = request.GET.get('size', None)
|
||||
path = request.GET.get('p', None)
|
||||
if size is None:
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, 'Size is missing.')
|
||||
|
||||
if path is None:
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, 'Path is missing.')
|
||||
|
||||
obj_id = get_file_id_by_path(repo_id, path)
|
||||
|
||||
if obj_id is None:
|
||||
|
Reference in New Issue
Block a user