diff --git a/lib/state/setting_state.dart b/lib/state/setting_state.dart index 9feb47b..18df577 100644 --- a/lib/state/setting_state.dart +++ b/lib/state/setting_state.dart @@ -558,6 +558,8 @@ class SettingState extends ChangeNotifier { .getBool(defaultValue: false); final deleteAfterPlayed = await KeyValueStorage(deleteAfterPlayedKey) .getBool(defaultValue: false); + final openPlaylistDefault = await _openPlaylistDefaultStorage.getBool(defaultValue: false); + final openAllPodcastDefault = await _openAllPodcastDefaultStorage.getBool(defaultValue: false); return SettingsBackup( theme: theme, @@ -591,7 +593,9 @@ class SettingState extends ChangeNotifier { speedList: speedList, hidePodcastDiscovery: hidePodcastDiscovery, markListenedAfterSkip: markListenedAfterSKip, - deleteAfterPlayed: deleteAfterPlayed); + deleteAfterPlayed: deleteAfterPlayed, + openPlaylistDefault: openPlaylistDefault, + openAllPodcastDefault: openAllPodcastDefault); } Future restore(SettingsBackup backup) async { @@ -631,6 +635,8 @@ class SettingState extends ChangeNotifier { .saveBool(backup.markListenedAfterSkip); await KeyValueStorage(deleteAfterPlayedKey) .saveBool(backup.deleteAfterPlayed); + await _openPlaylistDefaultStorage.saveBool(backup.openPlaylistDefault); + await _openAllPodcastDefaultStorage.saveBool(backup.openAllPodcastDefault); if (backup.locale == '') { await _localeStorage.saveStringList([]); diff --git a/lib/type/settings_backup.dart b/lib/type/settings_backup.dart index 1ba4949..19c336f 100644 --- a/lib/type/settings_backup.dart +++ b/lib/type/settings_backup.dart @@ -31,6 +31,8 @@ class SettingsBackup { final bool hidePodcastDiscovery; final bool markListenedAfterSkip; final bool deleteAfterPlayed; + final bool openPlaylistDefault; + final bool openAllPodcastDefault; SettingsBackup( {this.theme, @@ -64,7 +66,9 @@ class SettingsBackup { this.speedList, this.hidePodcastDiscovery, this.markListenedAfterSkip, - this.deleteAfterPlayed}); + this.deleteAfterPlayed, + this.openPlaylistDefault, + this.openAllPodcastDefault}); Map toJson() { return { @@ -98,7 +102,9 @@ class SettingsBackup { 'speedList': speedList, 'hidePodcastDiscovery': hidePodcastDiscovery, 'markListenedAfterSkip': markListenedAfterSkip, - 'deleteAfterPlayed': deleteAfterPlayed + 'deleteAfterPlayed': deleteAfterPlayed, + 'openPlaylistDefault': openPlaylistDefault, + 'openAllPodcastDefault': openAllPodcastDefault }; } @@ -136,6 +142,8 @@ class SettingsBackup { speedList: speedList, hidePodcastDiscovery: json['hidePodcastDiscovery'] as bool, markListenedAfterSkip: json['markListenedAfterSkip'] as bool, - deleteAfterPlayed: json['deleteAfterPlayed'] as bool); + deleteAfterPlayed: json['deleteAfterPlayed'] as bool, + openPlaylistDefault: json['openPlaylistDefaullt'] as bool, + openAllPodcastDefault: json['openAllPodcastDefault'] as bool); } }