nbTask++;
}
monitor.beginTask(Messages.getString("PodcastUpdaterJob.MainTask"), nbTask);
Podcast podcast;
PodcastUpdater downloader;
Iterator<Podcast> iter = _list.iterator();
while (iter.hasNext()) {
podcast = iter.next();
Log.getInstance(PodcastUpdaterJob.class).debug("Refreshing podcast: " + podcast.getName());
monitor.subTask(podcast.getName());
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
downloader = new PodcastUpdater(podcast.getUrl());
if (downloader.download()) {
podcast.setData(downloader.getData());
Log.getInstance(PodcastUpdaterJob.class).debug("Parsing data for podcast: " + podcast.getName());
_newItemsCount += podcast.parseData();
Controller.getInstance().getEventController().fireAudioItemChange(EventConstants.EVT_ITEM_CHANGE_IN_PLAYLIST, null, null);
}
monitor.worked(1);
}