Option to disable automatic plugin updates

This commit is contained in:
Blatzar 2022-08-11 19:12:27 +02:00
parent 0ca6c2a6e6
commit 132dda6f4c
3 changed files with 16 additions and 4 deletions

View file

@ -424,8 +424,14 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
app.initClient(this) app.initClient(this)
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
if (settingsManager.getBoolean(getString(R.string.auto_update_plugins_key), true)) {
PluginManager.updateAllOnlinePluginsAndLoadThem(this) PluginManager.updateAllOnlinePluginsAndLoadThem(this)
} else {
PluginManager.loadAllOnlinePlugins(this)
}
PluginManager.loadAllLocalPlugins(this) PluginManager.loadAllLocalPlugins(this)
// ioSafe { // ioSafe {
@ -455,7 +461,6 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
SearchResultBuilder.updateCache(this) SearchResultBuilder.updateCache(this)
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
initAll() initAll()
apis = allProviders apis = allProviders

View file

@ -5,6 +5,7 @@
<string name="locale_key" translatable="false">app_locale</string> <string name="locale_key" translatable="false">app_locale</string>
<string name="search_types_list_key" translatable="false">search_type_list</string> <string name="search_types_list_key" translatable="false">search_type_list</string>
<string name="auto_update_key" translatable="false">auto_update</string> <string name="auto_update_key" translatable="false">auto_update</string>
<string name="auto_update_plugins_key" translatable="false">auto_update_plugins</string>
<string name="skip_update_key" translatable="false">skip_update_key</string> <string name="skip_update_key" translatable="false">skip_update_key</string>
<string name="prerelease_update_key" translatable="false">prerelease_update</string> <string name="prerelease_update_key" translatable="false">prerelease_update</string>
<string name="manual_check_update_key" translatable="false">manual_check_update</string> <string name="manual_check_update_key" translatable="false">manual_check_update</string>
@ -260,6 +261,7 @@
<string name="show_trailers_settings">Show trailers</string> <string name="show_trailers_settings">Show trailers</string>
<string name="kitsu_settings">Show posters from kitsu</string> <string name="kitsu_settings">Show posters from kitsu</string>
<string name="automatic_plugin_updates">Automatic plugin updates</string>
<string name="updates_settings">Show app updates</string> <string name="updates_settings">Show app updates</string>
<string name="updates_settings_des">Automatically search for new updates on start</string> <string name="updates_settings_des">Automatically search for new updates on start</string>
<string name="uprereleases_settings">Update to prereleases</string> <string name="uprereleases_settings">Update to prereleases</string>

View file

@ -28,6 +28,11 @@
android:summaryOff="@string/bug_report_settings_off" android:summaryOff="@string/bug_report_settings_off"
android:summaryOn="@string/bug_report_settings_on" android:summaryOn="@string/bug_report_settings_on"
android:title="@string/pref_disable_acra" /> android:title="@string/pref_disable_acra" />
<SwitchPreference
android:defaultValue="true"
android:icon="@drawable/ic_baseline_extension_24"
android:key="@string/auto_update_plugins_key"
android:title="@string/automatic_plugin_updates" />
<SwitchPreference <SwitchPreference
android:icon="@drawable/ic_baseline_notifications_active_24" android:icon="@drawable/ic_baseline_notifications_active_24"
android:summary="@string/updates_settings_des" android:summary="@string/updates_settings_des"
@ -41,7 +46,7 @@
app:defaultValue="false" app:defaultValue="false"
app:key="@string/prerelease_update_key" /> app:key="@string/prerelease_update_key" />
<Preference <Preference
app:key="@string/redo_setup_key"
android:icon="@drawable/ic_baseline_construction_24" android:icon="@drawable/ic_baseline_construction_24"
android:title="Redo setup process" /> android:title="Redo setup process"
app:key="@string/redo_setup_key" />
</PreferenceScreen> </PreferenceScreen>