last commi

This commit is contained in:
timothyafolami
2024-08-16 21:39:28 +01:00
parent 83ecbded4b
commit ddd0dda276
18 changed files with 429 additions and 12 deletions
+6 -6
View File
@@ -12,7 +12,7 @@ def get_data_description(data_path):
data_name = data_path.split('/')[-1].split('\\')[-1].split('.')[0]
# print(data_name)
# open the data.json file
with open('data/data.json') as f:
with open('uploads/data.json') as f:
data = json.load(f)
existing_data = data.keys()
if data_name in existing_data:
@@ -25,10 +25,10 @@ def get_data_thumbnail(data_path, timestamp = None):
# ensuring no // or / or extension is present
file_name = data_path.split('/')[-1].split('\\')[-1].split('.')[0]
# first check is to see if the file_name has a .png image in the thumbnail folder
if os.path.exists(f'data/thumbnails/{file_name}.png'):
return f'data/thumbnails/{file_name}.png'
if os.path.exists(f'uploads/thumbnails/{file_name}.png'):
return f'uploads/thumbnails/{file_name}.png'
# the second check is to see if we have a folder with this file_name
elif os.path.exists(f'data/{file_name}'):
elif os.path.exists(f'uploads/{file_name}'):
# so now we want to access the first timestamp
if timestamp:
first = timestamp[0]
@@ -40,8 +40,8 @@ def get_data_thumbnail(data_path, timestamp = None):
# bringing them together
image_file = f"{start}-{end}s.png"
# niw checkin if the file exists
if os.path.exists(f'data/{file_name}/{image_file}'):
return f'data/{file_name}/{image_file}'
if os.path.exists(f'uploads/{file_name}/{image_file}'):
return f'uploads/{file_name}/{image_file}'
def summarize_doc_search(data):
summary = {}