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:
@@ -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'
|
||||
|
@@ -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) + "/"
|
||||
|
Reference in New Issue
Block a user