This commit is contained in:
2026-03-07 11:37:37 -05:00
parent aa5ad8327e
commit 32f63fe43b
32 changed files with 2470 additions and 328 deletions

View File

@@ -0,0 +1,40 @@
from pprint import pprint
import pickle
import os
with open('/home/thebears/Web/Nuggets/SearchInterface/SearchBackend/crap.p','rb') as ff:
cc = pickle.load(ff)
tstamp, folder_scores = cc[1],cc[0]
for i in range(100):
target_tstamp = tstamp + i
matching_file = None
next_file = None
for video_file in folder_scores['videos']:
start_time = video_file['start_time']
end_time = video_file['end_time']
if target_tstamp > start_time and target_tstamp < end_time:
matching_file = video_file
if start_time > target_tstamp and next_file is None:
next_file = video_file
if matching_file is not None:
fname = matching_file['file_name']
offset = target_tstamp - matching_file['start_time']
else:
fname = 'None Found'
offset = -1
if next_file is not None:
fname = next_file['file_name']
offset = 0
web_name = 'media/'+os.path.basename(fname)
ret_val = dict(full_path = fname, path=web_name, timeoffset = offset)
pprint(ret_val)
pprint('-----------------------------------')