Fix bug where video dimensions aren't always correct in chat view.

This commit is contained in:
Greyson Parrelli
2026-02-23 15:33:21 -05:00
committed by Cody Henthorne
parent d28fc98cfd
commit 08509f6693
6 changed files with 85 additions and 12 deletions

View File

@@ -2099,12 +2099,15 @@ class AttachmentTable(
val contentValues = contentValuesOf(
DATA_SIZE to newDataFileInfo.length,
CONTENT_TYPE to mediaStream.mimeType,
WIDTH to mediaStream.width,
HEIGHT to mediaStream.height,
DATA_FILE to newDataFileInfo.file.absolutePath,
DATA_RANDOM to newDataFileInfo.random
)
if (mediaStream.width > 0 && mediaStream.height > 0) {
contentValues.put(WIDTH, mediaStream.width)
contentValues.put(HEIGHT, mediaStream.height)
}
val updateCount = db.update(TABLE_NAME)
.values(contentValues)
.where("$ID = ? OR $DATA_FILE = ?", attachmentId.id, existingDataFileInfo.file.absolutePath)