google / google/ExoPlayer

Force clear all downloads

Open
#8,624 1 comment 1 reaction 1 assignee Claimed by @marcbaechinger View on GitHub
enhancement
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### [REQUIRED] Use case description
I want the possibility to remove all downloads in a single operation. What I mean by this is not the functionality that is there today where what is actually happening is that is loops through all downloads and removes them one by one, but rather something that force drops the download database(or all its entries) and deletes all the downloaded files on disk.

The reason I think this is something to consider:
1. It is a much quicker solution and we don't need to create a Downloader per item we want to remove(which in, at least my case, I would need to get ALL the ids separately). This is obviously more time consuming.
2. To make sure everything is removed properly, not leaving any downloads behind in a stale state.

### Proposed solution
A call that does all of the above in one single operation, meaning not the `downloadManager.removeAllDownloads()`, but rather a `downloadManager.clearDownloads()`(we should maybe send in an instance of SimpleCache here). This will then delete all database entries and all files in the provided SimpleCache.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.