fix slash
This commit is contained in:
@@ -13,7 +13,7 @@ valid_images = [".jpg", ".png"]
|
||||
|
||||
|
||||
def get_image_list(folder_name):
|
||||
file_path = os.path.join(settings.MEDIA_ROOT + "/" + gallery_path, folder_name)
|
||||
file_path = os.path.join(settings.MEDIA_ROOT + gallery_path, folder_name)
|
||||
img_list = []
|
||||
|
||||
if os.path.exists(file_path):
|
||||
@@ -23,7 +23,7 @@ def get_image_list(folder_name):
|
||||
continue
|
||||
|
||||
thumb_path = os.path.join(
|
||||
settings.MEDIA_ROOT + "/" + gallery_thumb_path, folder_name
|
||||
settings.MEDIA_ROOT + gallery_thumb_path, folder_name
|
||||
)
|
||||
thumb_file_path = os.path.join(thumb_path, f"thumb_{img}")
|
||||
if os.path.exists(thumb_file_path):
|
||||
@@ -48,17 +48,15 @@ def get_image_list(folder_name):
|
||||
|
||||
|
||||
def get_folder_list():
|
||||
if os.path.exists(settings.MEDIA_ROOT + "/" + gallery_path):
|
||||
return next(os.walk(settings.MEDIA_ROOT + "/" + gallery_path))[1]
|
||||
if os.path.exists(settings.MEDIA_ROOT + gallery_path):
|
||||
return next(os.walk(settings.MEDIA_ROOT + gallery_path))[1]
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def create_thumbs(folder_path):
|
||||
file_path = os.path.join(settings.MEDIA_ROOT + "/" + gallery_path, folder_path)
|
||||
thumb_path = os.path.join(
|
||||
settings.MEDIA_ROOT + "/" + gallery_thumb_path, folder_path
|
||||
)
|
||||
file_path = os.path.join(settings.MEDIA_ROOT + gallery_path, folder_path)
|
||||
thumb_path = os.path.join(settings.MEDIA_ROOT + gallery_thumb_path, folder_path)
|
||||
|
||||
if os.path.exists(file_path):
|
||||
os.makedirs(thumb_path, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user