Removed unused preference

This commit is contained in:
antonio 2023-03-13 17:00:43 +01:00
parent a54ba3ddaf
commit 90df6e5fc9
3 changed files with 9 additions and 45 deletions

View file

@ -16,7 +16,6 @@ object Preferences {
private const val SKIP_SILENCE = "skip_silence"
private const val IMAGE_CACHE_SIZE = "image_cache_size"
private const val IMAGE_SIZE = "image_size"
private const val MEDIA_CACHE_SIZE = "media_cache_size"
private const val MAX_BITRATE_WIFI = "max_bitrate_wifi"
private const val MAX_BITRATE_MOBILE = "max_bitrate_mobile"
private const val AUDIO_TRANSCODE_FORMAT_WIFI = "audio_transcode_format_wifi"
@ -26,11 +25,6 @@ object Preferences {
private const val SERVER_UNREACHABLE = "server_unreachable"
private const val SYNC_STARRED_TRACKS_FOR_OFFLINE_USE = "sync_starred_tracks_for_offline_use"
@JvmStatic
fun getTheme(): String? {
return App.getInstance().preferences.getString(THEME, ThemeHelper.DEFAULT_MODE)
}
@JvmStatic
fun getServer(): String? {
return App.getInstance().preferences.getString(SERVER, null)
@ -124,13 +118,7 @@ object Preferences {
@JvmStatic
fun getImageCacheSize(): Int {
return App.getInstance().preferences.getString(IMAGE_CACHE_SIZE, "400000000")!!
.toInt()
}
@JvmStatic
fun getMediaCacheSize(): Int {
return App.getInstance().preferences.getString(MEDIA_CACHE_SIZE, "400000000")!!
return App.getInstance().preferences.getString(IMAGE_CACHE_SIZE, "500")!!
.toInt()
}
@ -181,16 +169,12 @@ object Preferences {
.getBoolean(SYNC_STARRED_TRACKS_FOR_OFFLINE_USE, false)
}
@JvmStatic
fun setStarredSyncEnabled(isStarredSyncEnabled: Boolean) {
App.getInstance().preferences.edit().putBoolean(
SYNC_STARRED_TRACKS_FOR_OFFLINE_USE, isStarredSyncEnabled
).apply()
}
@JvmStatic
fun showServerUnreachableDialog(): Boolean {
return App.getInstance().preferences.getLong(SERVER_UNREACHABLE, 0) + 360000 < System.currentTimeMillis()
return App.getInstance().preferences.getLong(
SERVER_UNREACHABLE,
0
) + 360000 < System.currentTimeMillis()
}
@JvmStatic

View file

@ -16,20 +16,9 @@
<item>Low</item>
</string-array>
<string-array name="pref_cache_size_values">
<item>4000000000</item>
<item>1000000000</item>
<item>200000000</item>
</string-array>
<string-array name="pref_media_cache_size_titles">
<item>High</item>
<item>Medium</item>
<item>Low</item>
</string-array>
<string-array name="pref_media_cache_size_values">
<item>4000000000</item>
<item>1000000000</item>
<item>200000000</item>
<item>500</item>
<item>250</item>
<item>125</item>
</string-array>
<string-array name="pref_image_size_titles">

View file

@ -26,7 +26,7 @@
<PreferenceCategory app:title="@string/settings_title_data">
<ListPreference
app:defaultValue="200000000"
app:defaultValue="500"
app:dialogTitle="@string/settings_covers_cache"
app:entries="@array/pref_cache_size_titles"
app:entryValues="@array/pref_cache_size_values"
@ -34,15 +34,6 @@
app:title="@string/settings_covers_cache"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="200000000"
app:dialogTitle="@string/settings_media_cache"
app:entries="@array/pref_media_cache_size_titles"
app:entryValues="@array/pref_media_cache_size_values"
app:key="media_cache_size"
app:title="@string/settings_media_cache"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="-1"
app:dialogTitle="@string/settings_image_size"