feat: ConfigRepository 添加 currentSourceId 存储

This commit is contained in:
xiaji
2026-06-09 19:53:34 +08:00
parent b199b12a83
commit f79f0c7a16

View File

@@ -30,6 +30,14 @@ class ConfigRepository(context: Context) {
saveConfig(SiteConfig.default()) saveConfig(SiteConfig.default())
} }
fun getCurrentSourceId(): String {
return prefs.getString("current_source_id", "xb6v") ?: "xb6v"
}
fun setCurrentSourceId(id: String) {
prefs.edit().putString("current_source_id", id).apply()
}
fun getPresets(): List<SitePreset> = SitePreset.PRESETS fun getPresets(): List<SitePreset> = SitePreset.PRESETS
fun applyPreset(preset: SitePreset) { fun applyPreset(preset: SitePreset) {