mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
upload asset button
This commit is contained in:
parent
8128876472
commit
b59c4ddc9c
6 changed files with 179 additions and 0 deletions
|
|
@ -363,6 +363,7 @@ protocol NativeSyncApi {
|
|||
func getAssetsCountSince(albumId: String, timestamp: Int64) throws -> Int64
|
||||
func getAssetsForAlbum(albumId: String, updatedTimeCond: Int64?) throws -> [PlatformAsset]
|
||||
func hashAssets(assetIds: [String], allowNetworkAccess: Bool, completion: @escaping (Result<[HashResult], Error>) -> Void)
|
||||
func uploadAsset(completion: @escaping (Result<Bool, Error>) -> Void)
|
||||
func cancelHashing() throws
|
||||
}
|
||||
|
||||
|
|
@ -519,6 +520,21 @@ class NativeSyncApiSetup {
|
|||
} else {
|
||||
hashAssetsChannel.setMessageHandler(nil)
|
||||
}
|
||||
let uploadAssetChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.immich_mobile.NativeSyncApi.uploadAsset\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec)
|
||||
if let api = api {
|
||||
uploadAssetChannel.setMessageHandler { _, reply in
|
||||
api.uploadAsset { result in
|
||||
switch result {
|
||||
case .success(let res):
|
||||
reply(wrapResult(res))
|
||||
case .failure(let error):
|
||||
reply(wrapError(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uploadAssetChannel.setMessageHandler(nil)
|
||||
}
|
||||
let cancelHashingChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.immich_mobile.NativeSyncApi.cancelHashing\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec)
|
||||
if let api = api {
|
||||
cancelHashingChannel.setMessageHandler { _, reply in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue