Update OTG transfer workflow
This commit is contained in:
@ -15,8 +15,8 @@ final class SonyRemoteCaptureService {
|
||||
|
||||
private var albumID: Int?
|
||||
private let photoRepository: PhotoRepositoryProtocol
|
||||
/// 下载成功时回调文件名,供 ConnectionManager 转发给 ViewModel。
|
||||
var onShotSaved: ((String) -> Void)?
|
||||
/// 下载成功时回调本地照片记录,供 ConnectionManager 转发给 ViewModel。
|
||||
var onShotSaved: ((TravelAlbumOTGPhotoRecord) -> Void)?
|
||||
|
||||
private var pollTimer: Timer?
|
||||
private var propertyCheckTask: Task<Void, Never>?
|
||||
@ -298,7 +298,7 @@ final class SonyRemoteCaptureService {
|
||||
filename: downloaded.filename,
|
||||
albumID: albumID
|
||||
)
|
||||
try photoRepository.addPhoto(
|
||||
let record = try photoRepository.addPhoto(
|
||||
albumID: albumID,
|
||||
localPath: fileURL.path,
|
||||
createdAt: Date()
|
||||
@ -307,7 +307,7 @@ final class SonyRemoteCaptureService {
|
||||
.sony,
|
||||
"Live shot saved (#\(savedShotCount + 1)): \(downloaded.filename), bytes=\(downloaded.data.count), path=\(fileURL.lastPathComponent)"
|
||||
)
|
||||
onShotSaved?(downloaded.filename)
|
||||
onShotSaved?(record)
|
||||
return true
|
||||
} catch {
|
||||
OTGLog.error(.sony, "\(reason): save failed: \(error.localizedDescription)")
|
||||
|
||||
Reference in New Issue
Block a user