1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 02:10:24 +00:00

[thumbnail] Improve thumbnail

Correct thumbnail src url & change thumbnail root dir to 'seahub-data'
This commit is contained in:
lian
2015-02-12 11:04:41 +08:00
parent 739b32b02c
commit cbffdc7fb6
2 changed files with 6 additions and 2 deletions

View File

@@ -412,7 +412,11 @@ SEAFILE_VERSION = '3.0.0'
ENABLE_THUMBNAIL = True
# Absolute filesystem path to the directory that will hold thumbnail files.
THUMBNAIL_ROOT = os.path.join(PROJECT_ROOT, 'seahub/thumbnail/thumb')
SEAHUB_DATA_ROOT = os.path.join(PROJECT_ROOT, '../../seahub-data')
if os.path.exists(SEAHUB_DATA_ROOT):
THUMBNAIL_ROOT = os.path.join(SEAHUB_DATA_ROOT, 'thumbnail')
else:
THUMBNAIL_ROOT = os.path.join(PROJECT_ROOT, 'seahub/thumbnail/thumb')
THUMBNAIL_EXTENSION = 'png'
THUMBNAIL_DEFAULT_SIZE = '24'

View File

@@ -2,4 +2,4 @@ import posixpath
from seahub.utils import get_service_url
def get_thumbnail_src(repo_id, obj_id, size):
return posixpath.join(get_service_url(), "thumbnail", repo_id,
obj_id, size)
obj_id, size) + "/"