Moved URL preparer call into Downloadrequester

This commit is contained in:
daniel oeh 2012-07-23 19:11:04 +02:00
parent c3d25b5106
commit dcddf476bf
2 changed files with 3 additions and 1 deletions

View File

@ -69,7 +69,7 @@ public class OpmlReader {
Log.d(TAG, "Found new Opml element"); Log.d(TAG, "Found new Opml element");
OpmlElement element = new OpmlElement(); OpmlElement element = new OpmlElement();
element.setText(xpp.getAttributeValue(null, TEXT)); element.setText(xpp.getAttributeValue(null, TEXT));
element.setXmlUrl(URLChecker.prepareURL(xpp.getAttributeValue(null, XMLURL))); element.setXmlUrl(xpp.getAttributeValue(null, XMLURL));
element.setHtmlUrl(xpp.getAttributeValue(null, HTMLURL)); element.setHtmlUrl(xpp.getAttributeValue(null, HTMLURL));
element.setType(xpp.getAttributeValue(null, TYPE)); element.setType(xpp.getAttributeValue(null, TYPE));
if (element.getXmlUrl() != null) { if (element.getXmlUrl() != null) {

View File

@ -21,6 +21,7 @@ import de.danoeh.antennapod.feed.FeedImage;
import de.danoeh.antennapod.feed.FeedMedia; import de.danoeh.antennapod.feed.FeedMedia;
import de.danoeh.antennapod.service.DownloadService; import de.danoeh.antennapod.service.DownloadService;
import de.danoeh.antennapod.util.NumberGenerator; import de.danoeh.antennapod.util.NumberGenerator;
import de.danoeh.antennapod.util.URLChecker;
public class DownloadRequester {// TODO handle externalstorage missing public class DownloadRequester {// TODO handle externalstorage missing
private static final String TAG = "DownloadRequester"; private static final String TAG = "DownloadRequester";
@ -61,6 +62,7 @@ public class DownloadRequester {// TODO handle externalstorage missing
} }
if (AppConfig.DEBUG) Log.d(TAG, "Requesting download of url " + item.getDownload_url()); if (AppConfig.DEBUG) Log.d(TAG, "Requesting download of url " + item.getDownload_url());
downloads.add(item); downloads.add(item);
item.setDownload_url(URLChecker.prepareURL(item.getDownload_url()));
DownloadManager.Request request = new DownloadManager.Request( DownloadManager.Request request = new DownloadManager.Request(
Uri.parse(item.getDownload_url())).setDestinationUri(Uri Uri.parse(item.getDownload_url())).setDestinationUri(Uri
.fromFile(dest)); .fromFile(dest));