- buildManifestIndex now always scans the NAS directory on every full reconcile (removed the `totalCount <= 1` guard) so NAS Archive count updates accurately on every manual refresh, not just when the manifest is new/sparse - The dir > manifest check still switches to filename-based matching when the directory has more files than Kisani's manifest (uploaded by other tools) - checkStatusRow shows NAS connection status (orange dot + "NAS Connected" / red dot + "NAS Offline") below the timestamp line - BackupFilter now conforms to Equatable; BackupView re-reconciles immediately when the screenshot/video/RAW filter toggles change Co-Authored-By: Kutesir <kutesir@provoc.ug> Co-Authored-By: Sentry <sentry@provoc.ug>
30 lines
835 B
Swift
30 lines
835 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
|
|
}
|
|
|
|
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 newFilesOnly: Bool = true
|
|
}
|