|
@ -63,7 +63,6 @@ def get_all_content(type): |
|
|
|
|
|
|
|
|
def get_content_by_title(title, pre_type): |
|
|
def get_content_by_title(title, pre_type): |
|
|
type = pre_type[:-1] |
|
|
type = pre_type[:-1] |
|
|
print(type) |
|
|
|
|
|
entries = client.entries({'query': title, 'limit': 5}) |
|
|
entries = client.entries({'query': title, 'limit': 5}) |
|
|
exact_matches = [entry for entry in entries if getattr(entry, f'title_of_{type}') == title] |
|
|
exact_matches = [entry for entry in entries if getattr(entry, f'title_of_{type}') == title] |
|
|
content_list = process_content(exact_matches, type) |
|
|
content_list = process_content(exact_matches, type) |
|
@ -115,7 +114,6 @@ def process_content(entries, type): |
|
|
'exh_type': exh_type |
|
|
'exh_type': exh_type |
|
|
} |
|
|
} |
|
|
content_list.append(content) |
|
|
content_list.append(content) |
|
|
|
|
|
|
|
|
# Sort the content list by the 'title' key alphabetically |
|
|
# Sort the content list by the 'title' key alphabetically |
|
|
content_list.sort(key=lambda x: x['title'].lower()) |
|
|
content_list.sort(key=lambda x: x['title'].lower()) |
|
|
|
|
|
|
|
@ -136,7 +134,6 @@ def get_support_images(): |
|
|
# Check if the file is an image (by extension) |
|
|
# Check if the file is an image (by extension) |
|
|
if os.path.splitext(filename)[1].lower() in valid_extensions: |
|
|
if os.path.splitext(filename)[1].lower() in valid_extensions: |
|
|
image_files.append(filename) |
|
|
image_files.append(filename) |
|
|
print(filename) |
|
|
|
|
|
|
|
|
|
|
|
return image_files |
|
|
return image_files |
|
|
|
|
|
|
|
|