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