fix(mobile): asset type mismatch from android sync (#19201)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
pull/19203/head
shenlong 2025-06-16 02:24:30 +07:00 committed by GitHub
parent 189442e9c4
commit 7f56443b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

@ -83,7 +83,11 @@ open class NativeSyncApiImplBase(context: Context) {
continue
}
val mediaType = c.getInt(mediaTypeColumn)
val mediaType = when (c.getInt(mediaTypeColumn)) {
MediaStore.Files.FileColumns.MEDIA_TYPE_IMAGE -> 1
MediaStore.Files.FileColumns.MEDIA_TYPE_VIDEO -> 2
else -> 0
}
val name = c.getString(nameColumn)
// Date taken is milliseconds since epoch, Date added is seconds since epoch
val createdAt = (c.getLong(dateTakenColumn).takeIf { it > 0 }?.div(1000))