WHAT TO BACK UP section: - Remove "New files only" / "Skip files already on NAS" toggle from Settings - Remove BackupFilter.newFilesOnly field — duplicate protection is always active (fileExists pre-check + hybrid filterIndex ensure NAS files are never re-uploaded) NOTIFICATIONS section: - Replace static decorative rows with real ToggleRow controls backed by ConnectionStore (notifyOnStart=false, notifyOnComplete=true, notifyOnErrors=true) - BackupEngine now gates notification calls behind these store flags NETWORK section: - WiFi row always shows ● On / ● Off indicator (was only shown when SSID known) - Shows "Trusted" / "Unknown" when SSID is available, "On" / "Off" otherwise Tests: - makeAssets: add missing isScreenRecording parameter - Rename test_backup_skipsExistingFiles_whenNewFilesOnly → _alwaysHardcoded, remove filter.newFilesOnly assignment - MockNASService: add downloadData, writeData, deleteFile to satisfy protocol Co-Authored-By: Kutesir <kutesir@provoc.ug> Co-Authored-By: Sentry <sentry@provoc.ug>
31 lines
879 B
Swift
31 lines
879 B
Swift
import Foundation
|
|
import Photos
|
|
|
|
struct PhotoAsset: Sendable {
|
|
let localIdentifier: String
|
|
let filename: String
|
|
let creationDate: Date?
|
|
let mediaType: PHAssetMediaType
|
|
let pixelWidth: Int
|
|
let pixelHeight: Int
|
|
let duration: TimeInterval
|
|
let isScreenshot: Bool
|
|
let isRAW: Bool
|
|
let isScreenRecording: Bool
|
|
}
|
|
|
|
protocol PhotoLibraryProtocol: AnyObject {
|
|
var authorizationStatus: PHAuthorizationStatus { get }
|
|
func requestAuthorization() async -> PHAuthorizationStatus
|
|
func fetchAssets(filter: BackupFilter) -> [PhotoAsset]
|
|
func exportAsset(_ asset: PhotoAsset) async throws -> URL
|
|
}
|
|
|
|
struct BackupFilter: Codable, Sendable, Equatable {
|
|
var includePhotos: Bool = true
|
|
var includeVideos: Bool = true
|
|
var includeScreenshots: Bool = false
|
|
var includeRAW: Bool = false
|
|
var includeScreenRecordings: Bool = false
|
|
}
|