jasonjmcghee / rem

An open source approach to locally record and enable searching everything you view on your Mac.
https://rem.ing
MIT License
2.18k stars 60 forks source link

Convert frameId to chunksFramesIndex before passing from search to TL and fix search results missing frames with offset of 29 #92

Closed cparish312 closed 1 month ago

cparish312 commented 1 month ago

In #90 a bug was introduced since Search is based off of indexes with the frames table, while the timeline now works on indexes within the chunksFramesView. Therefore, when a search thumbnail is clicked the frames index is passed, but the timeline treats it as a chunksFramesIndex.

This was fixed by converting the frameId to a chunksFramesIndex before passing to the showTimelineView() func. A solution converting the Search functionality to using chunksFramesIndexes was explored, but since all Database retrievals within Search already merge on the chunks table it was not necessary. As well, converting to chunksFramesIndexes would have inhibited the use of pagination.

I noticed that within search results, frames with an offset of 29 did not have thumbnails. I fixed this bug by rounding within the offset calculation while mapping retrieved thumbnails.