feat: Added anime clear progress (#531)

* feat: Added anime clear progress

* more stuff added
This commit is contained in:
Ankit Grai
2024-11-20 23:27:03 +05:30
committed by GitHub
parent ff3372754a
commit d01e1c89e0
6 changed files with 142 additions and 9 deletions

View File

@@ -235,10 +235,18 @@ object PrefManager {
apply()
}
}
/**
* Retrieves all SharedPreferences entries with keys starting with the specified prefix.
*
* @param prefix The prefix to filter keys.
* @return A map containing key-value pairs that match the prefix.
*/
fun getAllCustomValsForMedia(prefix: String): Map<String, Any?> {
val prefs = irrelevantPreferences ?: return emptyMap()
val allEntries = mutableMapOf<String, Any?>()
irrelevantPreferences?.all?.forEach { (key, value) ->
prefs.all.forEach { (key, value) ->
if (key.startsWith(prefix)) {
allEntries[key] = value
}
@@ -249,6 +257,7 @@ object PrefManager {
@Suppress("UNCHECKED_CAST")
fun <T> getLiveVal(prefName: PrefName, default: T): SharedPreferenceLiveData<T> {
val pref = getPrefLocation(prefName.data.prefLocation)