Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pump Pause not working #19

Open
ebitogu opened this issue Feb 17, 2020 · 2 comments
Open

Pump Pause not working #19

ebitogu opened this issue Feb 17, 2020 · 2 comments
Labels
question Further information is requested

Comments

@ebitogu
Copy link

ebitogu commented Feb 17, 2020

Hello, once again thanks for this awesome library. I have however discovered that the method

Pump.pause(id) doesn't work. The download keeps on continuing with progress updates, here is how I initialized it

 boolean isPaused = AppPrefs.isPaused(episode.getEpisodeId());
              String downloadId = generateDownloadIdFromEpisode(episode)
          if (isPaused) {
              Pump.resume(downloadId);
          } else {;
              Pump.newRequest(downloadUrl, filePath)
                      .setId(downloadId)
                      .setDownloadTaskExecutor(ApplicationLoader.getVideoDownloadDispatcher())
                      .forceReDownload(false)
                      .submit();
              AppPrefs.mapEpisodeIdToDownloadId(episode.getEpisodeId(), episode.getEpisodeId().hashCode());
          }

     //Here is the pause function

  public static void pauseDownload(Episode episode) {
      String downloadKeyFromEpisode = getDownloadIdFromEpisode(episode);
      Pump.pause(downloadKeyFromEpisode); //This never works, however Pump.stop(downloadKeyFromEpisode ) works well all the time.
      AppPrefs.setPaused(episode.getEpisodeId(), true);
  }

Any pointers on getting pause to work would be greatly appreciated.

Thanks.

@huxq17
Copy link
Owner

huxq17 commented Feb 17, 2020

Resume and pause is just stored in runtime,if application restarted,you should use newquest() and stop(), newRequset and stop is more reliable than resume and pause.

@huxq17 huxq17 added the question Further information is requested label Jul 30, 2020
@huxq17
Copy link
Owner

huxq17 commented Jul 30, 2020

Does this problem still exists at v1.3.9?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants