From 6deb4a71ff2d6e1c6890d9e138a4abfaa14a7425 Mon Sep 17 00:00:00 2001 From: Lukas Pistrol Date: Wed, 15 Nov 2023 00:42:09 +0100 Subject: [PATCH] Merge branch 'fix/#11-missing-decoding-key' into 'main': commit df0e753f32f07b87066dd5efcfdf5c41d09953a6 Author: Lukas Pistrol Date: Wed Nov 15 00:41:10 2023 +0100 make 'ExcludedVolumeUUIDs' optional --- TimeMachineStatus.xcodeproj/project.pbxproj | 16 ++++++++-------- .../Model/Preferences/Preferences.swift | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/TimeMachineStatus.xcodeproj/project.pbxproj b/TimeMachineStatus.xcodeproj/project.pbxproj index cd47e42..27a3732 100644 --- a/TimeMachineStatus.xcodeproj/project.pbxproj +++ b/TimeMachineStatus.xcodeproj/project.pbxproj @@ -525,7 +525,7 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatusHelper/TimeMachineStatusHelper.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; GENERATE_INFOPLIST_FILE = YES; @@ -538,7 +538,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.2; + MARKETING_VERSION = 0.0.3; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatusHelper; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -554,7 +554,7 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatusHelper/TimeMachineStatusHelper.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; GENERATE_INFOPLIST_FILE = YES; @@ -567,7 +567,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.2; + MARKETING_VERSION = 0.0.3; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatusHelper; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -702,7 +702,7 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatus/TimeMachineStatus.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_ASSET_PATHS = "\"TimeMachineStatus/Preview Content\""; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; @@ -719,7 +719,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.2; + MARKETING_VERSION = 0.0.3; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatus; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -736,7 +736,7 @@ CODE_SIGN_ENTITLEMENTS = TimeMachineStatus/TimeMachineStatus.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 3; DEVELOPMENT_ASSET_PATHS = "\"TimeMachineStatus/Preview Content\""; DEVELOPMENT_TEAM = ""; ENABLE_HARDENED_RUNTIME = NO; @@ -753,7 +753,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 0.0.2; + MARKETING_VERSION = 0.0.3; PRODUCT_BUNDLE_IDENTIFIER = com.lukaspistrol.TimeMachineStatus; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/TimeMachineStatus/Model/Preferences/Preferences.swift b/TimeMachineStatus/Model/Preferences/Preferences.swift index 76e59b3..941172e 100644 --- a/TimeMachineStatus/Model/Preferences/Preferences.swift +++ b/TimeMachineStatus/Model/Preferences/Preferences.swift @@ -27,22 +27,22 @@ struct Preferences: Decodable { let autoBackup: Bool let autoBackupInterval: Int? - let excludedVolumeUUIDs: [UUID] + let excludedVolumeUUIDs: [UUID]? let preferencesVersion: Int let requiresACPower: Bool let lastConfigurationTraceDate: Date let lastDestinationID: UUID? let localizedDiskImageVolumeName: String let skipPaths: [String]? - let destinations: [Destination] + let destinations: [Destination]? var latestBackupDate: Date? { - destinations.map(\.snapshotDates).flatMap { $0 }.max() + destinations?.map(\.snapshotDates).flatMap { $0 }.max() } var latestBackupVolume: String? { guard let lastDestinationID else { return nil } - return destinations + return destinations? .first { $0.destinationID == lastDestinationID }? .lastKnownVolumeName }