From 87337f31a5acc7d3ae50f55bce93512d5ab41fea Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Wed, 28 Feb 2024 18:35:03 +0100 Subject: [PATCH] Updated importer and exporter to include new defaults --- .../Exporters/HistorySettingsGroupExporter.swift | 6 +++++- .../Importers/HistorySettingsGroupImporter.swift | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Model/Import Export Settings/Exporters/HistorySettingsGroupExporter.swift b/Model/Import Export Settings/Exporters/HistorySettingsGroupExporter.swift index 08add25a..9f340d48 100644 --- a/Model/Import Export Settings/Exporters/HistorySettingsGroupExporter.swift +++ b/Model/Import Export Settings/Exporters/HistorySettingsGroupExporter.swift @@ -15,7 +15,11 @@ final class HistorySettingsGroupExporter: SettingsGroupExporter { "watchedVideoStyle": Defaults[.watchedVideoStyle].rawValue, "watchedVideoBadgeColor": Defaults[.watchedVideoBadgeColor].rawValue, - "showToggleWatchedStatusButton": Defaults[.showToggleWatchedStatusButton] + "showToggleWatchedStatusButton": Defaults[.showToggleWatchedStatusButton], + + "showRecents": Defaults[.showRecents], + "limitRecents": Defaults[.limitRecents], + "limitRecentsAmount": Defaults[.limitRecentsAmount] ] } } diff --git a/Model/Import Export Settings/Importers/HistorySettingsGroupImporter.swift b/Model/Import Export Settings/Importers/HistorySettingsGroupImporter.swift index 24385cd8..2fa9e19a 100644 --- a/Model/Import Export Settings/Importers/HistorySettingsGroupImporter.swift +++ b/Model/Import Export Settings/Importers/HistorySettingsGroupImporter.swift @@ -50,5 +50,17 @@ struct HistorySettingsGroupImporter { if let showToggleWatchedStatusButton = json["showToggleWatchedStatusButton"].bool { Defaults[.showToggleWatchedStatusButton] = showToggleWatchedStatusButton } + + if let showRecents = json["showRecents"].bool { + Defaults[.showRecents] = showRecents + } + + if let limitRecents = json["limitRecents"].bool { + Defaults[.limitRecents] = limitRecents + } + + if let limitRecentsAmount = json["limitRecentsAmount"].int { + Defaults[.limitRecentsAmount] = limitRecentsAmount + } } }