Use preview if outline is not available
This commit is contained in:
@@ -38,6 +38,9 @@ class Handler(BaseHTTPRequestHandler):
|
|||||||
img_path = get_preview_image(track, config)
|
img_path = get_preview_image(track, config)
|
||||||
elif (img_type == "outline"):
|
elif (img_type == "outline"):
|
||||||
img_path = get_outline_image(track, config)
|
img_path = get_outline_image(track, config)
|
||||||
|
if img_path == "":
|
||||||
|
|
||||||
|
img_path = get_preview_image(track, config)
|
||||||
else:
|
else:
|
||||||
self.send_error(404)
|
self.send_error(404)
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -24,13 +24,11 @@ def get_path_image(image_name, track: str, config: str = ""):
|
|||||||
if image_name in lower and lower.endswith(".png"):
|
if image_name in lower and lower.endswith(".png"):
|
||||||
return os.path.join(img_path, name)
|
return os.path.join(img_path, name)
|
||||||
|
|
||||||
|
img_path = os.path.join(TRACKS_FOLDER, track, config)
|
||||||
img_path = os.path.join(TRACKS_FOLDER, track, image_name)
|
|
||||||
for name in os.listdir(img_path):
|
for name in os.listdir(img_path):
|
||||||
lower = name.lower()
|
lower = name.lower()
|
||||||
if image_name in lower and lower.endswith(".png"):
|
if image_name in lower and lower.endswith(".png"):
|
||||||
return os.path.join(img_path, name)
|
return os.path.join(img_path, name)
|
||||||
|
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user