Update OTG transfer workflow

This commit is contained in:
2026-07-10 11:02:00 +08:00
parent 9d446b4bc3
commit 98dc810455
11 changed files with 1047 additions and 121 deletions

View File

@ -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)")