}
static var shouldSaveMp4: Bool {
- outputFormats.shouldSaveMp4()
+ outputFormats.shouldSaveMp4() || (shouldUseBackend && shouldUploadMp4)
}
static var shouldSaveGif: Bool {
- outputFormats.shouldSaveGif()
+ outputFormats.shouldSaveGif() || (shouldUseBackend && shouldUploadGif)
}
+ static var shouldUploadGif: Bool {
+ backendFormat.shouldSaveGif()
+ }
- static var shouldSendNotifications: Bool {
- get {
- UserDefaults.standard.bool(forKey: "shouldSendNotifications")
- }
- set {
- UserDefaults.standard.setValue(newValue, forKey: "shouldSendNotifications")
+ static var shouldUploadMp4: Bool {
+ backendFormat.shouldSaveMp4()
+ }
+
+ static var shouldUseBackend: Bool {
+ backend != nil
+ }
+
+ static var backend: URL? {
+ if let url = UserDefaults.standard.string(forKey: "backendUrl") {
+ return URL(string: url)
}
+ return nil
+ }
+
+ static var backendFormat: OutputFormatSetting {
+ OutputFormatSetting(rawValue: UserDefaults.standard.integer(forKey: "backendFormat")) ?? .all
+ }
+
+ static var shouldKeepLocalFiles: Bool {
+ UserDefaults.standard.bool(forKey: "keepFiles")
}
}