mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Reload library when deleting bookmarks (#725)
This commit is contained in:
parent
f0ebfa47c8
commit
d542febcda
2 changed files with 1 additions and 13 deletions
|
@ -40,7 +40,6 @@ import com.lagradost.cloudstream3.utils.AppUtils.loadResult
|
|||
import com.lagradost.cloudstream3.utils.Coroutines.ioSafe
|
||||
import com.lagradost.cloudstream3.utils.DOWNLOAD_HEADER_CACHE
|
||||
import com.lagradost.cloudstream3.utils.DataStoreHelper
|
||||
import com.lagradost.cloudstream3.utils.DataStoreHelper.deleteAllBookmarkedData
|
||||
import com.lagradost.cloudstream3.utils.DataStoreHelper.deleteAllResumeStateIds
|
||||
import com.lagradost.cloudstream3.utils.DataStoreHelper.getAllResumeStateIds
|
||||
import com.lagradost.cloudstream3.utils.DataStoreHelper.getAllWatchStateIds
|
||||
|
@ -102,11 +101,6 @@ class HomeViewModel : ViewModel() {
|
|||
loadStoredData()
|
||||
}
|
||||
|
||||
fun deleteBookmarks() {
|
||||
deleteAllBookmarkedData()
|
||||
loadStoredData()
|
||||
}
|
||||
|
||||
var repo: APIRepository? = null
|
||||
|
||||
private val _apiName = MutableLiveData<String>()
|
||||
|
|
|
@ -483,15 +483,9 @@ object DataStoreHelper {
|
|||
removeKeys(folder)
|
||||
}
|
||||
|
||||
fun deleteAllBookmarkedData() {
|
||||
val folder1 = "$currentAccount/$RESULT_WATCH_STATE"
|
||||
val folder2 = "$currentAccount/$RESULT_WATCH_STATE_DATA"
|
||||
removeKeys(folder1)
|
||||
removeKeys(folder2)
|
||||
}
|
||||
|
||||
fun deleteBookmarkedData(id: Int?) {
|
||||
if (id == null) return
|
||||
AccountManager.localListApi.requireLibraryRefresh = true
|
||||
removeKey("$currentAccount/$RESULT_WATCH_STATE", id.toString())
|
||||
removeKey("$currentAccount/$RESULT_WATCH_STATE_DATA", id.toString())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue