コード例 #1
0
  @Override
  protected Pair<String, Boolean> parse(
      String page, String pageURL, VideoSourceInfo info, WorkProgress progress, int work) {
    int pageIndex = ProductReviews.getPageIndex(pageURL);
    progress.setSubDescription(getDescription() + " (" + Local.Page + " " + pageIndex + ")");

    List<Triple<String, String, Integer>> reviews = ProductReviews.getReviews(page);
    for (Triple<String, String, Integer> t : reviews)
      info.setPublicReview(t.getValue1(), t.getValue2(), t.getValue3());

    progress.progress(work);
    return new Pair<String, Boolean>(
        reviews.isEmpty() ? null : ProductReviews.getNextPageURL(page, pageURL, pageIndex + 1),
        true);
  }
 public boolean retrieve(String id, String name, Info info, WorkProgress progress, int work) {
   AudioInfo mi = (AudioInfo) info;
   AudioSourceInfo source = (AudioSourceInfo) mi.setSource(AmazonUtil.SOURCE_ID, id, name);
   boolean success = false;
   int nb = 3;
   int step = work / nb--;
   work -= step;
   if (progress.isCancelled()) return false;
   success |= new AlbumImage().retrieve(id, source, progress, step);
   step = work / nb--;
   work -= step;
   if (progress.isCancelled()) return false;
   success |= new Reviews().retrieve(id, source, progress, step);
   step = work / nb--;
   work -= step;
   if (progress.isCancelled()) return false;
   success |= new Album().retrieve(id, source, progress, step);
   return success;
 }