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

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong 2025-06-16 02:24:30 +05:30 committed by GitHub
parent 189442e9c4
commit 7f56443b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,7 +83,11 @@ open class NativeSyncApiImplBase(context: Context) {
continue 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) val name = c.getString(nameColumn)
// Date taken is milliseconds since epoch, Date added is seconds since epoch // Date taken is milliseconds since epoch, Date added is seconds since epoch
val createdAt = (c.getLong(dateTakenColumn).takeIf { it > 0 }?.div(1000)) val createdAt = (c.getLong(dateTakenColumn).takeIf { it > 0 }?.div(1000))