|
|
|
|
@ -29,7 +29,6 @@ final public class AppSettings: MicroStorable { |
|
|
|
|
public var nationalCup: Bool |
|
|
|
|
public var dayDuration: Int? |
|
|
|
|
public var dayPeriod: DayPeriod |
|
|
|
|
public var weekdays: Set<Int> |
|
|
|
|
|
|
|
|
|
public func lastDataSourceDate() -> Date? { |
|
|
|
|
guard let lastDataSource else { return nil } |
|
|
|
|
@ -56,7 +55,6 @@ final public class AppSettings: MicroStorable { |
|
|
|
|
nationalCup = false |
|
|
|
|
dayDuration = nil |
|
|
|
|
dayPeriod = .all |
|
|
|
|
weekdays = Set() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public required init() { |
|
|
|
|
@ -72,7 +70,6 @@ final public class AppSettings: MicroStorable { |
|
|
|
|
nationalCup = false |
|
|
|
|
dayDuration = nil |
|
|
|
|
dayPeriod = .all |
|
|
|
|
weekdays = Set() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public required init(from decoder: Decoder) throws { |
|
|
|
|
@ -92,7 +89,6 @@ final public class AppSettings: MicroStorable { |
|
|
|
|
nationalCup = try container.decodeIfPresent(Bool.self, forKey: ._nationalCup) ?? false |
|
|
|
|
dayDuration = try container.decodeIfPresent(Int.self, forKey: ._dayDuration) |
|
|
|
|
dayPeriod = try container.decodeIfPresent(DayPeriod.self, forKey: ._dayPeriod) ?? .all |
|
|
|
|
weekdays = try container.decodeIfPresent(Set<Int>.self, forKey: ._weekdays) ?? Set() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
enum CodingKeys: String, CodingKey { |
|
|
|
|
@ -111,6 +107,5 @@ final public class AppSettings: MicroStorable { |
|
|
|
|
case _nationalCup = "nationalCup" |
|
|
|
|
case _dayDuration = "dayDuration" |
|
|
|
|
case _dayPeriod = "dayPeriod" |
|
|
|
|
case _weekdays = "weekdays" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|