Ejemplo n.º 1
0
  // Create a download object for every chapter in the event and add them to the downloads queue
  public void onDownloadChaptersEvent(DownloadChaptersEvent event) {
    final Manga manga = event.getManga();
    final Source source = sourceManager.get(manga.source);

    for (Chapter chapter : event.getChapters()) {
      Download download = new Download(source, manga, chapter);

      if (!prepareDownload(download)) {
        queue.add(download);
        if (isRunning) downloadsQueueSubject.onNext(download);
      }
    }
  }