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