fix: sync is_favorite from native (#20412)

* feat: sync is_favorite from native

* handle favorite during upload

* Update mobile/ios/Runner/Sync/MessagesImpl.swift

Co-authored-by: Alex <alex.tran1502@gmail.com>

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
shenlong
2025-07-30 08:27:04 +05:30
committed by GitHub
parent 07ed060c32
commit 268b411a6f
9 changed files with 30 additions and 8 deletions

View File

@@ -139,6 +139,7 @@ struct PlatformAsset: Hashable {
var height: Int64? = nil
var durationInSeconds: Int64
var orientation: Int64
var isFavorite: Bool
// swift-format-ignore: AlwaysUseLowerCamelCase
@@ -152,6 +153,7 @@ struct PlatformAsset: Hashable {
let height: Int64? = nilOrValue(pigeonVar_list[6])
let durationInSeconds = pigeonVar_list[7] as! Int64
let orientation = pigeonVar_list[8] as! Int64
let isFavorite = pigeonVar_list[9] as! Bool
return PlatformAsset(
id: id,
@@ -162,7 +164,8 @@ struct PlatformAsset: Hashable {
width: width,
height: height,
durationInSeconds: durationInSeconds,
orientation: orientation
orientation: orientation,
isFavorite: isFavorite
)
}
func toList() -> [Any?] {
@@ -176,6 +179,7 @@ struct PlatformAsset: Hashable {
height,
durationInSeconds,
orientation,
isFavorite,
]
}
static func == (lhs: PlatformAsset, rhs: PlatformAsset) -> Bool {

View File

@@ -28,7 +28,8 @@ extension PHAsset {
width: Int64(pixelWidth),
height: Int64(pixelHeight),
durationInSeconds: Int64(duration),
orientation: 0
orientation: 0,
isFavorite: isFavorite
)
}
}