@ -61,6 +61,13 @@ class DownloadStore(context: Context) {
preferences.edit().remove(getKey(download)).apply()
}
/**
* Removes all the downloads from the store.
*/
fun clear() {
preferences.edit().clear().apply()
* Returns the preference's key for the given download.
*
@ -93,7 +100,7 @@ class DownloadStore(context: Context) {
// Clear the store, downloads will be added again immediately.
clear()
return downloads
@ -45,6 +45,7 @@ class DownloadQueue(
download.setStatusSubject(null)
queue.clear()
store.clear()
updatedRelay.call(Unit)