diff options
Diffstat (limited to 'core/src/main')
3 files changed, 6 insertions, 44 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java index 1a40120e2..d8e07085d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/gpoddernet/GpodnetService.java @@ -1,8 +1,5 @@ package de.danoeh.antennapod.core.gpoddernet; -import android.os.Build; -import android.util.Log; - import com.squareup.okhttp.Credentials; import com.squareup.okhttp.MediaType; import com.squareup.okhttp.OkHttpClient; @@ -25,23 +22,10 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.security.KeyStore; -import java.security.Principal; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; -import javax.security.auth.x500.X500Principal; import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetDevice; @@ -562,7 +546,8 @@ public class GpodnetService { e.printStackTrace(); throw new GpodnetServiceException(e); } - Request.Builder request = new Request.Builder().url(url).post(null); + RequestBody body = RequestBody.create(TEXT, ""); + Request.Builder request = new Request.Builder().url(url).post(body); executeRequestWithAuthentication(request, username, password); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java index 4fdaf6843..04ba77cda 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java @@ -114,11 +114,6 @@ public class DownloadService extends Service { public static final String EXTRA_REQUEST = "request"; /** - * Stores new media files that will be queued for auto-download if possible. - */ - private List<Long> newMediaFiles; - - /** * Contains all completed downloads that have not been included in the report yet. */ private List<DownloadStatus> reportQueue; @@ -171,7 +166,7 @@ public class DownloadService extends Service { } private Thread downloadCompletionThread = new Thread() { - private static final String TAG = "downloadCompletionThread"; + private static final String TAG = "downloadCompletionThd"; @Override public void run() { @@ -241,7 +236,6 @@ public class DownloadService extends Service { Log.d(TAG, "Service started"); isRunning = true; handler = new Handler(); - newMediaFiles = Collections.synchronizedList(new ArrayList<Long>()); reportQueue = Collections.synchronizedList(new ArrayList<DownloadStatus>()); downloads = Collections.synchronizedList(new ArrayList<Downloader>()); numberOfDownloads = new AtomicInteger(0); @@ -325,16 +319,8 @@ public class DownloadService extends Service { cancelNotificationUpdater(); unregisterReceiver(cancelDownloadReceiver); - // TODO: I'm not sure this is actually needed. - // We could just invoke the autodownloadUndownloadeditems method - // and it would get everything it's supposed to. By sending it the - // items in newMediaFiles we're overriding the download algorithm, - // which is not something we should probably do. - if (!newMediaFiles.isEmpty()) { - Log.d(TAG, "newMediaFiles exist, autodownload them"); - DBTasks.autodownloadUndownloadedItems(getApplicationContext(), - ArrayUtils.toPrimitive(newMediaFiles.toArray(new Long[newMediaFiles.size()]))); - } + // start auto download in case anything new has shown up + DBTasks.autodownloadUndownloadedItems(getApplicationContext()); } @SuppressLint("NewApi") @@ -783,16 +769,6 @@ public class DownloadService extends Service { for (int i = 0; i < savedFeeds.length; i++) { Feed savedFeed = savedFeeds[i]; - // queue new media files for automatic download - for (FeedItem item : savedFeed.getItems()) { - if(item.getPubDate() == null) { - Log.d(TAG, item.toString()); - } - if (item.isNew() && item.hasMedia() && !item.getMedia().isDownloaded()) { - newMediaFiles.add(item.getMedia().getId()); - } - } - // If loadAllPages=true, check if another page is available and queue it for download final boolean loadAllPages = results.get(i).first.getArguments().getBoolean(DownloadRequester.REQUEST_ARG_LOAD_ALL_PAGES); final Feed feed = results.get(i).second.feed; diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 00bc077e8..c8fb83e46 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -358,6 +358,7 @@ <!-- OPML import and export --> <string name="opml_import_txtv_button_lable">OPML files allow you to move your podcasts from one podcatcher to another.</string> + <string name="opml_import_option">Option %1$d</string> <string name="opml_import_explanation_1">Choose a specific file path from the local filesystem.</string> <string name="opml_import_explanation_2">Use an external applications like Dropbox, Google Drive or your favourite file manager to open an OPML file.</string> <string name="opml_import_explanation_3">Many applications like Google Mail, Dropbox, Google Drive and most file managers can <i>open</i> OPML files <i>with</i> AntennaPod.</string> <string name="start_import_label">Start import</string> |