feat: implemented last set filter as default grouping for downloaded tracks

This commit is contained in:
antonio 2023-08-12 11:17:46 +02:00
parent 01e5917642
commit 4a99c7e9b1
3 changed files with 25 additions and 1 deletions

View file

@ -34,6 +34,7 @@ object Preferences {
private const val REPLAY_GAIN_MODE = "replay_gain_mode"
private const val AUDIO_TRANSCODE_PRIORITY = "audio_transcode_priority"
private const val DOWNLOAD_STORAGE = "download_storage"
private const val DEFAULT_DOWNLOAD_VIEW_TYPE = "default_download_view_type"
@JvmStatic
fun getServer(): String? {
@ -272,4 +273,20 @@ object Preferences {
storagePreference.toString()
).apply()
}
@JvmStatic
fun getDefaultDownloadViewType(): String {
return App.getInstance().preferences.getString(
DEFAULT_DOWNLOAD_VIEW_TYPE,
Constants.DOWNLOAD_TYPE_TRACK
)!!
}
@JvmStatic
fun setDefaultDownloadViewType(viewType: String) {
return App.getInstance().preferences.edit().putString(
DEFAULT_DOWNLOAD_VIEW_TYPE,
viewType
).apply()
}
}