Files
Kisani/Core/Models/BackupResult.swift
Robin Kutesa b96711c535 Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00

42 lines
1.1 KiB
Swift

import Foundation
struct BackupResult {
let uploadedCount: Int
let skippedCount: Int
let failedCount: Int
let duration: TimeInterval
let totalBytes: Int64
let date: Date
var hasErrors: Bool { failedCount > 0 }
static func empty(date: Date = Date()) -> BackupResult {
BackupResult(uploadedCount: 0, skippedCount: 0, failedCount: 0,
duration: 0, totalBytes: 0, date: date)
}
}
struct BackupHistoryEntry: Codable, Identifiable {
let id: UUID
let date: Date
let uploadedCount: Int
let skippedCount: Int
let failedCount: Int
let durationSeconds: Double
let totalBytes: Int64
let nasHost: String
let triggeredByLAN: Bool
init(result: BackupResult, nasHost: String, triggeredByLAN: Bool) {
self.id = UUID()
self.date = result.date
self.uploadedCount = result.uploadedCount
self.skippedCount = result.skippedCount
self.failedCount = result.failedCount
self.durationSeconds = result.duration
self.totalBytes = result.totalBytes
self.nasHost = nasHost
self.triggeredByLAN = triggeredByLAN
}
}