- NASTransferProtocol: add deleteFile(at:) to enable server-side deletion
- SFTPService: implement deleteFile using Citadel sftp.remove(at:)
- SMBService: implement deleteFile using SMBClient deleteFile(path:)
- SyncView FREE UP SPACE: two new cards —
• "Clean up screenshots" — shows count of phone screenshots already
backed up to NAS, opens review sheet for bulk PHPhotoLibrary deletion
• "NAS screenshot quarantine" — identifies NAS files that match phone
screenshots, offers to move them into a Screenshots/ subfolder via
download → writeData → deleteFile per file
Co-Authored-By: Kutesir <kutesir@provoc.ug>
Co-Authored-By: Sentry <sentry@provoc.ug>
30 lines
945 B
Swift
30 lines
945 B
Swift
import Foundation
|
|
|
|
struct NASItem: Identifiable {
|
|
let id = UUID()
|
|
let name: String
|
|
let path: String
|
|
let isDirectory: Bool
|
|
let size: Int64
|
|
let modifiedDate: Date?
|
|
}
|
|
|
|
protocol NASTransferProtocol: AnyObject {
|
|
var isConnected: Bool { get }
|
|
|
|
func connect(to host: String, port: Int, username: String, password: String) async throws
|
|
func disconnect()
|
|
func listShares() async throws -> [String]
|
|
func listDirectory(at path: String) async throws -> [NASItem]
|
|
func createDirectory(at path: String) async throws
|
|
func fileExists(at remotePath: String) async throws -> Bool
|
|
func upload(
|
|
localURL: URL,
|
|
remotePath: String,
|
|
progress: @escaping (Int64, Int64) -> Void
|
|
) async throws
|
|
func downloadData(at remotePath: String) async throws -> Data
|
|
func writeData(_ data: Data, to remotePath: String) async throws
|
|
func deleteFile(at remotePath: String) async throws
|
|
}
|