[lib] Introduce translateMediaToClientDBMediaInfos
Summary:
We previously had translateMediaToClientDBMediaInfo which gave us one ClientDBMediaInfo for each Media... but now the relationship between Media and "upload" is no longer 1:1.
translateMediaToClientDBMediaInfos replaces the existing function and returns an array with all of the ClientDBMediaInfos for a media message. By using this function in translateRawMessageInfoToClientDBMessageInfo we ensure that both the video and thumbnail are persisted in the media table of the SQLite "clientDB" database.
Test Plan:
Ensured that both video and thumbnail are stored in SQLite media table for video messages:
Also set breakpoints throughout to make sure values at different points were as expected.
Reviewers: tomek, marcin, abosh, rohan, ginsu
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D5298