Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ const SearchResults = ({ results, onFrameSelect, query }) => {
if (!results) return null;

const formatTimestamp = (seconds) => {
const mins = Math.floor(seconds / 60);
const secs = Math.floor(seconds % 60);
// Go back 10 seconds from the search result timestamp
const adjustedSeconds = Math.max(0, seconds - 10);
const mins = Math.floor(adjustedSeconds / 60);
const secs = Math.floor(adjustedSeconds % 60);
return `${mins}:${secs.toString().padStart(2, '0')}`;
};

Expand All @@ -16,7 +18,12 @@ const SearchResults = ({ results, onFrameSelect, query }) => {
};

const handleFrameClick = (result) => {
onFrameSelect(result);
// Create a modified result with timestamp adjusted back by 10 seconds
const adjustedResult = {
...result,
timestamp: Math.max(0, result.timestamp - 10)
};
onFrameSelect(adjustedResult);
};

if (results.results.length === 0) {
Expand Down
Loading