Check gpodnetEnabled() method before using gpodder.net API

This commit is contained in:
daniel oeh 2014-10-12 21:36:06 +02:00
parent 94f514f958
commit 189eb6acf1
2 changed files with 12 additions and 4 deletions

View File

@ -5,6 +5,7 @@ import android.content.Intent;
import android.database.Cursor;
import android.util.Log;
import de.danoeh.antennapod.core.BuildConfig;
import de.danoeh.antennapod.core.ClientConfig;
import de.danoeh.antennapod.core.asynctask.FlattrClickWorker;
import de.danoeh.antennapod.core.asynctask.FlattrStatusFetcher;
import de.danoeh.antennapod.core.feed.*;
@ -162,7 +163,9 @@ public final class DBTasks {
new FlattrStatusFetcher(context).start();
}
GpodnetSyncService.sendSyncIntent(context);
if (ClientConfig.gpodnetCallbacks.gpodnetEnabled()) {
GpodnetSyncService.sendSyncIntent(context);
}
autodownloadUndownloadedItems(context);
}
}.start();

View File

@ -8,6 +8,7 @@ import android.database.Cursor;
import android.preference.PreferenceManager;
import android.util.Log;
import de.danoeh.antennapod.core.BuildConfig;
import de.danoeh.antennapod.core.ClientConfig;
import de.danoeh.antennapod.core.asynctask.FlattrClickWorker;
import de.danoeh.antennapod.core.feed.*;
import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
@ -196,7 +197,9 @@ public class DBWriter {
adapter.removeFeed(feed);
adapter.close();
GpodnetPreferences.addRemovedFeed(feed.getDownload_url());
if (ClientConfig.gpodnetCallbacks.gpodnetEnabled()) {
GpodnetPreferences.addRemovedFeed(feed.getDownload_url());
}
EventDistributor.getInstance().sendFeedUpdateBroadcast();
BackupManager backupManager = new BackupManager(context);
@ -697,8 +700,10 @@ public class DBWriter {
adapter.setCompleteFeed(feeds);
adapter.close();
for (Feed feed : feeds) {
GpodnetPreferences.addAddedFeed(feed.getDownload_url());
if (ClientConfig.gpodnetCallbacks.gpodnetEnabled()) {
for (Feed feed : feeds) {
GpodnetPreferences.addAddedFeed(feed.getDownload_url());
}
}
BackupManager backupManager = new BackupManager(context);