Code Monkey home page Code Monkey logo

Comments (1)

tonyofrancis avatar tonyofrancis commented on August 20, 2024 1

@mrTimay The following code allows you to clear all downloads in the database.

List<RequestInfo> requests = fetch.get();
        
for (RequestInfo request : requests) {
    fetch.remove(request.getId());
}

Fetch downloads one request at a time. If you want to delete the current downloading request you can do something like this.

List<RequestInfo> downloadingRequests = fetch.getByStatus(Fetch.STATUS_DOWNLOADING);

for (RequestInfo downloadingRequest : downloadingRequests) { 
    fetch.pause(downloadingRequest.getId());
    //or
    // fetch.remove(downloadingRequest.getId());
}

I may implement a removeAll() method in the next version release. I did not add one because I did not want users of the API using it loosely being that everything gets deleted.

from fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.