chg: Move the playlist duplicates option to preferences

As per the recommendation of @eddyizm
This commit is contained in:
SinTan1729 2025-10-06 21:47:57 -05:00
parent a22883fdde
commit 1c2f1aa061
No known key found for this signature in database
GPG key ID: 0538DD402EA50898
6 changed files with 43 additions and 28 deletions

View file

@ -69,6 +69,7 @@ object Preferences {
private const val NEXT_UPDATE_CHECK = "next_update_check"
private const val CONTINUOUS_PLAY = "continuous_play"
private const val LAST_INSTANT_MIX = "last_instant_mix"
private const val ALLOW_PLAYLIST_DUPLICATES = "allow_playlist_duplicates"
@JvmStatic
@ -538,4 +539,17 @@ object Preferences {
LAST_INSTANT_MIX, 0
) + 5000 < System.currentTimeMillis()
}
@JvmStatic
fun setAllowPlaylistDuplicates(allowDuplicates: Boolean) {
return App.getInstance().preferences.edit().putString(
ALLOW_PLAYLIST_DUPLICATES,
allowDuplicates.toString()
).apply()
}
@JvmStatic
fun allowPlaylistDuplicates(): Boolean {
return App.getInstance().preferences.getBoolean(ALLOW_PLAYLIST_DUPLICATES, false)
}
}