From 85bee5902fb50b8c9774053c344653e17dabd73c Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sat, 4 Jun 2016 13:45:45 +0200 Subject: Fix app name (due to flavors) --- core/src/main/res/values/strings.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index e31d60ce8..238a24c81 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -4,7 +4,6 @@ tools:ignore="MissingTranslation"> - AntennaPod Feeds Statistics Add Podcast -- cgit v1.2.3 From b73f5ce815d283707674799b3e473c95e163e561 Mon Sep 17 00:00:00 2001 From: Tom Tom Date: Wed, 22 Jun 2016 13:30:32 +0400 Subject: Fixed rule 'public static fields should be marked as final'. --- .../antennapod/core/preferences/UserPreferences.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index b5bbb0350..3ef065496 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -121,13 +121,13 @@ public class UserPreferences { private static final int NOTIFICATION_BUTTON_FAST_FORWARD = 1; private static final int NOTIFICATION_BUTTON_SKIP = 2; private static int EPISODE_CACHE_SIZE_UNLIMITED = -1; - public static int FEED_ORDER_COUNTER = 0; - public static int FEED_ORDER_ALPHABETICAL = 1; - public static int FEED_ORDER_LAST_UPDATE = 2; - public static int FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM = 0; - public static int FEED_COUNTER_SHOW_NEW = 1; - public static int FEED_COUNTER_SHOW_UNPLAYED = 2; - public static int FEED_COUNTER_SHOW_NONE = 3; + public static final int FEED_ORDER_COUNTER = 0; + public static final int FEED_ORDER_ALPHABETICAL = 1; + public static final int FEED_ORDER_LAST_UPDATE = 2; + public static final int FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM = 0; + public static final int FEED_COUNTER_SHOW_NEW = 1; + public static final int FEED_COUNTER_SHOW_UNPLAYED = 2; + public static final int FEED_COUNTER_SHOW_NONE = 3; private static Context context; private static SharedPreferences prefs; -- cgit v1.2.3 From b5ee07e3895e05d01faebf2582895185453b38ce Mon Sep 17 00:00:00 2001 From: Tom Tom Date: Wed, 22 Jun 2016 14:06:16 +0400 Subject: Fixed rule 'Utility classes should not have public constructors' --- core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java | 1 + core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java | 2 ++ core/src/main/java/de/danoeh/antennapod/core/cast/CastUtils.java | 2 ++ .../src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java | 1 + .../java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java | 2 ++ .../java/de/danoeh/antennapod/core/preferences/UserPreferences.java | 1 + .../danoeh/antennapod/core/service/download/AntennapodHttpClient.java | 3 +++ core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java | 2 ++ core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java | 1 + core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java | 1 + core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java | 1 + core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java | 3 +++ core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java | 1 + .../java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java | 1 + core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java | 2 ++ core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java | 2 ++ .../de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java | 2 ++ .../main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java | 2 ++ .../java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java | 1 + .../main/java/de/danoeh/antennapod/core/util/playback/Playable.java | 2 ++ 20 files changed, 33 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java b/core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java index 9bbccbb82..8dc91b3f2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java +++ b/core/src/main/java/de/danoeh/antennapod/core/ClientConfig.java @@ -13,6 +13,7 @@ import de.danoeh.antennapod.core.util.NetworkUtils; * Apps using the core module of AntennaPod should register implementations of all interfaces here. */ public class ClientConfig { + private ClientConfig(){} /** * Should be used when setting User-Agent header for HTTP-requests. diff --git a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java index 8362c4a4e..53c134598 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java @@ -25,6 +25,8 @@ import de.danoeh.antennapod.core.storage.DBWriter; */ public class UpdateManager { + private UpdateManager(){} + public static final String TAG = UpdateManager.class.getSimpleName(); private static final String PREF_NAME = "app_version"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/cast/CastUtils.java b/core/src/main/java/de/danoeh/antennapod/core/cast/CastUtils.java index f0a7214c9..305f93e43 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/cast/CastUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/cast/CastUtils.java @@ -24,6 +24,8 @@ import de.danoeh.antennapod.core.util.playback.Playable; * Helper functions for Cast support. */ public class CastUtils { + private CastUtils(){} + private static final String TAG = "CastUtils"; public static final String KEY_MEDIA_ID = "de.danoeh.antennapod.core.cast.MediaId"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java b/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java index fc1acd0e1..d0061af99 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideSettings.java @@ -6,6 +6,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; * The settings that AntennaPod will use for various Glide options */ public class ApGlideSettings { + private ApGlideSettings(){} public static final DiskCacheStrategy AP_DISK_CACHE_STRATEGY = DiskCacheStrategy.ALL; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java index 6d4d3baa6..fa002ae5f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/GpodnetPreferences.java @@ -23,6 +23,8 @@ import de.danoeh.antennapod.core.service.GpodnetSyncService; */ public class GpodnetPreferences { + private GpodnetPreferences(){} + private static final String TAG = "GpodnetPreferences"; private static final String PREF_NAME = "gpodder.net"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index b5bbb0350..4563842f6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -40,6 +40,7 @@ import de.danoeh.antennapod.core.util.Converter; * when called. */ public class UserPreferences { + private UserPreferences(){} public static final String IMPORT_DIR = "import/"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java index 5dd1e2dfa..e255a07ef 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/AntennapodHttpClient.java @@ -35,6 +35,9 @@ import de.danoeh.antennapod.core.storage.DBWriter; * Provides access to a HttpClient singleton. */ public class AntennapodHttpClient { + + private AntennapodHttpClient(){} + private static final String TAG = "AntennapodHttpClient"; public static final int CONNECTION_TIMEOUT = 30000; diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java index d7c9e9108..9aa3012b3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/FeedSearcher.java @@ -17,6 +17,8 @@ import de.danoeh.antennapod.core.util.comparator.SearchResultValueComparator; * Performs search on Feeds and FeedItems */ public class FeedSearcher { + private FeedSearcher(){} + private static final String TAG = "FeedSearcher"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java index 314062e52..a8c78ed9a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/DateUtils.java @@ -16,6 +16,7 @@ import java.util.TimeZone; * Parses several date formats. */ public class DateUtils { + private DateUtils(){} private static final String TAG = "DateUtils"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java index 892e5ff38..d0f782fca 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java @@ -5,6 +5,7 @@ import java.util.List; import de.danoeh.antennapod.core.feed.FeedItem; public class FeedItemUtil { + private FeedItemUtil(){} public static int indexOfItemWithDownloadUrl(List items, String downloadUrl) { if(items == null) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java index 2d5a6e5a1..9e5e41b6c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java @@ -8,6 +8,7 @@ import android.content.pm.ResolveInfo; import java.util.List; public class IntentUtils { + private IntentUtils(){} public static boolean isCallable(final Context context, final Intent intent) { List list = context.getPackageManager().queryIntentActivities(intent, diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java index 287ec4d0c..970210ec3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/LangUtils.java @@ -5,6 +5,9 @@ import android.support.v4.util.ArrayMap; import java.nio.charset.Charset; public class LangUtils { + + private LangUtils(){} + public static final Charset UTF_8 = Charset.forName("UTF-8"); private static ArrayMap languages; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java index 55b608dce..57647a576 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/NetworkUtils.java @@ -27,6 +27,7 @@ import rx.android.schedulers.AndroidSchedulers; import rx.schedulers.Schedulers; public class NetworkUtils { + private NetworkUtils(){} private static final String TAG = NetworkUtils.class.getSimpleName(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java index ee306a401..d1818aeef 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/RewindAfterPauseUtils.java @@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit; * Media file should be "rewinded" x seconds after user resumes the playback. */ public class RewindAfterPauseUtils { + private RewindAfterPauseUtils(){} public static final long ELAPSED_TIME_FOR_SHORT_REWIND = TimeUnit.MINUTES.toMillis(1); public static final long ELAPSED_TIME_FOR_MEDIUM_REWIND = TimeUnit.HOURS.toMillis(1); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java index 1ef81bf64..3a6bf5755 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/StorageUtils.java @@ -14,6 +14,8 @@ import de.danoeh.antennapod.core.preferences.UserPreferences; * Utility functions for handling storage errors */ public class StorageUtils { + private StorageUtils(){} + private static final String TAG = "StorageUtils"; public static boolean storageAvailable() { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java index f67367643..1d5fb2645 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java @@ -6,6 +6,8 @@ import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.preferences.UserPreferences; public class ThemeUtils { + private ThemeUtils(){} + private static final String TAG = "ThemeUtils"; public static int getSelectionBackgroundColor() { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java index 97958eea7..d3a1e3e14 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java @@ -11,6 +11,8 @@ import de.danoeh.antennapod.core.BuildConfig; /** Ensures that only one instance of the FlattrService class exists at a time */ public class FlattrServiceCreator { + private FlattrServiceCreator(){} + public static final String TAG = "FlattrServiceCreator"; private static volatile FlattrService flattrService; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java index 6ddfb0366..cd74ae9a9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java @@ -36,6 +36,8 @@ import de.danoeh.antennapod.core.storage.DBWriter; */ public class FlattrUtils { + private FlattrUtils(){} + private static final String TAG = "FlattrUtils"; private static final String HOST_NAME = "de.danoeh.antennapod"; diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java index 5ba7f11d6..6417ec919 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/MediaPlayerError.java @@ -6,6 +6,7 @@ import de.danoeh.antennapod.core.R; /** Utility class for MediaPlayer errors. */ public class MediaPlayerError { + private MediaPlayerError(){} /** Get a human-readable string for a specific error code. */ public static String getErrorString(Context context, int code) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java index 201efbc81..90cd53b64 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/Playable.java @@ -161,6 +161,8 @@ public interface Playable extends Parcelable, * Provides utility methods for Playable objects. */ class PlayableUtils { + private PlayableUtils(){} + private static final String TAG = "PlayableUtils"; /** -- cgit v1.2.3 From e48cc22252a540b6014788a662f1f885c7a17639 Mon Sep 17 00:00:00 2001 From: Tom Tom Date: Wed, 22 Jun 2016 21:28:10 +0400 Subject: Fixed rule 'The diamond operator ("<>") should be used'. --- .../main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java index 6ddfb0366..3c94b9279 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java @@ -116,7 +116,7 @@ public class FlattrUtils { public static List retrieveFlattredThings() throws FlattrException { - ArrayList myFlattrs = new ArrayList(); + ArrayList myFlattrs = new ArrayList<>(); if (hasToken()) { FlattrService fs = FlattrServiceCreator.getService(retrieveToken()); -- cgit v1.2.3 From 05f923ebe256b71636e2369d48450a52ab87f944 Mon Sep 17 00:00:00 2001 From: alifeflow Date: Sun, 25 Mar 2018 16:00:42 +0900 Subject: [Ture Black] True Black Theme for AMOLED Add true black themese Modified code that fails to support three themes --- .../core/preferences/UserPreferences.java | 4 +++ .../de/danoeh/antennapod/core/util/ThemeUtils.java | 2 ++ core/src/main/res/values-v19/colors.xml | 1 + core/src/main/res/values-v21/styles.xml | 13 +++++++ core/src/main/res/values/arrays.xml | 2 ++ core/src/main/res/values/colors.xml | 1 + core/src/main/res/values/strings.xml | 1 + core/src/main/res/values/styles.xml | 40 ++++++++++++++++++++++ 8 files changed, 64 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 743ee135d..cbcdf727f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -167,6 +167,8 @@ public class UserPreferences { int theme = getTheme(); if (theme == R.style.Theme_AntennaPod_Dark) { return R.style.Theme_AntennaPod_Dark_NoTitle; + }else if (theme == R.style.Theme_AntennaPod_TrueBlack){ + return R.style.Theme_AntennaPod_TrueBlack_NoTitle; } else { return R.style.Theme_AntennaPod_Light_NoTitle; } @@ -603,6 +605,8 @@ public class UserPreferences { return R.style.Theme_AntennaPod_Light; case 1: return R.style.Theme_AntennaPod_Dark; + case 2: + return R.style.Theme_AntennaPod_TrueBlack; default: return R.style.Theme_AntennaPod_Light; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java index f67367643..184c3ee54 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java @@ -12,6 +12,8 @@ public class ThemeUtils { int theme = UserPreferences.getTheme(); if (theme == R.style.Theme_AntennaPod_Dark) { return R.color.selection_background_color_dark; + }else if (theme == R.style.Theme_AntennaPod_TrueBlack){ + return R.color.selection_background_color_trueblack; } else if (theme == R.style.Theme_AntennaPod_Light) { return R.color.selection_background_color_light; } else { diff --git a/core/src/main/res/values-v19/colors.xml b/core/src/main/res/values-v19/colors.xml index 16c065d75..08982735a 100644 --- a/core/src/main/res/values-v19/colors.xml +++ b/core/src/main/res/values-v19/colors.xml @@ -1,5 +1,6 @@ #484B4D + #000000 #E3E3E3 \ No newline at end of file diff --git a/core/src/main/res/values-v21/styles.xml b/core/src/main/res/values-v21/styles.xml index 503337c95..c53000c4f 100644 --- a/core/src/main/res/values-v21/styles.xml +++ b/core/src/main/res/values-v21/styles.xml @@ -6,6 +6,19 @@ + + + + + + + @@ -255,6 +275,26 @@ @drawable/ic_cast_disconnect_white_36dp + + + + + -- cgit v1.2.3 From deb2cea72f0f50d5ad2e3248bc8adc65ac896275 Mon Sep 17 00:00:00 2001 From: alifeflow Date: Sat, 14 Apr 2018 14:09:19 +0900 Subject: [True Black] Cleaning up Code Remove unused imports and redundant values Coding style adjustment --- .../antennapod/core/preferences/UserPreferences.java | 2 +- .../res/drawable/progress_bar_horizontal_trueblack.xml | 15 +++++++++++++++ core/src/main/res/values-v19/colors.xml | 1 - core/src/main/res/values/colors.xml | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index cbcdf727f..6aaed1b3d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -167,7 +167,7 @@ public class UserPreferences { int theme = getTheme(); if (theme == R.style.Theme_AntennaPod_Dark) { return R.style.Theme_AntennaPod_Dark_NoTitle; - }else if (theme == R.style.Theme_AntennaPod_TrueBlack){ + } else if (theme == R.style.Theme_AntennaPod_TrueBlack) { return R.style.Theme_AntennaPod_TrueBlack_NoTitle; } else { return R.style.Theme_AntennaPod_Light_NoTitle; diff --git a/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml b/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml new file mode 100644 index 000000000..73ad5b37c --- /dev/null +++ b/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/core/src/main/res/values-v19/colors.xml b/core/src/main/res/values-v19/colors.xml index 08982735a..16c065d75 100644 --- a/core/src/main/res/values-v19/colors.xml +++ b/core/src/main/res/values-v19/colors.xml @@ -1,6 +1,5 @@ #484B4D - #000000 #E3E3E3 \ No newline at end of file diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 9d020b0e4..84ae5cbc0 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -21,6 +21,7 @@ #669900 #80000000 + #286E8A #286E8A #81CFEA -- cgit v1.2.3 From 12ee8d89b2fd7eeebcf3ec0432ffb343e07f81d2 Mon Sep 17 00:00:00 2001 From: alifeflow Date: Sat, 14 Apr 2018 14:29:47 +0900 Subject: [True Black] Fix UI Elements Add true black style for progress bar Add true black style for item description Add true black style for web description --- core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml | 2 +- core/src/main/res/values/styles.xml | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml b/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml index 73ad5b37c..604bb2655 100644 --- a/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml +++ b/core/src/main/res/drawable/progress_bar_horizontal_trueblack.xml @@ -2,7 +2,7 @@ - + diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 441c7addd..7587585cc 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -132,6 +132,7 @@ + + -- cgit v1.2.3 From 9cf32a2aa96e013ea01c9f5df8be3d77fe1c4981 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 19 Apr 2018 21:39:47 +0200 Subject: Added ExoPlayer --- .../core/service/playback/ExoPlayer.java | 252 +++++++++++++++++++++ .../core/service/playback/LocalPSMP.java | 18 +- 2 files changed, 263 insertions(+), 7 deletions(-) create mode 100644 core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java new file mode 100644 index 000000000..30c9c9ab5 --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java @@ -0,0 +1,252 @@ +package de.danoeh.antennapod.core.service.playback; + +import android.content.Context; +import android.net.Uri; +import android.view.SurfaceHolder; +import com.google.android.exoplayer2.DefaultLoadControl; +import com.google.android.exoplayer2.ExoPlayerFactory; +import com.google.android.exoplayer2.PlaybackParameters; +import com.google.android.exoplayer2.Player; +import com.google.android.exoplayer2.SeekParameters; +import com.google.android.exoplayer2.SimpleExoPlayer; +import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory; +import com.google.android.exoplayer2.extractor.ExtractorsFactory; +import com.google.android.exoplayer2.source.ExtractorMediaSource; +import com.google.android.exoplayer2.source.MediaSource; +import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; +import com.google.android.exoplayer2.upstream.DataSource; +import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; +import com.google.android.exoplayer2.util.Util; +import de.danoeh.antennapod.core.util.playback.IPlayer; +import org.antennapod.audio.MediaPlayer; + +import java.io.File; +import java.io.IOException; + +/** + * @author Hans-Peter Lehmann + * @version 1.0 + */ +public class ExoPlayer implements IPlayer { + private final Context mContext; + private SimpleExoPlayer mExoPlayer; + private MediaSource mediaSource; + private MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener; + + public ExoPlayer(Context context) { + mContext = context; + mExoPlayer = createPlayer(); + } + + private SimpleExoPlayer createPlayer() { + SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance( + mContext, new DefaultTrackSelector(), new DefaultLoadControl()); + p.setSeekParameters(SeekParameters.PREVIOUS_SYNC); + return p; + } + + @Override + public boolean canSetPitch() { + return true; + } + + @Override + public boolean canSetSpeed() { + return true; + } + + @Override + public boolean canDownmix() { + return false; + } + + @Override + public float getCurrentPitchStepsAdjustment() { + return 0; + } + + @Override + public int getCurrentPosition() { + return (int) mExoPlayer.getCurrentPosition(); + } + + @Override + public float getCurrentSpeedMultiplier() { + return 0; + } + + @Override + public int getDuration() { + return (int) mExoPlayer.getDuration(); + } + + @Override + public float getMaxSpeedMultiplier() { + return 0; + } + + @Override + public float getMinSpeedMultiplier() { + return 0; + } + + @Override + public boolean isLooping() { + return mExoPlayer.getRepeatMode() == Player.REPEAT_MODE_ONE; + } + + @Override + public boolean isPlaying() { + return mExoPlayer.getPlayWhenReady(); + } + + @Override + public void pause() { + mExoPlayer.setPlayWhenReady(false); + } + + @Override + public void prepare() throws IllegalStateException { + mExoPlayer.prepare(mediaSource); + } + + @Override + public void prepareAsync() { + mExoPlayer.prepare(mediaSource); + } + + @Override + public void release() { + if (mExoPlayer != null) { + mExoPlayer.release(); + } + } + + @Override + public void reset() { + mExoPlayer.release(); + mExoPlayer = createPlayer(); + } + + @Override + public void seekTo(int i) throws IllegalStateException { + mExoPlayer.seekTo(i); + audioSeekCompleteListener.onSeekComplete(null); + } + + @Override + public void setAudioStreamType(int i) { + mExoPlayer.setAudioStreamType(i); + } + + @Override + public void setScreenOnWhilePlaying(boolean screenOn) { + + } + + @Override + public void setDataSource(String s) throws IllegalArgumentException, IllegalStateException, IOException { + DataSource.Factory dataSourceFactory = + new DefaultDataSourceFactory( + mContext, Util.getUserAgent(mContext, "uamp"), null); + // Produces Extractor instances for parsing the media data. + ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory(); + mediaSource = new ExtractorMediaSource( + Uri.fromFile(new File(s)), dataSourceFactory, extractorsFactory, null, null); + } + + @Override + public void setDisplay(SurfaceHolder sh) { + mExoPlayer.setVideoSurfaceHolder(sh); + } + + @Override + public void setEnableSpeedAdjustment(boolean b) { + + } + + @Override + public void setLooping(boolean b) { + mExoPlayer.setRepeatMode(b ? Player.REPEAT_MODE_ONE : Player.REPEAT_MODE_OFF); + } + + @Override + public void setPitchStepsAdjustment(float v) { + + } + + @Override + public void setPlaybackPitch(float v) { + PlaybackParameters params = mExoPlayer.getPlaybackParameters(); + mExoPlayer.setPlaybackParameters(new PlaybackParameters(params.speed, v)); + } + + @Override + public void setPlaybackSpeed(float v) { + PlaybackParameters params = mExoPlayer.getPlaybackParameters(); + mExoPlayer.setPlaybackParameters(new PlaybackParameters(v, params.pitch)); + } + + @Override + public void setDownmix(boolean b) { + + } + + @Override + public void setVolume(float v, float v1) { + mExoPlayer.setVolume(v); + } + + @Override + public void setWakeMode(Context context, int i) { + + } + + @Override + public void start() { + mExoPlayer.setPlayWhenReady(true); + } + + @Override + public void stop() { + mExoPlayer.stop(); + } + + @Override + public void setVideoScalingMode(int mode) { + mExoPlayer.setVideoScalingMode(mode); + } + + public void setOnCompletionListener(MediaPlayer.OnCompletionListener audioCompletionListener) { + } + + public void setOnSeekCompleteListener(MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener) { + this.audioSeekCompleteListener = audioSeekCompleteListener; + } + + public void setOnErrorListener(MediaPlayer.OnErrorListener audioErrorListener) { + } + + public void setOnBufferingUpdateListener(MediaPlayer.OnBufferingUpdateListener audioBufferingUpdateListener) { + } + + public void setOnInfoListener(MediaPlayer.OnInfoListener audioInfoListener) { + } + + public void setOnSpeedAdjustmentAvailableChangedListener(MediaPlayer.OnSpeedAdjustmentAvailableChangedListener audioSetSpeedAbilityListener) { + } + + public int getVideoWidth() { + if (mExoPlayer.getVideoFormat() == null) { + return 0; + } + return mExoPlayer.getVideoFormat().width; + } + + public int getVideoHeight() { + if (mExoPlayer.getVideoFormat() == null) { + return 0; + } + return mExoPlayer.getVideoFormat().height; + } +} diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index af735aefd..0218bde14 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -314,7 +314,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { Log.d(TAG, "Resource prepared"); if (mediaType == MediaType.VIDEO) { - VideoPlayer vp = (VideoPlayer) mediaPlayer; + ExoPlayer vp = (ExoPlayer) mediaPlayer; videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight()); } @@ -667,7 +667,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { if (mediaPlayer == null || playerStatus == PlayerStatus.ERROR || mediaType != MediaType.VIDEO) { res = null; } else { - VideoPlayer vp = (VideoPlayer) mediaPlayer; + ExoPlayer vp = (ExoPlayer) mediaPlayer; videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight()); res = videoSize; } @@ -699,11 +699,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { mediaPlayer = null; return; } - if (media.getMediaType() == MediaType.VIDEO) { - mediaPlayer = new VideoPlayer(); - } else { - mediaPlayer = new AudioPlayer(context); - } + mediaPlayer = new ExoPlayer(context); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setWakeMode(context, PowerManager.PARTIAL_WAKE_LOCK); setMediaPlayerListeners(mediaPlayer); @@ -880,6 +876,14 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { ap.setOnBufferingUpdateListener(audioBufferingUpdateListener); ap.setOnInfoListener(audioInfoListener); ap.setOnSpeedAdjustmentAvailableChangedListener(audioSetSpeedAbilityListener); + } else if (mp instanceof ExoPlayer) { + ExoPlayer ap = (ExoPlayer) mp; + ap.setOnCompletionListener(audioCompletionListener); + ap.setOnSeekCompleteListener(audioSeekCompleteListener); + ap.setOnErrorListener(audioErrorListener); + ap.setOnBufferingUpdateListener(audioBufferingUpdateListener); + ap.setOnInfoListener(audioInfoListener); + ap.setOnSpeedAdjustmentAvailableChangedListener(audioSetSpeedAbilityListener); } else { Log.w(TAG, "Unknown media player: " + mp); } -- cgit v1.2.3 From 7e61de3f65e4ec18c045a36cde44e661b07a1a5c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 19 Apr 2018 21:46:41 +0200 Subject: Added streaming support --- .../main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java index 30c9c9ab5..e6d9e399b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java @@ -152,7 +152,7 @@ public class ExoPlayer implements IPlayer { // Produces Extractor instances for parsing the media data. ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory(); mediaSource = new ExtractorMediaSource( - Uri.fromFile(new File(s)), dataSourceFactory, extractorsFactory, null, null); + Uri.parse(s), dataSourceFactory, extractorsFactory, null, null); } @Override -- cgit v1.2.3 From 06dab67b03a2a6a26963028aeacdecbba076009a Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 19 Apr 2018 22:11:29 +0200 Subject: Fixed some warnings --- .../core/service/playback/ExoPlayer.java | 114 +++++++++++++++------ .../core/service/playback/LocalPSMP.java | 3 - 2 files changed, 81 insertions(+), 36 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java index e6d9e399b..8b4678cb2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java @@ -4,44 +4,97 @@ import android.content.Context; import android.net.Uri; import android.view.SurfaceHolder; import com.google.android.exoplayer2.DefaultLoadControl; +import com.google.android.exoplayer2.DefaultRenderersFactory; +import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.ExoPlayerFactory; import com.google.android.exoplayer2.PlaybackParameters; import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.SeekParameters; import com.google.android.exoplayer2.SimpleExoPlayer; -import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory; -import com.google.android.exoplayer2.extractor.ExtractorsFactory; +import com.google.android.exoplayer2.Timeline; +import com.google.android.exoplayer2.audio.AudioAttributes; import com.google.android.exoplayer2.source.ExtractorMediaSource; import com.google.android.exoplayer2.source.MediaSource; +import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; +import com.google.android.exoplayer2.trackselection.TrackSelectionArray; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; import com.google.android.exoplayer2.util.Util; import de.danoeh.antennapod.core.util.playback.IPlayer; import org.antennapod.audio.MediaPlayer; -import java.io.File; -import java.io.IOException; -/** - * @author Hans-Peter Lehmann - * @version 1.0 - */ public class ExoPlayer implements IPlayer { private final Context mContext; private SimpleExoPlayer mExoPlayer; private MediaSource mediaSource; private MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener; + private MediaPlayer.OnCompletionListener audioCompletionListener; + private MediaPlayer.OnErrorListener audioErrorListener; - public ExoPlayer(Context context) { + ExoPlayer(Context context) { mContext = context; mExoPlayer = createPlayer(); } private SimpleExoPlayer createPlayer() { - SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance( - mContext, new DefaultTrackSelector(), new DefaultLoadControl()); + SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(mContext), + new DefaultTrackSelector(), new DefaultLoadControl()); p.setSeekParameters(SeekParameters.PREVIOUS_SYNC); + p.addListener(new Player.EventListener() { + @Override + public void onTimelineChanged(Timeline timeline, Object manifest, int reason) { + + } + + @Override + public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) { + + } + + @Override + public void onLoadingChanged(boolean isLoading) { + + } + + @Override + public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { + if (playbackState == Player.STATE_ENDED) { + audioCompletionListener.onCompletion(null); + } + } + + @Override + public void onRepeatModeChanged(int repeatMode) { + + } + + @Override + public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) { + + } + + @Override + public void onPlayerError(ExoPlaybackException error) { + audioErrorListener.onError(null, 0, 0); + } + + @Override + public void onPositionDiscontinuity(int reason) { + + } + + @Override + public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) { + + } + + @Override + public void onSeekProcessed() { + + } + }); return p; } @@ -136,7 +189,12 @@ public class ExoPlayer implements IPlayer { @Override public void setAudioStreamType(int i) { - mExoPlayer.setAudioStreamType(i); + AudioAttributes a = mExoPlayer.getAudioAttributes(); + AudioAttributes.Builder b = new AudioAttributes.Builder(); + b.setContentType(i); + b.setFlags(a.flags); + b.setUsage(a.usage); + mExoPlayer.setAudioAttributes(b.build()); } @Override @@ -145,14 +203,11 @@ public class ExoPlayer implements IPlayer { } @Override - public void setDataSource(String s) throws IllegalArgumentException, IllegalStateException, IOException { + public void setDataSource(String s) throws IllegalArgumentException, IllegalStateException { DataSource.Factory dataSourceFactory = - new DefaultDataSourceFactory( - mContext, Util.getUserAgent(mContext, "uamp"), null); - // Produces Extractor instances for parsing the media data. - ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory(); - mediaSource = new ExtractorMediaSource( - Uri.parse(s), dataSourceFactory, extractorsFactory, null, null); + new DefaultDataSourceFactory(mContext, Util.getUserAgent(mContext, mContext.getPackageName()), null); + ExtractorMediaSource.Factory f = new ExtractorMediaSource.Factory(dataSourceFactory); + mediaSource = f.createMediaSource(Uri.parse(s)); } @Override @@ -217,33 +272,26 @@ public class ExoPlayer implements IPlayer { mExoPlayer.setVideoScalingMode(mode); } - public void setOnCompletionListener(MediaPlayer.OnCompletionListener audioCompletionListener) { + void setOnCompletionListener(MediaPlayer.OnCompletionListener audioCompletionListener) { + this.audioCompletionListener = audioCompletionListener; } - public void setOnSeekCompleteListener(MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener) { + void setOnSeekCompleteListener(MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener) { this.audioSeekCompleteListener = audioSeekCompleteListener; } - public void setOnErrorListener(MediaPlayer.OnErrorListener audioErrorListener) { - } - - public void setOnBufferingUpdateListener(MediaPlayer.OnBufferingUpdateListener audioBufferingUpdateListener) { - } - - public void setOnInfoListener(MediaPlayer.OnInfoListener audioInfoListener) { - } - - public void setOnSpeedAdjustmentAvailableChangedListener(MediaPlayer.OnSpeedAdjustmentAvailableChangedListener audioSetSpeedAbilityListener) { + void setOnErrorListener(MediaPlayer.OnErrorListener audioErrorListener) { + this.audioErrorListener = audioErrorListener; } - public int getVideoWidth() { + int getVideoWidth() { if (mExoPlayer.getVideoFormat() == null) { return 0; } return mExoPlayer.getVideoFormat().width; } - public int getVideoHeight() { + int getVideoHeight() { if (mExoPlayer.getVideoFormat() == null) { return 0; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 0218bde14..ce8993cbd 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -881,9 +881,6 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { ap.setOnCompletionListener(audioCompletionListener); ap.setOnSeekCompleteListener(audioSeekCompleteListener); ap.setOnErrorListener(audioErrorListener); - ap.setOnBufferingUpdateListener(audioBufferingUpdateListener); - ap.setOnInfoListener(audioInfoListener); - ap.setOnSpeedAdjustmentAvailableChangedListener(audioSetSpeedAbilityListener); } else { Log.w(TAG, "Unknown media player: " + mp); } -- cgit v1.2.3 From d50dcac96e223f48a218093007130eb7fd5ca0c2 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 21 Apr 2018 17:58:14 +0200 Subject: Added ExoPlayer setting --- .../de/danoeh/antennapod/core/UpdateManager.java | 2 +- .../core/preferences/UserPreferences.java | 14 +- .../core/service/playback/ExoPlayer.java | 300 --------------------- .../core/service/playback/ExoPlayerWrapper.java | 300 +++++++++++++++++++++ .../core/service/playback/LocalPSMP.java | 29 +- .../antennapod/core/util/playback/AudioPlayer.java | 2 +- core/src/main/res/values/arrays.xml | 22 ++ core/src/main/res/values/strings.xml | 7 +- 8 files changed, 359 insertions(+), 317 deletions(-) delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java create mode 100644 core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java index 96e3a77be..f7db11af6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java @@ -89,7 +89,7 @@ class UpdateManager { } if(oldVersionCode < 1050004) { if(MediaPlayer.isPrestoLibraryInstalled(context) && Build.VERSION.SDK_INT >= 16) { - UserPreferences.enableSonic(true); + UserPreferences.enableSonic(); } } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 743ee135d..420288c14 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -103,6 +103,7 @@ public class UserPreferences { public static final String PREF_IMAGE_CACHE_SIZE = "prefImageCacheSize"; // Mediaplayer + public static final String PREF_MEDIA_PLAYER = "prefMediaPlayer"; private static final String PREF_PLAYBACK_SPEED = "prefPlaybackSpeed"; private static final String PREF_FAST_FORWARD_SECS = "prefFastForwardSecs"; private static final String PREF_REWIND_SECS = "prefRewindSecs"; @@ -113,7 +114,6 @@ public class UserPreferences { private static final String PREF_RIGHT_VOLUME = "prefRightVolume"; // Experimental - public static final String PREF_SONIC = "prefSonic"; private static final String PREF_STEREO_TO_MONO = "PrefStereoToMono"; public static final String PREF_NORMALIZER = "prefNormalizer"; public static final String PREF_CAST_ENABLED = "prefCast"; //Used for enabling Chromecast support @@ -642,13 +642,15 @@ public class UserPreferences { } public static boolean useSonic() { - return prefs.getBoolean(PREF_SONIC, false); + return prefs.getString(PREF_MEDIA_PLAYER, "sonic").equals("sonic"); } - public static void enableSonic(boolean enable) { - prefs.edit() - .putBoolean(PREF_SONIC, enable) - .apply(); + public static boolean useExoplayer() { + return prefs.getString(PREF_MEDIA_PLAYER, "sonic").equals("exoplayer"); + } + + public static void enableSonic() { + prefs.edit().putString(PREF_MEDIA_PLAYER, "sonic").apply(); } public static boolean stereoToMono() { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java deleted file mode 100644 index 8b4678cb2..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayer.java +++ /dev/null @@ -1,300 +0,0 @@ -package de.danoeh.antennapod.core.service.playback; - -import android.content.Context; -import android.net.Uri; -import android.view.SurfaceHolder; -import com.google.android.exoplayer2.DefaultLoadControl; -import com.google.android.exoplayer2.DefaultRenderersFactory; -import com.google.android.exoplayer2.ExoPlaybackException; -import com.google.android.exoplayer2.ExoPlayerFactory; -import com.google.android.exoplayer2.PlaybackParameters; -import com.google.android.exoplayer2.Player; -import com.google.android.exoplayer2.SeekParameters; -import com.google.android.exoplayer2.SimpleExoPlayer; -import com.google.android.exoplayer2.Timeline; -import com.google.android.exoplayer2.audio.AudioAttributes; -import com.google.android.exoplayer2.source.ExtractorMediaSource; -import com.google.android.exoplayer2.source.MediaSource; -import com.google.android.exoplayer2.source.TrackGroupArray; -import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; -import com.google.android.exoplayer2.trackselection.TrackSelectionArray; -import com.google.android.exoplayer2.upstream.DataSource; -import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; -import com.google.android.exoplayer2.util.Util; -import de.danoeh.antennapod.core.util.playback.IPlayer; -import org.antennapod.audio.MediaPlayer; - - -public class ExoPlayer implements IPlayer { - private final Context mContext; - private SimpleExoPlayer mExoPlayer; - private MediaSource mediaSource; - private MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener; - private MediaPlayer.OnCompletionListener audioCompletionListener; - private MediaPlayer.OnErrorListener audioErrorListener; - - ExoPlayer(Context context) { - mContext = context; - mExoPlayer = createPlayer(); - } - - private SimpleExoPlayer createPlayer() { - SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(mContext), - new DefaultTrackSelector(), new DefaultLoadControl()); - p.setSeekParameters(SeekParameters.PREVIOUS_SYNC); - p.addListener(new Player.EventListener() { - @Override - public void onTimelineChanged(Timeline timeline, Object manifest, int reason) { - - } - - @Override - public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) { - - } - - @Override - public void onLoadingChanged(boolean isLoading) { - - } - - @Override - public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { - if (playbackState == Player.STATE_ENDED) { - audioCompletionListener.onCompletion(null); - } - } - - @Override - public void onRepeatModeChanged(int repeatMode) { - - } - - @Override - public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) { - - } - - @Override - public void onPlayerError(ExoPlaybackException error) { - audioErrorListener.onError(null, 0, 0); - } - - @Override - public void onPositionDiscontinuity(int reason) { - - } - - @Override - public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) { - - } - - @Override - public void onSeekProcessed() { - - } - }); - return p; - } - - @Override - public boolean canSetPitch() { - return true; - } - - @Override - public boolean canSetSpeed() { - return true; - } - - @Override - public boolean canDownmix() { - return false; - } - - @Override - public float getCurrentPitchStepsAdjustment() { - return 0; - } - - @Override - public int getCurrentPosition() { - return (int) mExoPlayer.getCurrentPosition(); - } - - @Override - public float getCurrentSpeedMultiplier() { - return 0; - } - - @Override - public int getDuration() { - return (int) mExoPlayer.getDuration(); - } - - @Override - public float getMaxSpeedMultiplier() { - return 0; - } - - @Override - public float getMinSpeedMultiplier() { - return 0; - } - - @Override - public boolean isLooping() { - return mExoPlayer.getRepeatMode() == Player.REPEAT_MODE_ONE; - } - - @Override - public boolean isPlaying() { - return mExoPlayer.getPlayWhenReady(); - } - - @Override - public void pause() { - mExoPlayer.setPlayWhenReady(false); - } - - @Override - public void prepare() throws IllegalStateException { - mExoPlayer.prepare(mediaSource); - } - - @Override - public void prepareAsync() { - mExoPlayer.prepare(mediaSource); - } - - @Override - public void release() { - if (mExoPlayer != null) { - mExoPlayer.release(); - } - } - - @Override - public void reset() { - mExoPlayer.release(); - mExoPlayer = createPlayer(); - } - - @Override - public void seekTo(int i) throws IllegalStateException { - mExoPlayer.seekTo(i); - audioSeekCompleteListener.onSeekComplete(null); - } - - @Override - public void setAudioStreamType(int i) { - AudioAttributes a = mExoPlayer.getAudioAttributes(); - AudioAttributes.Builder b = new AudioAttributes.Builder(); - b.setContentType(i); - b.setFlags(a.flags); - b.setUsage(a.usage); - mExoPlayer.setAudioAttributes(b.build()); - } - - @Override - public void setScreenOnWhilePlaying(boolean screenOn) { - - } - - @Override - public void setDataSource(String s) throws IllegalArgumentException, IllegalStateException { - DataSource.Factory dataSourceFactory = - new DefaultDataSourceFactory(mContext, Util.getUserAgent(mContext, mContext.getPackageName()), null); - ExtractorMediaSource.Factory f = new ExtractorMediaSource.Factory(dataSourceFactory); - mediaSource = f.createMediaSource(Uri.parse(s)); - } - - @Override - public void setDisplay(SurfaceHolder sh) { - mExoPlayer.setVideoSurfaceHolder(sh); - } - - @Override - public void setEnableSpeedAdjustment(boolean b) { - - } - - @Override - public void setLooping(boolean b) { - mExoPlayer.setRepeatMode(b ? Player.REPEAT_MODE_ONE : Player.REPEAT_MODE_OFF); - } - - @Override - public void setPitchStepsAdjustment(float v) { - - } - - @Override - public void setPlaybackPitch(float v) { - PlaybackParameters params = mExoPlayer.getPlaybackParameters(); - mExoPlayer.setPlaybackParameters(new PlaybackParameters(params.speed, v)); - } - - @Override - public void setPlaybackSpeed(float v) { - PlaybackParameters params = mExoPlayer.getPlaybackParameters(); - mExoPlayer.setPlaybackParameters(new PlaybackParameters(v, params.pitch)); - } - - @Override - public void setDownmix(boolean b) { - - } - - @Override - public void setVolume(float v, float v1) { - mExoPlayer.setVolume(v); - } - - @Override - public void setWakeMode(Context context, int i) { - - } - - @Override - public void start() { - mExoPlayer.setPlayWhenReady(true); - } - - @Override - public void stop() { - mExoPlayer.stop(); - } - - @Override - public void setVideoScalingMode(int mode) { - mExoPlayer.setVideoScalingMode(mode); - } - - void setOnCompletionListener(MediaPlayer.OnCompletionListener audioCompletionListener) { - this.audioCompletionListener = audioCompletionListener; - } - - void setOnSeekCompleteListener(MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener) { - this.audioSeekCompleteListener = audioSeekCompleteListener; - } - - void setOnErrorListener(MediaPlayer.OnErrorListener audioErrorListener) { - this.audioErrorListener = audioErrorListener; - } - - int getVideoWidth() { - if (mExoPlayer.getVideoFormat() == null) { - return 0; - } - return mExoPlayer.getVideoFormat().width; - } - - int getVideoHeight() { - if (mExoPlayer.getVideoFormat() == null) { - return 0; - } - return mExoPlayer.getVideoFormat().height; - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java new file mode 100644 index 000000000..1d233ff0c --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -0,0 +1,300 @@ +package de.danoeh.antennapod.core.service.playback; + +import android.content.Context; +import android.net.Uri; +import android.view.SurfaceHolder; +import com.google.android.exoplayer2.DefaultLoadControl; +import com.google.android.exoplayer2.DefaultRenderersFactory; +import com.google.android.exoplayer2.ExoPlaybackException; +import com.google.android.exoplayer2.ExoPlayerFactory; +import com.google.android.exoplayer2.PlaybackParameters; +import com.google.android.exoplayer2.Player; +import com.google.android.exoplayer2.SeekParameters; +import com.google.android.exoplayer2.SimpleExoPlayer; +import com.google.android.exoplayer2.Timeline; +import com.google.android.exoplayer2.audio.AudioAttributes; +import com.google.android.exoplayer2.source.ExtractorMediaSource; +import com.google.android.exoplayer2.source.MediaSource; +import com.google.android.exoplayer2.source.TrackGroupArray; +import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; +import com.google.android.exoplayer2.trackselection.TrackSelectionArray; +import com.google.android.exoplayer2.upstream.DataSource; +import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; +import com.google.android.exoplayer2.util.Util; +import de.danoeh.antennapod.core.util.playback.IPlayer; +import org.antennapod.audio.MediaPlayer; + + +public class ExoPlayerWrapper implements IPlayer { + private final Context mContext; + private SimpleExoPlayer mExoPlayer; + private MediaSource mediaSource; + private MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener; + private MediaPlayer.OnCompletionListener audioCompletionListener; + private MediaPlayer.OnErrorListener audioErrorListener; + + ExoPlayerWrapper(Context context) { + mContext = context; + mExoPlayer = createPlayer(); + } + + private SimpleExoPlayer createPlayer() { + SimpleExoPlayer p = ExoPlayerFactory.newSimpleInstance(new DefaultRenderersFactory(mContext), + new DefaultTrackSelector(), new DefaultLoadControl()); + p.setSeekParameters(SeekParameters.PREVIOUS_SYNC); + p.addListener(new Player.EventListener() { + @Override + public void onTimelineChanged(Timeline timeline, Object manifest, int reason) { + + } + + @Override + public void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections) { + + } + + @Override + public void onLoadingChanged(boolean isLoading) { + + } + + @Override + public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { + if (playbackState == Player.STATE_ENDED) { + audioCompletionListener.onCompletion(null); + } + } + + @Override + public void onRepeatModeChanged(int repeatMode) { + + } + + @Override + public void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) { + + } + + @Override + public void onPlayerError(ExoPlaybackException error) { + audioErrorListener.onError(null, 0, 0); + } + + @Override + public void onPositionDiscontinuity(int reason) { + + } + + @Override + public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) { + + } + + @Override + public void onSeekProcessed() { + + } + }); + return p; + } + + @Override + public boolean canSetPitch() { + return true; + } + + @Override + public boolean canSetSpeed() { + return true; + } + + @Override + public boolean canDownmix() { + return false; + } + + @Override + public float getCurrentPitchStepsAdjustment() { + return 0; + } + + @Override + public int getCurrentPosition() { + return (int) mExoPlayer.getCurrentPosition(); + } + + @Override + public float getCurrentSpeedMultiplier() { + return 0; + } + + @Override + public int getDuration() { + return (int) mExoPlayer.getDuration(); + } + + @Override + public float getMaxSpeedMultiplier() { + return 0; + } + + @Override + public float getMinSpeedMultiplier() { + return 0; + } + + @Override + public boolean isLooping() { + return mExoPlayer.getRepeatMode() == Player.REPEAT_MODE_ONE; + } + + @Override + public boolean isPlaying() { + return mExoPlayer.getPlayWhenReady(); + } + + @Override + public void pause() { + mExoPlayer.setPlayWhenReady(false); + } + + @Override + public void prepare() throws IllegalStateException { + mExoPlayer.prepare(mediaSource); + } + + @Override + public void prepareAsync() { + mExoPlayer.prepare(mediaSource); + } + + @Override + public void release() { + if (mExoPlayer != null) { + mExoPlayer.release(); + } + } + + @Override + public void reset() { + mExoPlayer.release(); + mExoPlayer = createPlayer(); + } + + @Override + public void seekTo(int i) throws IllegalStateException { + mExoPlayer.seekTo(i); + audioSeekCompleteListener.onSeekComplete(null); + } + + @Override + public void setAudioStreamType(int i) { + AudioAttributes a = mExoPlayer.getAudioAttributes(); + AudioAttributes.Builder b = new AudioAttributes.Builder(); + b.setContentType(i); + b.setFlags(a.flags); + b.setUsage(a.usage); + mExoPlayer.setAudioAttributes(b.build()); + } + + @Override + public void setScreenOnWhilePlaying(boolean screenOn) { + + } + + @Override + public void setDataSource(String s) throws IllegalArgumentException, IllegalStateException { + DataSource.Factory dataSourceFactory = + new DefaultDataSourceFactory(mContext, Util.getUserAgent(mContext, mContext.getPackageName()), null); + ExtractorMediaSource.Factory f = new ExtractorMediaSource.Factory(dataSourceFactory); + mediaSource = f.createMediaSource(Uri.parse(s)); + } + + @Override + public void setDisplay(SurfaceHolder sh) { + mExoPlayer.setVideoSurfaceHolder(sh); + } + + @Override + public void setEnableSpeedAdjustment(boolean b) { + + } + + @Override + public void setLooping(boolean b) { + mExoPlayer.setRepeatMode(b ? Player.REPEAT_MODE_ONE : Player.REPEAT_MODE_OFF); + } + + @Override + public void setPitchStepsAdjustment(float v) { + + } + + @Override + public void setPlaybackPitch(float v) { + PlaybackParameters params = mExoPlayer.getPlaybackParameters(); + mExoPlayer.setPlaybackParameters(new PlaybackParameters(params.speed, v)); + } + + @Override + public void setPlaybackSpeed(float v) { + PlaybackParameters params = mExoPlayer.getPlaybackParameters(); + mExoPlayer.setPlaybackParameters(new PlaybackParameters(v, params.pitch)); + } + + @Override + public void setDownmix(boolean b) { + + } + + @Override + public void setVolume(float v, float v1) { + mExoPlayer.setVolume(v); + } + + @Override + public void setWakeMode(Context context, int i) { + + } + + @Override + public void start() { + mExoPlayer.setPlayWhenReady(true); + } + + @Override + public void stop() { + mExoPlayer.stop(); + } + + @Override + public void setVideoScalingMode(int mode) { + mExoPlayer.setVideoScalingMode(mode); + } + + void setOnCompletionListener(MediaPlayer.OnCompletionListener audioCompletionListener) { + this.audioCompletionListener = audioCompletionListener; + } + + void setOnSeekCompleteListener(MediaPlayer.OnSeekCompleteListener audioSeekCompleteListener) { + this.audioSeekCompleteListener = audioSeekCompleteListener; + } + + void setOnErrorListener(MediaPlayer.OnErrorListener audioErrorListener) { + this.audioErrorListener = audioErrorListener; + } + + int getVideoWidth() { + if (mExoPlayer.getVideoFormat() == null) { + return 0; + } + return mExoPlayer.getVideoFormat().width; + } + + int getVideoHeight() { + if (mExoPlayer.getVideoFormat() == null) { + return 0; + } + return mExoPlayer.getVideoFormat().height; + } +} diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index ce8993cbd..7abcc413b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -313,8 +313,11 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { Log.d(TAG, "Resource prepared"); - if (mediaType == MediaType.VIDEO) { - ExoPlayer vp = (ExoPlayer) mediaPlayer; + if (mediaType == MediaType.VIDEO && mediaPlayer instanceof ExoPlayerWrapper) { + ExoPlayerWrapper vp = (ExoPlayerWrapper) mediaPlayer; + videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight()); + } else if(mediaType == MediaType.VIDEO && mediaPlayer instanceof VideoPlayer) { + VideoPlayer vp = (VideoPlayer) mediaPlayer; videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight()); } @@ -666,8 +669,12 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { Pair res; if (mediaPlayer == null || playerStatus == PlayerStatus.ERROR || mediaType != MediaType.VIDEO) { res = null; + } else if (mediaPlayer instanceof ExoPlayerWrapper) { + ExoPlayerWrapper vp = (ExoPlayerWrapper) mediaPlayer; + videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight()); + res = videoSize; } else { - ExoPlayer vp = (ExoPlayer) mediaPlayer; + VideoPlayer vp = (VideoPlayer) mediaPlayer; videoSize = new Pair<>(vp.getVideoWidth(), vp.getVideoHeight()); res = videoSize; } @@ -695,11 +702,19 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { if (mediaPlayer != null) { mediaPlayer.release(); } - if(media == null) { + if (media == null) { mediaPlayer = null; return; } - mediaPlayer = new ExoPlayer(context); + + if (UserPreferences.useExoplayer()) { + mediaPlayer = new ExoPlayerWrapper(context); + } else if (media.getMediaType() == MediaType.VIDEO) { + mediaPlayer = new VideoPlayer(); + } else { + mediaPlayer = new AudioPlayer(context); + } + mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setWakeMode(context, PowerManager.PARTIAL_WAKE_LOCK); setMediaPlayerListeners(mediaPlayer); @@ -876,8 +891,8 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { ap.setOnBufferingUpdateListener(audioBufferingUpdateListener); ap.setOnInfoListener(audioInfoListener); ap.setOnSpeedAdjustmentAvailableChangedListener(audioSetSpeedAbilityListener); - } else if (mp instanceof ExoPlayer) { - ExoPlayer ap = (ExoPlayer) mp; + } else if (mp instanceof ExoPlayerWrapper) { + ExoPlayerWrapper ap = (ExoPlayerWrapper) mp; ap.setOnCompletionListener(audioCompletionListener); ap.setOnSeekCompleteListener(audioSeekCompleteListener); ap.setOnErrorListener(audioErrorListener); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java index 846733882..a1530e808 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java @@ -21,7 +21,7 @@ public class AudioPlayer extends MediaPlayer implements IPlayer { private final SharedPreferences.OnSharedPreferenceChangeListener sonicListener = (sharedPreferences, key) -> { - if (key.equals(UserPreferences.PREF_SONIC)) { + if (key.equals(UserPreferences.PREF_MEDIA_PLAYER)) { checkMpi(); } }; diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml index 45650495c..f27b25a17 100644 --- a/core/src/main/res/values/arrays.xml +++ b/core/src/main/res/values/arrays.xml @@ -181,6 +181,28 @@ 3 + + @string/media_player_builtin + @string/media_player_sonic + @string/media_player_exoplayer + + + + builtin + sonic + exoplayer + + + + @string/media_player_builtin + @string/media_player_exoplayer + + + + builtin + exoplayer + + @string/hide_unplayed_episodes_label @string/hide_paused_episodes_label diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index aa36eab33..a558c4e9a 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -426,8 +426,8 @@ Send the latest crash report via e-mail Send e-mail Experimental - Sonic Media Player - Use built-in sonic media player as a replacement for Android\'s native mediaplayer and Prestissimo + Media Player + Select which media player to use to play files Current value: %1$s Proxy Set a network proxy @@ -439,6 +439,9 @@ Chromecast requires third party proprietary libraries that are disabled in this version of AntennaPod Enqueue Downloaded Add downloaded episodes to the queue + Built-in Android player + Sonic Media Player + Exoplayer Enable automatic flattring -- cgit v1.2.3 From df8f90083ca18ca96db1ff1a77f0bc2b2db1b3c0 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 21 Apr 2018 18:13:24 +0200 Subject: Cleanup --- .../core/service/playback/ExoPlayerWrapper.java | 69 ++-------------------- .../antennapod/core/util/playback/AudioPlayer.java | 11 ---- .../antennapod/core/util/playback/IPlayer.java | 22 ------- .../antennapod/core/util/playback/VideoPlayer.java | 38 ------------ 4 files changed, 5 insertions(+), 135 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java index 1d233ff0c..b523d9675 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -92,17 +92,12 @@ public class ExoPlayerWrapper implements IPlayer { @Override public void onSeekProcessed() { - + audioSeekCompleteListener.onSeekComplete(null); } }); return p; } - @Override - public boolean canSetPitch() { - return true; - } - @Override public boolean canSetSpeed() { return true; @@ -113,11 +108,6 @@ public class ExoPlayerWrapper implements IPlayer { return false; } - @Override - public float getCurrentPitchStepsAdjustment() { - return 0; - } - @Override public int getCurrentPosition() { return (int) mExoPlayer.getCurrentPosition(); @@ -125,7 +115,7 @@ public class ExoPlayerWrapper implements IPlayer { @Override public float getCurrentSpeedMultiplier() { - return 0; + return mExoPlayer.getPlaybackParameters().speed; } @Override @@ -133,21 +123,6 @@ public class ExoPlayerWrapper implements IPlayer { return (int) mExoPlayer.getDuration(); } - @Override - public float getMaxSpeedMultiplier() { - return 0; - } - - @Override - public float getMinSpeedMultiplier() { - return 0; - } - - @Override - public boolean isLooping() { - return mExoPlayer.getRepeatMode() == Player.REPEAT_MODE_ONE; - } - @Override public boolean isPlaying() { return mExoPlayer.getPlayWhenReady(); @@ -163,16 +138,14 @@ public class ExoPlayerWrapper implements IPlayer { mExoPlayer.prepare(mediaSource); } - @Override - public void prepareAsync() { - mExoPlayer.prepare(mediaSource); - } - @Override public void release() { if (mExoPlayer != null) { mExoPlayer.release(); } + audioSeekCompleteListener = null; + audioCompletionListener = null; + audioErrorListener = null; } @Override @@ -184,7 +157,6 @@ public class ExoPlayerWrapper implements IPlayer { @Override public void seekTo(int i) throws IllegalStateException { mExoPlayer.seekTo(i); - audioSeekCompleteListener.onSeekComplete(null); } @Override @@ -197,11 +169,6 @@ public class ExoPlayerWrapper implements IPlayer { mExoPlayer.setAudioAttributes(b.build()); } - @Override - public void setScreenOnWhilePlaying(boolean screenOn) { - - } - @Override public void setDataSource(String s) throws IllegalArgumentException, IllegalStateException { DataSource.Factory dataSourceFactory = @@ -215,27 +182,6 @@ public class ExoPlayerWrapper implements IPlayer { mExoPlayer.setVideoSurfaceHolder(sh); } - @Override - public void setEnableSpeedAdjustment(boolean b) { - - } - - @Override - public void setLooping(boolean b) { - mExoPlayer.setRepeatMode(b ? Player.REPEAT_MODE_ONE : Player.REPEAT_MODE_OFF); - } - - @Override - public void setPitchStepsAdjustment(float v) { - - } - - @Override - public void setPlaybackPitch(float v) { - PlaybackParameters params = mExoPlayer.getPlaybackParameters(); - mExoPlayer.setPlaybackParameters(new PlaybackParameters(params.speed, v)); - } - @Override public void setPlaybackSpeed(float v) { PlaybackParameters params = mExoPlayer.getPlaybackParameters(); @@ -267,11 +213,6 @@ public class ExoPlayerWrapper implements IPlayer { mExoPlayer.stop(); } - @Override - public void setVideoScalingMode(int mode) { - mExoPlayer.setVideoScalingMode(mode); - } - void setOnCompletionListener(MediaPlayer.OnCompletionListener audioCompletionListener) { this.audioCompletionListener = audioCompletionListener; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java index a1530e808..16d05dbb9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/AudioPlayer.java @@ -26,12 +26,6 @@ public class AudioPlayer extends MediaPlayer implements IPlayer { } }; - @Override - public void setScreenOnWhilePlaying(boolean screenOn) { - Log.e(TAG, "Setting screen on while playing not supported in Audio Player"); - throw new UnsupportedOperationException("Setting screen on while playing not supported in Audio Player"); - } - @Override public void setDisplay(SurfaceHolder sh) { if (sh != null) { @@ -40,11 +34,6 @@ public class AudioPlayer extends MediaPlayer implements IPlayer { } } - @Override - public void setVideoScalingMode(int mode) { - throw new UnsupportedOperationException("Setting scaling mode is not supported in Audio Player"); - } - @Override protected boolean useSonic() { return UserPreferences.useSonic(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java index aba395ec1..a372f4241 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/IPlayer.java @@ -6,13 +6,11 @@ import android.view.SurfaceHolder; import java.io.IOException; public interface IPlayer { - boolean canSetPitch(); boolean canSetSpeed(); boolean canDownmix(); - float getCurrentPitchStepsAdjustment(); int getCurrentPosition(); @@ -20,20 +18,12 @@ public interface IPlayer { int getDuration(); - float getMaxSpeedMultiplier(); - - float getMinSpeedMultiplier(); - - boolean isLooping(); - boolean isPlaying(); void pause(); void prepare() throws IllegalStateException, IOException; - void prepareAsync(); - void release(); void reset(); @@ -42,21 +32,11 @@ public interface IPlayer { void setAudioStreamType(int streamtype); - void setScreenOnWhilePlaying(boolean screenOn); - void setDataSource(String path) throws IllegalStateException, IOException, IllegalArgumentException, SecurityException; void setDisplay(SurfaceHolder sh); - void setEnableSpeedAdjustment(boolean enableSpeedAdjustment); - - void setLooping(boolean looping); - - void setPitchStepsAdjustment(float pitchSteps); - - void setPlaybackPitch(float f); - void setPlaybackSpeed(float f); void setDownmix(boolean enable); @@ -67,7 +47,5 @@ public interface IPlayer { void stop(); - void setVideoScalingMode(int mode); - void setWakeMode(Context context, int mode); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java index 368379509..1d04fb878 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/VideoPlayer.java @@ -6,11 +6,6 @@ import android.util.Log; public class VideoPlayer extends MediaPlayer implements IPlayer { private static final String TAG = "VideoPlayer"; - @Override - public boolean canSetPitch() { - return false; - } - @Override public boolean canSetSpeed() { return false; @@ -21,44 +16,11 @@ public class VideoPlayer extends MediaPlayer implements IPlayer { return false; } - @Override - public float getCurrentPitchStepsAdjustment() { - return 1; - } - @Override public float getCurrentSpeedMultiplier() { return 1; } - @Override - public float getMaxSpeedMultiplier() { - return 1; - } - - @Override - public float getMinSpeedMultiplier() { - return 1; - } - - @Override - public void setEnableSpeedAdjustment(boolean enableSpeedAdjustment) throws UnsupportedOperationException { - Log.e(TAG, "Setting enable speed adjustment unsupported in video player"); - throw new UnsupportedOperationException("Setting enable speed adjustment unsupported in video player"); - } - - @Override - public void setPitchStepsAdjustment(float pitchSteps) { - Log.e(TAG, "Setting pitch steps adjustment unsupported in video player"); - throw new UnsupportedOperationException("Setting pitch steps adjustment unsupported in video player"); - } - - @Override - public void setPlaybackPitch(float f) { - Log.e(TAG, "Setting playback pitch unsupported in video player"); - throw new UnsupportedOperationException("Setting playback pitch unsupported in video player"); - } - @Override public void setPlaybackSpeed(float f) { Log.e(TAG, "Setting playback speed unsupported in video player"); -- cgit v1.2.3 From 8c6f40b0a272851110c9c073c75b9e6521e880d0 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 22 Apr 2018 14:41:01 +0200 Subject: Fixed miniplayer position after start Casting magic values to int is not a good idea... --- .../de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java | 4 ++++ .../java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java index b523d9675..3df017e58 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.core.service.playback; import android.content.Context; import android.net.Uri; import android.view.SurfaceHolder; +import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.DefaultLoadControl; import com.google.android.exoplayer2.DefaultRenderersFactory; import com.google.android.exoplayer2.ExoPlaybackException; @@ -120,6 +121,9 @@ public class ExoPlayerWrapper implements IPlayer { @Override public int getDuration() { + if (mExoPlayer.getDuration() == C.TIME_UNSET) { + return PlaybackServiceMediaPlayer.INVALID_TIME; + } return (int) mExoPlayer.getDuration(); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 7abcc413b..d86c1a632 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -450,7 +450,8 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { || playerStatus == PlayerStatus.PAUSED || playerStatus == PlayerStatus.PREPARED) { retVal = mediaPlayer.getDuration(); - } else if (media != null && media.getDuration() > 0) { + } + if (retVal <= 0 && media != null && media.getDuration() > 0) { retVal = media.getDuration(); } -- cgit v1.2.3 From c977e70106309fe6e070481e2c172798982056c7 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 22 Apr 2018 20:49:41 +0200 Subject: Removed duplicate String --- core/src/main/res/values/strings.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 63796fae4..4687f250e 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -441,7 +441,6 @@ Send the latest crash report via e-mail Send e-mail Experimental - Media Player Select which media player to use to play files Current value: %1$s Proxy -- cgit v1.2.3 From 719545fd3d54ed445d217e77b9a5005c6ba27c4f Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 2 May 2018 21:49:36 +0200 Subject: Prevent thrashing the database by opening and closing rapidly Reduces number of real close() calls to the database from multiple times per second to one single time --- .../de/danoeh/antennapod/core/service/download/DownloadService.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/src/main') 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 a62c9d8bf..57c1964f1 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 @@ -22,6 +22,7 @@ import android.util.Log; import android.util.Pair; import android.webkit.URLUtil; +import de.danoeh.antennapod.core.storage.PodDBAdapter; import org.apache.commons.io.FileUtils; import org.xml.sax.SAXException; @@ -258,6 +259,7 @@ public class DownloadService extends Service { public void onCreate() { Log.d(TAG, "Service started"); isRunning = true; + PodDBAdapter.getInstance().open(); // Prevent thrashing the database by opening and closing rapidly handler = new Handler(); reportQueue = Collections.synchronizedList(new ArrayList<>()); downloads = Collections.synchronizedList(new ArrayList<>()); @@ -336,6 +338,7 @@ public class DownloadService extends Service { // start auto download in case anything new has shown up DBTasks.autodownloadUndownloadedItems(getApplicationContext()); + PodDBAdapter.getInstance().close(); } private void setupNotificationBuilders() { -- cgit v1.2.3 From 9dcbddf371f6ac04fdbddc4415ff079dcd3ea392 Mon Sep 17 00:00:00 2001 From: orionlee Date: Wed, 2 May 2018 13:15:14 -0700 Subject: Issue #2580: Expose "Mark as seen" as a context menu item in Episode screen, in addition to the existing swipe in Episode > New tab. --- core/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 2ebc2ad77..2ba8a7f40 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -163,6 +163,7 @@ Delete Unable to delete file. Rebooting the device could help. Remove Episode + Mark as seen Marked as seen Mark as played Marked as played -- cgit v1.2.3 From 6e876db9b61ef57312a254af1a6e59877e8a8ea6 Mon Sep 17 00:00:00 2001 From: Koen Glotzbach <11229646+keunes@users.noreply.github.com> Date: Mon, 14 May 2018 23:34:37 +0200 Subject: Update strings.xml Improve preference description following https://github.com/AntennaPod/AntennaPod/issues/1560#issuecomment-172252386. Not sure if same change should be applied also to string "pref_hardwarePreviousButtonRestarts_sum" --- core/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 65697be28..9fb1d5d15 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -309,7 +309,7 @@ Resume playback when the headphones are reconnected Resume playback when bluetooth reconnects Forward Button Skips - When pressing a hardware forward button skip to the next episode instead of fast-forwarding + When pressing a forward button on a bluetooth-connected device skip to the next episode instead of fast-forwarding Previous button restarts When pressing a hardware previous button restart playing the current episode instead of rewinding Jump to next queue item when playback completes -- cgit v1.2.3 From 2058f3c0b341b483c8f653618ba338fb028f31e9 Mon Sep 17 00:00:00 2001 From: orionlee Date: Sat, 12 May 2018 13:37:50 -0700 Subject: #2577: ensure that during feeds update, automatic (episodes) download will download the latest ones by waiting the feeds update complete before starting autodownload. --- core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index da500fd3e..d6612e404 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -198,8 +198,10 @@ public final class DBTasks { if (ClientConfig.gpodnetCallbacks.gpodnetEnabled()) { GpodnetSyncService.sendSyncIntent(context); } - Log.d(TAG, "refreshAllFeeds autodownload"); - autodownloadUndownloadedItems(context); + // Note: automatic download of episodes will be done but not here. + // Instead it is done after all feeds have been refreshed (asynchronously), + // in DownloadService.onDestroy() + // See Issue #2577 for the details of the rationale if (callback != null) { callback.run(); -- cgit v1.2.3 From 9df23ebbf65cd80ae08f2fb3beb55f106a782a1f Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 27 May 2018 20:03:44 +0200 Subject: Removed unused code --- .../antennapod/core/asynctask/DBTaskLoader.java | 29 ------------- .../core/preferences/UserPreferences.java | 2 - .../core/service/download/DownloadRequest.java | 4 -- .../core/service/download/DownloaderCallback.java | 10 ----- .../danoeh/antennapod/core/storage/DBReader.java | 17 -------- .../de/danoeh/antennapod/core/storage/DBTasks.java | 42 ------------------ .../danoeh/antennapod/core/storage/DBWriter.java | 16 ------- .../antennapod/core/storage/PodDBAdapter.java | 48 --------------------- .../danoeh/antennapod/core/util/EpisodeFilter.java | 50 ---------------------- .../danoeh/antennapod/core/util/QueueAccess.java | 15 ------- .../util/exception/MediaFileNotFoundException.java | 5 --- 11 files changed, 238 deletions(-) delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java deleted file mode 100644 index 1b4aafeaa..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.danoeh.antennapod.core.asynctask; - -import android.content.Context; -import android.support.v4.content.AsyncTaskLoader; - -/** - * Subclass of AsyncTaskLoader that is made for loading data with one of the DB*-classes. - * This class will provide a useful default implementation that would otherwise always be necessary when interacting - * with the DB*-classes with an AsyncTaskLoader. - */ -abstract class DBTaskLoader extends AsyncTaskLoader { - - public DBTaskLoader(Context context) { - super(context); - } - - @Override - protected void onStopLoading() { - super.onStopLoading(); - cancelLoad(); - } - - @Override - protected void onStartLoading() { - super.onStartLoading(); - // according to https://code.google.com/p/android/issues/detail?id=14944, this has to be called manually - forceLoad(); - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java index 44b2fa2b2..f96c1d4b9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java +++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java @@ -109,7 +109,6 @@ public class UserPreferences { // Experimental public static final String PREF_SONIC = "prefSonic"; private static final String PREF_STEREO_TO_MONO = "PrefStereoToMono"; - public static final String PREF_NORMALIZER = "prefNormalizer"; public static final String PREF_CAST_ENABLED = "prefCast"; //Used for enabling Chromecast support public static final int EPISODE_CLEANUP_QUEUE = -1; public static final int EPISODE_CLEANUP_NULL = -2; @@ -122,7 +121,6 @@ public class UserPreferences { private static final int EPISODE_CACHE_SIZE_UNLIMITED = -1; public static final int FEED_ORDER_COUNTER = 0; public static final int FEED_ORDER_ALPHABETICAL = 1; - public static final int FEED_ORDER_LAST_UPDATE = 2; public static final int FEED_ORDER_MOST_PLAYED = 3; public static final int FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM = 0; public static final int FEED_COUNTER_SHOW_NEW = 1; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java index 9a64bebf7..75c28564e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java @@ -211,10 +211,6 @@ public class DownloadRequest implements Parcelable { this.size = size; } - public int getStatusMsg() { - return statusMsg; - } - public void setStatusMsg(int statusMsg) { this.statusMsg = statusMsg; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java deleted file mode 100644 index b0829f084..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.danoeh.antennapod.core.service.download; - -/** - * Callback used by the Downloader-classes to notify the requester that the - * download has completed. - */ -public interface DownloaderCallback { - - void onDownloadCompleted(Downloader downloader); -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index fa87cc216..e5e14ee18 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -838,23 +838,6 @@ public final class DBReader { } } - /** - * Searches the DB for a FeedImage of the given id. - * - * @param imageId The id of the object - * @return The found object - */ - public static FeedImage getFeedImage(final long imageId) { - Log.d(TAG, "getFeedImage() called with: " + "imageId = [" + imageId + "]"); - PodDBAdapter adapter = PodDBAdapter.getInstance(); - adapter.open(); - try { - return getFeedImage(adapter, imageId); - } finally { - adapter.close(); - } - } - /** * Searches the DB for a FeedImage of the given id. * diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index da500fd3e..c2706d183 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -236,27 +236,6 @@ public final class DBTasks { } - /** - * Downloads all pages of the given feed. - * - * @param context Used for requesting the download. - * @param feed The Feed object. - */ - public static void refreshCompleteFeed(final Context context, final Feed feed) { - try { - refreshFeed(context, feed, true, false); - } catch (DownloadRequestException e) { - e.printStackTrace(); - DBWriter.addDownloadStatus( - new DownloadStatus(feed, feed - .getHumanReadableIdentifier(), - DownloadError.ERROR_REQUEST_ERROR, false, e - .getMessage() - ) - ); - } - } - /** * Downloads all pages of the given feed even if feed has not been modified since last refresh * @@ -377,27 +356,6 @@ public final class DBTasks { EventDistributor.getInstance().sendFeedUpdateBroadcast(); } - /** - * Request the download of all objects in the queue. from a separate Thread. - * - * @param context Used for requesting the download an accessing the database. - */ - public static void downloadAllItemsInQueue(final Context context) { - new Thread() { - public void run() { - List queue = DBReader.getQueue(); - if (!queue.isEmpty()) { - try { - downloadFeedItems(context, - queue.toArray(new FeedItem[queue.size()])); - } catch (DownloadRequestException e) { - e.printStackTrace(); - } - } - } - }.start(); - } - /** * Requests the download of a list of FeedItem objects. * diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 8cdf82e15..7bacba913 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -482,22 +482,6 @@ public class DBWriter { }); } - public static Future addFavoriteItemById(final long itemId) { - return dbExec.submit(() -> { - final FeedItem item = DBReader.getFeedItem(itemId); - if (item == null) { - Log.d(TAG, "Can't find item for itemId " + itemId); - return; - } - final PodDBAdapter adapter = PodDBAdapter.getInstance().open(); - adapter.addFavoriteItem(item); - adapter.close(); - item.addTag(FeedItem.TAG_FAVORITE); - EventBus.getDefault().post(FavoritesEvent.added(item)); - EventBus.getDefault().post(FeedItemEvent.updated(item)); - }); - } - public static Future removeFavoriteItem(final FeedItem item) { return dbExec.submit(() -> { final PodDBAdapter adapter = PodDBAdapter.getInstance().open(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index e82252310..d4ad6fdb7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -607,31 +607,6 @@ public class PodDBAdapter { new String[]{String.valueOf(FlattrStatus.STATUS_QUEUE)}, null, null, null); } - /** - * Counts feeds and feed items in the flattr queue - */ - public int getFlattrQueueSize() { - int res = 0; - Cursor c = db.rawQuery(String.format("SELECT count(*) FROM %s WHERE %s=%s", - TABLE_NAME_FEEDS, KEY_FLATTR_STATUS, String.valueOf(FlattrStatus.STATUS_QUEUE)), null); - if (c.moveToFirst()) { - res = c.getInt(0); - c.close(); - } else { - Log.e(TAG, "Unable to determine size of flattr queue: Could not count number of feeds"); - } - c = db.rawQuery(String.format("SELECT count(*) FROM %s WHERE %s=%s", - TABLE_NAME_FEED_ITEMS, KEY_FLATTR_STATUS, String.valueOf(FlattrStatus.STATUS_QUEUE)), null); - if (c.moveToFirst()) { - res += c.getInt(0); - c.close(); - } else { - Log.e(TAG, "Unable to determine size of flattr queue: Could not count number of feed items"); - } - - return res; - } - /** * Updates the download URL of a Feed. */ @@ -944,17 +919,6 @@ public class PodDBAdapter { return count > 0; } - public long getDownloadLogSize() { - final String query = String.format("SELECT COUNT(%s) FROM %s", KEY_ID, TABLE_NAME_DOWNLOAD_LOG); - Cursor result = db.rawQuery(query, null); - long count = 0; - if (result.moveToFirst()) { - count = result.getLong(0); - } - result.close(); - return count; - } - public void setQueue(List queue) { ContentValues values = new ContentValues(); try { @@ -1093,18 +1057,6 @@ public class PodDBAdapter { null, null); } - /** - * Returns a cursor for a DB query in the FeedMedia table for a given ID. - * - * @param item The item you want to get the FeedMedia from - * @return The cursor of the query - */ - public final Cursor getFeedMediaOfItemCursor(final FeedItem item) { - return db.query(TABLE_NAME_FEED_MEDIA, null, KEY_ID + "=?", - new String[]{String.valueOf(item.getMedia().getId())}, null, - null, null); - } - /** * Returns a cursor for a DB query in the FeedImages table for given IDs. * diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java b/core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java deleted file mode 100644 index fb1b0dc8f..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java +++ /dev/null @@ -1,50 +0,0 @@ -package de.danoeh.antennapod.core.util; - -import java.util.ArrayList; -import java.util.List; - -import de.danoeh.antennapod.core.feed.FeedItem; - -class EpisodeFilter { - - private EpisodeFilter() { - - } - - /** Return a copy of the itemlist without items which have no media. */ - public static ArrayList getEpisodeList(List items) { - ArrayList episodes = new ArrayList<>(items); - for (FeedItem item : items) { - if (item.getMedia() == null) { - episodes.remove(item); - } - } - return episodes; - } - - public static int countItemsWithEpisodes(List items) { - int count = 0; - for (FeedItem item : items) { - if (item.getMedia() != null) { - count++; - } - } - return count; - } - - public static FeedItem accessEpisodeByIndex(List items, - int position) { - int count = 0; - for (FeedItem item : items) { - - if (item.getMedia() != null) { - if (count == position) { - return item; - } else { - count++; - } - } - } - return null; - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java b/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java index 7377b202d..9408be348 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java @@ -58,19 +58,4 @@ public abstract class QueueAccess { }; } - public static QueueAccess NotInQueueAccess() { - return new QueueAccess() { - @Override - public boolean contains(long id) { - return false; - } - - @Override - public boolean remove(long id) { - return false; - } - }; - - } - } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java index ecb641dad..3000e2fa4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java @@ -12,11 +12,6 @@ public class MediaFileNotFoundException extends Exception { this.media = media; } - public MediaFileNotFoundException(FeedMedia media) { - super(); - this.media = media; - } - public FeedMedia getMedia() { return media; } -- cgit v1.2.3 From 632906df071722e7d3d6b30faee09102dc1d4ef2 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 29 May 2018 22:49:55 +0200 Subject: PlaybackService notification setup improvements --- .../core/service/playback/PlaybackService.java | 53 ++++++++++++---------- 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index be6cb346d..90df9871b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -316,9 +316,6 @@ public class PlaybackService extends MediaBrowserServiceCompat { NotificationCompat.Builder notificationBuilder = createBasicNotification(); startForeground(NOTIFICATION_ID, notificationBuilder.build()); EventBus.getDefault().post(new ServiceEvent(ServiceEvent.Action.SERVICE_STARTED)); - - - setupNotification(Playable.PlayableUtils.createInstanceFromPreferences(getApplicationContext())); } private NotificationCompat.Builder createBasicNotification() { @@ -468,10 +465,13 @@ public class PlaybackService extends MediaBrowserServiceCompat { Log.d(TAG, "onStartCommand is a redelivered intent, calling stopForeground now."); stopForeground(true); } else { - if (keycode != -1) { Log.d(TAG, "Received media button event"); - handleKeycode(keycode, true); + boolean handled = handleKeycode(keycode, true); + if (!handled) { + stopSelf(); + return Service.START_NOT_STICKY; + } } else if (!flavorHelper.castDisconnect(castDisconnect) && playable != null) { started = true; boolean stream = intent.getBooleanExtra(EXTRA_SHOULD_STREAM, @@ -486,6 +486,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { } mediaPlayer.playMediaObject(playable, stream, startWhenPrepared, prepareImmediately); } + setupNotification(playable); } return Service.START_NOT_STICKY; @@ -1215,38 +1216,44 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (notificationSetupThread != null) { notificationSetupThread.interrupt(); } + if (playable == null) { + Log.d(TAG, "setupNotification: playable is null"); + return; + } Runnable notificationSetupTask = new Runnable() { Bitmap icon = null; @Override public void run() { Log.d(TAG, "Starting background work"); - if (playable != null) { - int iconSize = getResources().getDimensionPixelSize( - android.R.dimen.notification_large_icon_width); - try { - icon = Glide.with(PlaybackService.this) - .load(playable.getImageLocation()) - .asBitmap() - .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .centerCrop() - .into(iconSize, iconSize) - .get(); - } catch (Throwable tr) { - Log.e(TAG, "Error loading the media icon for the notification", tr); - } + + if (mediaPlayer == null) { + Log.d(TAG, "notificationSetupTask: mediaPlayer is null"); + return; } + + int iconSize = getResources().getDimensionPixelSize( + android.R.dimen.notification_large_icon_width); + try { + icon = Glide.with(PlaybackService.this) + .load(playable.getImageLocation()) + .asBitmap() + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) + .centerCrop() + .into(iconSize, iconSize) + .get(); + } catch (Throwable tr) { + Log.e(TAG, "Error loading the media icon for the notification", tr); + } + if (icon == null) { icon = BitmapFactory.decodeResource(getApplicationContext().getResources(), ClientConfig.playbackServiceCallbacks.getNotificationIconResource(getApplicationContext())); } - if (mediaPlayer == null) { - return; - } PlayerStatus playerStatus = mediaPlayer.getPlayerStatus(); - if (!Thread.currentThread().isInterrupted() && started && playable != null) { + if (!Thread.currentThread().isInterrupted() && started) { String contentText = playable.getEpisodeTitle(); String contentTitle = playable.getFeedTitle(); Notification notification; -- cgit v1.2.3 From 02186a3f0da9c8f687607f72fb8613989b6fb8e2 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 29 May 2018 23:25:19 +0200 Subject: Limit broadcasts to current app --- .../java/de/danoeh/antennapod/core/asynctask/FeedRemover.java | 3 ++- .../danoeh/antennapod/core/service/playback/PlaybackService.java | 9 ++------- .../src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java | 3 ++- .../main/java/de/danoeh/antennapod/core/storage/DBWriter.java | 6 ++++-- .../de/danoeh/antennapod/core/storage/DownloadRequester.java | 4 +++- 5 files changed, 13 insertions(+), 12 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java index 1e0c07b01..849dfef93 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java @@ -41,7 +41,8 @@ public class FeedRemover extends AsyncTask { dialog.dismiss(); } if(skipOnCompletion) { - context.sendBroadcast(new Intent(PlaybackService.ACTION_SKIP_CURRENT_EPISODE)); + context.sendBroadcast(new Intent(PlaybackService.ACTION_SKIP_CURRENT_EPISODE) + .setPackage(context.getPackageName())); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index be6cb346d..5cccd754f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -701,6 +701,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { Intent statusUpdate = new Intent(ACTION_PLAYER_STATUS_CHANGED); // statusUpdate.putExtra(EXTRA_NEW_PLAYER_STATUS, newInfo.playerStatus.ordinal()); + statusUpdate.setPackage(getPackageName()); sendBroadcast(statusUpdate); PlayerWidgetJobService.updateWidget(getBaseContext()); bluetoothNotifyChange(newInfo, AVRCP_ACTION_PLAYER_STATUS_CHANGED); @@ -1042,17 +1043,11 @@ public class PlaybackService extends MediaBrowserServiceCompat { editor.commit(); } - /** - * Send ACTION_PLAYER_STATUS_CHANGED without changing the status attribute. - */ - private void postStatusUpdateIntent() { - sendBroadcast(new Intent(ACTION_PLAYER_STATUS_CHANGED)); - } - private void sendNotificationBroadcast(int type, int code) { Intent intent = new Intent(ACTION_PLAYER_NOTIFICATION); intent.putExtra(EXTRA_NOTIFICATION_TYPE, type); intent.putExtra(EXTRA_NOTIFICATION_CODE, code); + intent.setPackage(getPackageName()); sendBroadcast(intent); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index da500fd3e..7ce2e7bd0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -143,7 +143,8 @@ public final class DBTasks { e.printStackTrace(); if (media.isPlaying()) { context.sendBroadcast(new Intent( - PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE)); + PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE) + .setPackage(context.getPackageName())); } notifyMissingFeedMediaFile(context, media); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 8cdf82e15..17a02961c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -120,7 +120,8 @@ public class DBWriter { .getCurrentlyPlayingFeedMediaId() == media .getId()) { context.sendBroadcast(new Intent( - PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE)); + PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE) + .setPackage(context.getPackageName())); } } // Gpodder: queue delete action for synchronization @@ -158,7 +159,8 @@ public class DBWriter { && PlaybackPreferences.getLastPlayedFeedId() == feed .getId()) { context.sendBroadcast(new Intent( - PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE)); + PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE) + .setPackage(context.getPackageName())); SharedPreferences.Editor editor = prefs.edit(); editor.putLong( PlaybackPreferences.PREF_CURRENTLY_PLAYING_FEED_ID, diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index 7d4b737db..6e062a318 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -242,6 +242,7 @@ public class DownloadRequester { Log.d(TAG, "Cancelling download with url " + downloadUrl); Intent cancelIntent = new Intent(DownloadService.ACTION_CANCEL_DOWNLOAD); cancelIntent.putExtra(DownloadService.EXTRA_DOWNLOAD_URL, downloadUrl); + cancelIntent.setPackage(context.getPackageName()); context.sendBroadcast(cancelIntent); } @@ -251,7 +252,8 @@ public class DownloadRequester { public synchronized void cancelAllDownloads(Context context) { Log.d(TAG, "Cancelling all running downloads"); context.sendBroadcast(new Intent( - DownloadService.ACTION_CANCEL_ALL_DOWNLOADS)); + DownloadService.ACTION_CANCEL_ALL_DOWNLOADS) + .setPackage(context.getPackageName())); } /** -- cgit v1.2.3 From ba2233430e96f31de10aa82468529bfd781a742a Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 5 Jun 2018 23:52:19 +0200 Subject: Removed FeedImage --- .../de/danoeh/antennapod/core/UpdateManager.java | 24 ------ .../java/de/danoeh/antennapod/core/feed/Feed.java | 32 ++++---- .../de/danoeh/antennapod/core/feed/FeedImage.java | 92 ---------------------- .../de/danoeh/antennapod/core/feed/FeedItem.java | 44 +++-------- .../core/service/download/DownloadService.java | 29 +------ .../core/service/download/HttpDownloader.java | 10 +-- .../danoeh/antennapod/core/storage/DBReader.java | 79 +------------------ .../danoeh/antennapod/core/storage/DBWriter.java | 37 --------- .../antennapod/core/storage/PodDBAdapter.java | 76 +----------------- .../core/syndication/namespace/NSITunes.java | 16 +--- .../core/syndication/namespace/NSMedia.java | 18 +---- .../core/syndication/namespace/NSRSS20.java | 22 +----- .../core/syndication/namespace/atom/NSAtom.java | 7 +- 13 files changed, 47 insertions(+), 439 deletions(-) delete mode 100644 core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java index 96e3a77be..7f0fc4b2b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java +++ b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java @@ -14,7 +14,6 @@ import java.io.File; import java.util.List; import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBReader; @@ -64,29 +63,6 @@ class UpdateManager { } private static void onUpgrade(final int oldVersionCode, final int newVersionCode) { - if(oldVersionCode < 1030099) { - // delete the now obsolete image cache - // from now on, Glide will handle caching images - new Thread() { - public void run() { - List feeds = DBReader.getFeedList(); - for (Feed podcast : feeds) { - List episodes = DBReader.getFeedItemList(podcast); - for (FeedItem episode : episodes) { - FeedImage image = episode.getImage(); - if (image != null && image.isDownloaded() && image.getFile_url() != null) { - File imageFile = new File(image.getFile_url()); - if (imageFile.exists()) { - imageFile.delete(); - } - image.setFile_url(null); // calls setDownloaded(false) - DBWriter.setFeedImage(image); - } - } - } - } - }.start(); - } if(oldVersionCode < 1050004) { if(MediaPlayer.isPrestoLibraryInstalled(context) && Build.VERSION.SDK_INT >= 16) { UserPreferences.enableSonic(true); diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java index 78df74ee7..4f0659a64 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java @@ -44,7 +44,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { * Name of the author */ private String author; - private FeedImage image; + private String imageUrl; private List items; /** @@ -96,7 +96,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { * This constructor is used for restoring a feed from the database. */ public Feed(long id, String lastUpdate, String title, String customTitle, String link, String description, String paymentLink, - String author, String language, String type, String feedIdentifier, FeedImage image, String fileUrl, + String author, String language, String type, String feedIdentifier, String imageUrl, String fileUrl, String downloadUrl, boolean downloaded, FlattrStatus status, boolean paged, String nextPageLink, String filter, boolean lastUpdateFailed) { super(fileUrl, downloadUrl, downloaded); @@ -111,7 +111,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { this.language = language; this.type = type; this.feedIdentifier = feedIdentifier; - this.image = image; + this.imageUrl = imageUrl; this.flattrStatus = status; this.paged = paged; this.nextPageLink = nextPageLink; @@ -128,9 +128,9 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { * This constructor is used for test purposes and uses a default flattr status object. */ public Feed(long id, String lastUpdate, String title, String link, String description, String paymentLink, - String author, String language, String type, String feedIdentifier, FeedImage image, String fileUrl, + String author, String language, String type, String feedIdentifier, String imageUrl, String fileUrl, String downloadUrl, boolean downloaded) { - this(id, lastUpdate, title, null, link, description, paymentLink, author, language, type, feedIdentifier, image, + this(id, lastUpdate, title, null, link, description, paymentLink, author, language, type, feedIdentifier, imageUrl, fileUrl, downloadUrl, downloaded, new FlattrStatus(), false, null, null, false); } @@ -266,8 +266,8 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { public void updateFromOther(Feed other) { // don't update feed's download_url, we do that manually if redirected // see AntennapodHttpClient - if (other.image != null) { - this.image = other.image; + if (other.imageUrl != null) { + this.imageUrl = other.imageUrl; } if (other.feedTitle != null) { feedTitle = other.feedTitle; @@ -305,8 +305,8 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { if (super.compareWithOther(other)) { return true; } - if (other.image != null) { - if (image == null || !TextUtils.equals(image.download_url, other.image.download_url)) { + if (other.imageUrl != null) { + if (imageUrl == null || !TextUtils.equals(imageUrl, other.imageUrl)) { return true; } } @@ -411,12 +411,12 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { this.description = description; } - public FeedImage getImage() { - return image; + public String getImageUrl() { + return imageUrl; } - public void setImage(FeedImage image) { - this.image = image; + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; } public List getItems() { @@ -505,11 +505,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { @Override public String getImageLocation() { - if (image != null) { - return image.getImageLocation(); - } else { - return null; - } + return imageUrl; } public int getPageNr() { diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java deleted file mode 100644 index 45bd2ad31..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedImage.java +++ /dev/null @@ -1,92 +0,0 @@ -package de.danoeh.antennapod.core.feed; - -import android.database.Cursor; - -import java.io.File; - -import de.danoeh.antennapod.core.asynctask.ImageResource; -import de.danoeh.antennapod.core.storage.PodDBAdapter; - - -public class FeedImage extends FeedFile implements ImageResource { - public static final int FEEDFILETYPE_FEEDIMAGE = 1; - - private String title; - private FeedComponent owner; - - public FeedImage(FeedComponent owner, String download_url, String title) { - super(null, download_url, false); - this.download_url = download_url; - this.title = title; - this.owner = owner; - } - - public FeedImage(long id, String title, String file_url, - String download_url, boolean downloaded) { - super(file_url, download_url, downloaded); - this.id = id; - this.title = title; - } - - public FeedImage() { - super(); - } - - public static FeedImage fromCursor(Cursor cursor) { - int indexId = cursor.getColumnIndex(PodDBAdapter.KEY_ID); - int indexTitle = cursor.getColumnIndex(PodDBAdapter.KEY_TITLE); - int indexFileUrl = cursor.getColumnIndex(PodDBAdapter.KEY_FILE_URL); - int indexDownloadUrl = cursor.getColumnIndex(PodDBAdapter.KEY_DOWNLOAD_URL); - int indexDownloaded = cursor.getColumnIndex(PodDBAdapter.KEY_DOWNLOADED); - - return new FeedImage( - cursor.getLong(indexId), - cursor.getString(indexTitle), - cursor.getString(indexFileUrl), - cursor.getString(indexDownloadUrl), - cursor.getInt(indexDownloaded) > 0 - ); - } - - - @Override - public String getHumanReadableIdentifier() { - if (owner != null && owner.getHumanReadableIdentifier() != null) { - return owner.getHumanReadableIdentifier(); - } else { - return download_url; - } - } - - @Override - public int getTypeAsInt() { - return FEEDFILETYPE_FEEDIMAGE; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public FeedComponent getOwner() { - return owner; - } - - public void setOwner(FeedComponent owner) { - this.owner = owner; - } - - @Override - public String getImageLocation() { - if (file_url != null && downloaded) { - return new File(file_url).getAbsolutePath(); - } else if(download_url != null) { - return download_url; - } else { - return null; - } - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java index 87298d4c3..d6a6996fe 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java @@ -4,6 +4,7 @@ import android.database.Cursor; import android.support.annotation.Nullable; import android.text.TextUtils; +import de.danoeh.antennapod.core.asynctask.ImageResource; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -14,7 +15,6 @@ import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; -import de.danoeh.antennapod.core.asynctask.ImageResource; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.PodDBAdapter; import de.danoeh.antennapod.core.util.ShownotesProvider; @@ -75,7 +75,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr * in the database. The 'hasChapters' attribute should be used to check if this item has any chapters. * */ private List chapters; - private FeedImage image; + private String imageUrl; /* * 0: auto download disabled @@ -100,7 +100,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr * This constructor is used by DBReader. * */ public FeedItem(long id, String title, String link, Date pubDate, String paymentLink, long feedId, - FlattrStatus flattrStatus, boolean hasChapters, FeedImage image, int state, + FlattrStatus flattrStatus, boolean hasChapters, String imageUrl, int state, String itemIdentifier, long autoDownload) { this.id = id; this.title = title; @@ -110,7 +110,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr this.feedId = feedId; this.flattrStatus = flattrStatus; this.hasChapters = hasChapters; - this.image = image; + this.imageUrl = imageUrl; this.state = state; this.itemIdentifier = itemIdentifier; this.autoDownload = autoDownload; @@ -177,8 +177,8 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr public void updateFromOther(FeedItem other) { super.updateFromOther(other); - if (other.image != null) { - this.image = other.image; + if (other.imageUrl != null) { + this.imageUrl = other.imageUrl; } if (other.title != null) { title = other.title; @@ -212,9 +212,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr chapters = other.chapters; } } - if (image == null) { - image = other.image; - } } /** @@ -389,8 +386,8 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr public String getImageLocation() { if(media != null && media.hasEmbeddedPicture()) { return media.getImageLocation(); - } else if (image != null) { - return image.getImageLocation(); + } else if (imageUrl != null) { + return imageUrl; } else if (feed != null) { return feed.getImageLocation(); } else { @@ -426,29 +423,12 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr * Returns the image of this item or the image of the feed if this item does * not have its own image. */ - public FeedImage getImage() { - return (hasItemImage()) ? image : feed.getImage(); - } - - public void setImage(FeedImage image) { - this.image = image; - if (image != null) { - image.setOwner(this); - } - } - - /** - * Returns true if this FeedItem has its own image, false otherwise. - */ - public boolean hasItemImage() { - return image != null; + public String getImageUrl() { + return (imageUrl != null) ? imageUrl : feed.getImageUrl(); } - /** - * Returns true if this FeedItem has its own image and the image has been downloaded. - */ - public boolean hasItemImageDownloaded() { - return image != null && image.isDownloaded(); + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; } @Override 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 9c2266622..bfca04d60 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 @@ -55,7 +55,6 @@ import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.event.DownloadEvent; import de.danoeh.antennapod.core.event.FeedItemEvent; import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedPreferences; @@ -489,9 +488,7 @@ public class DownloadService extends Service { if (status.isSuccessful()) { successfulDownloads++; } else if (!status.isCancelled()) { - if (status.getFeedfileType() != FeedImage.FEEDFILETYPE_FEEDIMAGE) { - createReport = true; - } + createReport = true; failedDownloads++; } } @@ -688,10 +685,6 @@ public class DownloadService extends Service { Log.d(TAG, "Bundling " + results.size() + " feeds"); - for (Pair result : results) { - removeDuplicateImages(result.second.feed); // duplicate images have to removed because the DownloadRequester does not accept two downloads with the same download URL yet. - } - // Save information of feed in DB if (dbUpdateFuture != null) { try { @@ -1101,26 +1094,6 @@ public class DownloadService extends Service { } } - /** - * Checks if the FeedItems of this feed have images that point to the same URL. If two FeedItems - * have an image that points to the same URL, the reference of the second item is removed, so - * that every image reference is unique. - */ - @VisibleForTesting - static void removeDuplicateImages(Feed feed) { - Set known = new HashSet<>(); - for (FeedItem item : feed.getItems()) { - String url = item.hasItemImage() ? item.getImage().getDownload_url() : null; - if (url != null) { - if (known.contains(url)) { - item.setImage(null); - } else { - known.add(url); - } - } - } - } - private static String compileNotificationString(List downloads) { List lines = new ArrayList<>(downloads.size()); for (Downloader downloader : downloads) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java index 7ab0931d6..8cce02155 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java @@ -20,7 +20,6 @@ import java.util.Date; import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.R; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.util.DateUtils; import de.danoeh.antennapod.core.util.DownloadError; @@ -50,13 +49,8 @@ public class HttpDownloader extends Downloader { if (request.isDeleteOnFailure() && fileExists) { Log.w(TAG, "File already exists"); - if (request.getFeedfileType() != FeedImage.FEEDFILETYPE_FEEDIMAGE) { - onFail(DownloadError.ERROR_FILE_EXISTS, null); - return; - } else { - onSuccess(); - return; - } + onSuccess(); + return; } OkHttpClient.Builder httpClientBuilder = AntennapodHttpClient.newBuilder(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index fa87cc216..b090f30a1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -13,7 +13,6 @@ import java.util.Map; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedPreferences; @@ -213,13 +212,8 @@ public final class DBReader { result.add(item); itemIds.add(item.getId()); } while (cursor.moveToNext()); - Map images = getFeedImages(adapter, imageIds.toArray()); Map medias = getFeedMedia(adapter, itemIds); - for (int i = 0; i < result.size(); i++) { - FeedItem item = result.get(i); - long imageId = imageIds.get(i); - FeedImage image = images.get(imageId); - item.setImage(image); + for (FeedItem item : result) { FeedMedia media = medias.get(item.getId()); item.setMedia(media); if (media != null) { @@ -254,24 +248,9 @@ public final class DBReader { } private static Feed extractFeedFromCursorRow(PodDBAdapter adapter, Cursor cursor) { - final FeedImage image; - int indexImage = cursor.getColumnIndex(PodDBAdapter.KEY_IMAGE); - long imageId = cursor.getLong(indexImage); - if (imageId != 0) { - image = getFeedImage(adapter, imageId); - } else { - image = null; - } - Feed feed = Feed.fromCursor(cursor); - if (image != null) { - feed.setImage(image); - image.setOwner(feed); - } - FeedPreferences preferences = FeedPreferences.fromCursor(cursor); feed.setPreferences(preferences); - return feed; } @@ -838,62 +817,6 @@ public final class DBReader { } } - /** - * Searches the DB for a FeedImage of the given id. - * - * @param imageId The id of the object - * @return The found object - */ - public static FeedImage getFeedImage(final long imageId) { - Log.d(TAG, "getFeedImage() called with: " + "imageId = [" + imageId + "]"); - PodDBAdapter adapter = PodDBAdapter.getInstance(); - adapter.open(); - try { - return getFeedImage(adapter, imageId); - } finally { - adapter.close(); - } - } - - /** - * Searches the DB for a FeedImage of the given id. - * - * @param imageId The id of the object - * @return The found object - */ - private static FeedImage getFeedImage(PodDBAdapter adapter, final long imageId) { - return getFeedImages(adapter, imageId).get(imageId); - } - - /** - * Searches the DB for a FeedImage of the given id. - * - * @param imageIds The ids of the images - * @return Map that associates the id of an image with the image itself - */ - private static Map getFeedImages(PodDBAdapter adapter, final long... imageIds) { - String[] ids = new String[imageIds.length]; - for (int i = 0, len = imageIds.length; i < len; i++) { - ids[i] = String.valueOf(imageIds[i]); - } - Cursor cursor = adapter.getImageCursor(ids); - int imageCount = cursor.getCount(); - if (imageCount == 0) { - cursor.close(); - return Collections.emptyMap(); - } - Map result = new ArrayMap<>(imageCount); - try { - while (cursor.moveToNext()) { - FeedImage image = FeedImage.fromCursor(cursor); - result.put(image.getId(), image); - } - } finally { - cursor.close(); - } - return result; - } - /** * Searches the DB for a FeedMedia of the given id. * diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 8cdf82e15..1f4fad4ba 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -32,7 +32,6 @@ import de.danoeh.antennapod.core.event.QueueEvent; import de.danoeh.antennapod.core.feed.EventDistributor; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedEvent; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedPreferences; @@ -166,17 +165,6 @@ public class DBWriter { editor.commit(); } - // delete image file - if (feed.getImage() != null) { - if (feed.getImage().isDownloaded() - && feed.getImage().getFile_url() != null) { - File imageFile = new File(feed.getImage() - .getFile_url()); - imageFile.delete(); - } else if (requester.isDownloadingFile(feed.getImage())) { - requester.cancelDownload(context, feed.getImage()); - } - } // delete stored media files and mark them as read List queue = DBReader.getQueue(); List removed = new ArrayList<>(); @@ -200,16 +188,6 @@ public class DBWriter { && requester.isDownloadingFile(item.getMedia())) { requester.cancelDownload(context, item.getMedia()); } - - if (item.hasItemImage()) { - FeedImage image = item.getImage(); - if (image.isDownloaded() && image.getFile_url() != null) { - File imgFile = new File(image.getFile_url()); - imgFile.delete(); - } else if (requester.isDownloadingFile(image)) { - requester.cancelDownload(context, item.getImage()); - } - } } PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); @@ -785,21 +763,6 @@ public class DBWriter { }); } - /** - * Saves a FeedImage object in the database. This method will save all attributes of the FeedImage object. The - * contents of FeedComponent-attributes (e.g. the FeedImages's 'feed'-attribute) will not be saved. - * - * @param image The FeedImage object. - */ - public static Future setFeedImage(final FeedImage image) { - return dbExec.submit(() -> { - PodDBAdapter adapter = PodDBAdapter.getInstance(); - adapter.open(); - adapter.setImage(image); - adapter.close(); - }); - } - /** * Updates download URL of a feed */ diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index e82252310..bfce27ced 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -27,7 +27,6 @@ import de.danoeh.antennapod.core.event.ProgressEvent; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedComponent; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedPreferences; @@ -74,6 +73,7 @@ public class PodDBAdapter { public static final String KEY_SIZE = "filesize"; public static final String KEY_MIME_TYPE = "mime_type"; public static final String KEY_IMAGE = "image"; + public static final String KEY_IMAGE_URL = "image_url"; public static final String KEY_FEED = "feed"; private static final String KEY_MEDIA = "media"; public static final String KEY_DOWNLOADED = "downloaded"; @@ -388,12 +388,7 @@ public class PodDBAdapter { values.put(KEY_PAYMENT_LINK, feed.getPaymentLink()); values.put(KEY_AUTHOR, feed.getAuthor()); values.put(KEY_LANGUAGE, feed.getLanguage()); - if (feed.getImage() != null) { - if (feed.getImage().getId() == 0) { - setImage(feed.getImage()); - } - values.put(KEY_IMAGE, feed.getImage().getId()); - } + //TODO values.put(KEY_IMAGE_URL, feed.getImageUrl()); values.put(KEY_FILE_URL, feed.getFile_url()); values.put(KEY_DOWNLOAD_URL, feed.getDownload_url()); @@ -450,54 +445,7 @@ public class PodDBAdapter { } /** - * Inserts or updates an image entry - * - * @return the id of the entry - */ - public long setImage(FeedImage image) { - boolean startedTransaction = false; - - try { - if (!db.inTransaction()) { - db.beginTransactionNonExclusive(); - startedTransaction = true; - } - - ContentValues values = new ContentValues(); - values.put(KEY_TITLE, image.getTitle()); - values.put(KEY_DOWNLOAD_URL, image.getDownload_url()); - values.put(KEY_DOWNLOADED, image.isDownloaded()); - values.put(KEY_FILE_URL, image.getFile_url()); - if (image.getId() == 0) { - image.setId(db.insert(TABLE_NAME_FEED_IMAGES, null, values)); - } else { - db.update(TABLE_NAME_FEED_IMAGES, values, KEY_ID + "=?", - new String[]{String.valueOf(image.getId())}); - } - - final FeedComponent owner = image.getOwner(); - if (owner != null && owner.getId() != 0) { - values.clear(); - values.put(KEY_IMAGE, image.getId()); - if (owner instanceof Feed) { - db.update(TABLE_NAME_FEEDS, values, KEY_ID + "=?", new String[]{String.valueOf(image.getOwner().getId())}); - } - } - if (startedTransaction) { - db.setTransactionSuccessful(); - } - } catch (SQLException e) { - Log.e(TAG, Log.getStackTraceString(e)); - } finally { - if (startedTransaction) { - db.endTransaction(); - } - } - return image.getId(); - } - - /** - * Inserts or updates an image entry + * Inserts or updates a media entry * * @return the id of the entry */ @@ -759,12 +707,7 @@ public class PodDBAdapter { values.put(KEY_ITEM_IDENTIFIER, item.getItemIdentifier()); values.put(KEY_FLATTR_STATUS, item.getFlattrStatus().toLong()); values.put(KEY_AUTO_DOWNLOAD, item.getAutoDownload()); - if (item.hasItemImage()) { - if (item.getImage().getId() == 0) { - setImage(item.getImage()); - } - values.put(KEY_IMAGE, item.getImage().getId()); - } + values.put(KEY_IMAGE_URL, item.getImageUrl()); if (item.getId() == 0) { item.setId(db.insert(TABLE_NAME_FEED_ITEMS, null, values)); @@ -993,11 +936,6 @@ public class PodDBAdapter { new String[]{String.valueOf(item.getId())}); } - private void removeFeedImage(FeedImage image) { - db.delete(TABLE_NAME_FEED_IMAGES, KEY_ID + "=?", - new String[]{String.valueOf(image.getId())}); - } - /** * Remove a FeedItem and its FeedMedia entry. */ @@ -1008,9 +946,6 @@ public class PodDBAdapter { if (item.hasChapters() || item.getChapters() != null) { removeChaptersOfItem(item); } - if (item.hasItemImage()) { - removeFeedImage(item.getImage()); - } db.delete(TABLE_NAME_FEED_ITEMS, KEY_ID + "=?", new String[]{String.valueOf(item.getId())}); } @@ -1021,9 +956,6 @@ public class PodDBAdapter { public void removeFeed(Feed feed) { try { db.beginTransactionNonExclusive(); - if (feed.getImage() != null) { - removeFeedImage(feed.getImage()); - } if (feed.getItems() != null) { for (FeedItem item : feed.getItems()) { removeFeedItem(item); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java index 670e99fce..18af0800f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java @@ -7,7 +7,6 @@ import org.xml.sax.Attributes; import java.util.concurrent.TimeUnit; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.syndication.handler.HandlerState; public class NSITunes extends Namespace { @@ -16,7 +15,6 @@ public class NSITunes extends Namespace { public static final String NSURI = "http://www.itunes.com/dtds/podcast-1.0.dtd"; private static final String IMAGE = "image"; - private static final String IMAGE_TITLE = "image"; private static final String IMAGE_HREF = "href"; private static final String AUTHOR = "author"; @@ -29,21 +27,15 @@ public class NSITunes extends Namespace { public SyndElement handleElementStart(String localName, HandlerState state, Attributes attributes) { if (IMAGE.equals(localName)) { - FeedImage image = new FeedImage(); - image.setTitle(IMAGE_TITLE); - image.setDownload_url(attributes.getValue(IMAGE_HREF)); + String url = attributes.getValue(IMAGE_HREF); if (state.getCurrentItem() != null) { - // this is an items image - image.setTitle(state.getCurrentItem().getTitle() + IMAGE_TITLE); - image.setOwner(state.getCurrentItem()); - state.getCurrentItem().setImage(image); + state.getCurrentItem().setImageUrl(url); } else { // this is the feed image // prefer to all other images - if (!TextUtils.isEmpty(image.getDownload_url())) { - image.setOwner(state.getFeed()); - state.getFeed().setImage(image); + if (!TextUtils.isEmpty(url)) { + state.getFeed().setImageUrl(url); } } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java index f2cfc2e57..638383223 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSMedia.java @@ -7,7 +7,6 @@ import org.xml.sax.Attributes; import java.util.concurrent.TimeUnit; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.syndication.handler.HandlerState; import de.danoeh.antennapod.core.syndication.namespace.atom.AtomText; @@ -94,25 +93,16 @@ public class NSMedia extends Namespace { } state.getCurrentItem().setMedia(media); } else if (state.getCurrentItem() != null && url != null && validTypeImage) { - FeedImage image = new FeedImage(); - image.setDownload_url(url); - image.setOwner(state.getCurrentItem()); - - state.getCurrentItem().setImage(image); + state.getCurrentItem().setImageUrl(url); } } else if (IMAGE.equals(localName)) { String url = attributes.getValue(IMAGE_URL); if (url != null) { - FeedImage image = new FeedImage(); - image.setDownload_url(url); - if (state.getCurrentItem() != null) { - image.setOwner(state.getCurrentItem()); - state.getCurrentItem().setImage(image); + state.getCurrentItem().setImageUrl(url); } else { - if (state.getFeed().getImage() == null) { - image.setOwner(state.getFeed()); - state.getFeed().setImage(image); + if (state.getFeed().getImageUrl() == null) { + state.getFeed().setImageUrl(url); } } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java index 3d752df76..a1100a976 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSRSS20.java @@ -6,7 +6,6 @@ import android.util.Log; import org.xml.sax.Attributes; import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.syndication.handler.HandlerState; @@ -77,17 +76,6 @@ public class NSRSS20 extends Namespace { state.getCurrentItem().setMedia(media); } - } else if (IMAGE.equals(localName)) { - if (state.getTagstack().size() >= 1) { - String parent = state.getTagstack().peek().getName(); - if (CHANNEL.equals(parent)) { - Feed feed = state.getFeed(); - if(feed != null && feed.getImage() == null) { - feed.setImage(new FeedImage()); - feed.getImage().setOwner(state.getFeed()); - } - } - } } return new SyndElement(localName, this); } @@ -134,11 +122,6 @@ public class NSRSS20 extends Namespace { state.getCurrentItem().setTitle(title); } else if (CHANNEL.equals(second) && state.getFeed() != null) { state.getFeed().setTitle(title); - } else if (IMAGE.equals(second) && CHANNEL.equals(third)) { - if(state.getFeed() != null && state.getFeed().getImage() != null && - state.getFeed().getImage().getTitle() == null) { - state.getFeed().getImage().setTitle(title); - } } } else if (LINK.equals(top)) { if (CHANNEL.equals(second) && state.getFeed() != null) { @@ -150,9 +133,8 @@ public class NSRSS20 extends Namespace { state.getCurrentItem().setPubDate(DateUtils.parse(content)); } else if (URL.equals(top) && IMAGE.equals(second) && CHANNEL.equals(third)) { // prefer itunes:image - if(state.getFeed() != null && state.getFeed().getImage() != null && - state.getFeed().getImage().getDownload_url() == null) { - state.getFeed().getImage().setDownload_url(content); + if (state.getFeed() != null) { + state.getFeed().setImageUrl(content); } } else if (DESCR.equals(localName)) { if (CHANNEL.equals(second) && state.getFeed() != null) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java index 1fe388d9d..aab1b1a5b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/NSAtom.java @@ -5,7 +5,6 @@ import android.util.Log; import org.xml.sax.Attributes; -import de.danoeh.antennapod.core.feed.FeedImage; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.syndication.handler.HandlerState; @@ -210,10 +209,10 @@ public class NSAtom extends Namespace { state.getCurrentItem().setPubDate(DateUtils.parse(content)); } else if (PUBLISHED.equals(top) && ENTRY.equals(second) && state.getCurrentItem() != null) { state.getCurrentItem().setPubDate(DateUtils.parse(content)); - } else if (IMAGE_LOGO.equals(top) && state.getFeed() != null && state.getFeed().getImage() == null) { - state.getFeed().setImage(new FeedImage(state.getFeed(), content, null)); + } else if (IMAGE_LOGO.equals(top) && state.getFeed() != null && state.getFeed().getImageUrl() == null) { + state.getFeed().setImageUrl(content); } else if (IMAGE_ICON.equals(top) && state.getFeed() != null) { - state.getFeed().setImage(new FeedImage(state.getFeed(), content, null)); + state.getFeed().setImageUrl(content); } else if (AUTHOR_NAME.equals(top) && AUTHOR.equals(second) && state.getFeed() != null && state.getCurrentItem() == null) { String currentName = state.getFeed().getAuthor(); -- cgit v1.2.3 From abb13dc447f3ab4663507cd23a5bca0a39263874 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 00:07:21 +0200 Subject: Database scheme update --- .../antennapod/core/storage/PodDBAdapter.java | 30 +++++++++------------- 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index bfce27ced..4b86536d8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -133,7 +133,7 @@ public class PodDBAdapter { + KEY_DOWNLOADED + " INTEGER," + KEY_LINK + " TEXT," + KEY_DESCRIPTION + " TEXT," + KEY_PAYMENT_LINK + " TEXT," + KEY_LASTUPDATE + " TEXT," + KEY_LANGUAGE + " TEXT," + KEY_AUTHOR - + " TEXT," + KEY_IMAGE + " INTEGER," + KEY_TYPE + " TEXT," + + " TEXT," + KEY_IMAGE_URL + " TEXT," + KEY_TYPE + " TEXT," + KEY_FEED_IDENTIFIER + " TEXT," + KEY_AUTO_DOWNLOAD + " INTEGER DEFAULT 1," + KEY_FLATTR_STATUS + " INTEGER," + KEY_USERNAME + " TEXT," @@ -155,14 +155,9 @@ public class PodDBAdapter { + KEY_MEDIA + " INTEGER," + KEY_FEED + " INTEGER," + KEY_HAS_CHAPTERS + " INTEGER," + KEY_ITEM_IDENTIFIER + " TEXT," + KEY_FLATTR_STATUS + " INTEGER," - + KEY_IMAGE + " INTEGER," + + KEY_IMAGE_URL + " TEXT," + KEY_AUTO_DOWNLOAD + " INTEGER)"; - private static final String CREATE_TABLE_FEED_IMAGES = "CREATE TABLE " - + TABLE_NAME_FEED_IMAGES + " (" + TABLE_PRIMARY_KEY + KEY_TITLE - + " TEXT," + KEY_FILE_URL + " TEXT," + KEY_DOWNLOAD_URL + " TEXT," - + KEY_DOWNLOADED + " INTEGER)"; - private static final String CREATE_TABLE_FEED_MEDIA = "CREATE TABLE " + TABLE_NAME_FEED_MEDIA + " (" + TABLE_PRIMARY_KEY + KEY_DURATION + " INTEGER," + KEY_FILE_URL + " TEXT," + KEY_DOWNLOAD_URL @@ -195,10 +190,6 @@ public class PodDBAdapter { + TABLE_NAME_FEED_ITEMS + "_" + KEY_FEED + " ON " + TABLE_NAME_FEED_ITEMS + " (" + KEY_FEED + ")"; - private static final String CREATE_INDEX_FEEDITEMS_IMAGE = "CREATE INDEX " - + TABLE_NAME_FEED_ITEMS + "_" + KEY_IMAGE + " ON " + TABLE_NAME_FEED_ITEMS + " (" - + KEY_IMAGE + ")"; - private static final String CREATE_INDEX_FEEDITEMS_PUBDATE = "CREATE INDEX IF NOT EXISTS " + TABLE_NAME_FEED_ITEMS + "_" + KEY_PUBDATE + " ON " + TABLE_NAME_FEED_ITEMS + " (" + KEY_PUBDATE + ")"; @@ -240,7 +231,7 @@ public class PodDBAdapter { TABLE_NAME_FEEDS + "." + KEY_LASTUPDATE, TABLE_NAME_FEEDS + "." + KEY_LANGUAGE, TABLE_NAME_FEEDS + "." + KEY_AUTHOR, - TABLE_NAME_FEEDS + "." + KEY_IMAGE, + TABLE_NAME_FEEDS + "." + KEY_IMAGE_URL, TABLE_NAME_FEEDS + "." + KEY_TYPE, TABLE_NAME_FEEDS + "." + KEY_FEED_IDENTIFIER, TABLE_NAME_FEEDS + "." + KEY_AUTO_DOWNLOAD, @@ -273,7 +264,7 @@ public class PodDBAdapter { TABLE_NAME_FEED_ITEMS + "." + KEY_HAS_CHAPTERS, TABLE_NAME_FEED_ITEMS + "." + KEY_ITEM_IDENTIFIER, TABLE_NAME_FEED_ITEMS + "." + KEY_FLATTR_STATUS, - TABLE_NAME_FEED_ITEMS + "." + KEY_IMAGE, + TABLE_NAME_FEED_ITEMS + "." + KEY_IMAGE_URL, TABLE_NAME_FEED_ITEMS + "." + KEY_AUTO_DOWNLOAD }; @@ -283,7 +274,6 @@ public class PodDBAdapter { private static final String[] ALL_TABLES = { TABLE_NAME_FEEDS, TABLE_NAME_FEED_ITEMS, - TABLE_NAME_FEED_IMAGES, TABLE_NAME_FEED_MEDIA, TABLE_NAME_DOWNLOAD_LOG, TABLE_NAME_QUEUE, @@ -1604,7 +1594,7 @@ public class PodDBAdapter { */ private static class PodDBHelper extends SQLiteOpenHelper { - private static final int VERSION = 1060200; + private static final int VERSION = 1060596; private final Context context; @@ -1625,7 +1615,6 @@ public class PodDBAdapter { public void onCreate(final SQLiteDatabase db) { db.execSQL(CREATE_TABLE_FEEDS); db.execSQL(CREATE_TABLE_FEED_ITEMS); - db.execSQL(CREATE_TABLE_FEED_IMAGES); db.execSQL(CREATE_TABLE_FEED_MEDIA); db.execSQL(CREATE_TABLE_DOWNLOAD_LOG); db.execSQL(CREATE_TABLE_QUEUE); @@ -1633,7 +1622,6 @@ public class PodDBAdapter { db.execSQL(CREATE_TABLE_FAVORITES); db.execSQL(CREATE_INDEX_FEEDITEMS_FEED); - db.execSQL(CREATE_INDEX_FEEDITEMS_IMAGE); db.execSQL(CREATE_INDEX_FEEDITEMS_PUBDATE); db.execSQL(CREATE_INDEX_FEEDITEMS_READ); db.execSQL(CREATE_INDEX_FEEDMEDIA_FEEDITEM); @@ -1770,7 +1758,6 @@ public class PodDBAdapter { // create indexes db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_FEED); - db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_IMAGE); db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDMEDIA_FEEDITEM); db.execSQL(PodDBAdapter.CREATE_INDEX_QUEUE_FEEDITEM); db.execSQL(PodDBAdapter.CREATE_INDEX_SIMPLECHAPTERS_FEEDITEM); @@ -1904,6 +1891,13 @@ public class PodDBAdapter { db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " + PodDBAdapter.KEY_CUSTOM_TITLE + " TEXT"); } + if (oldVersion < 1060596) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_IMAGE_URL + " TEXT"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_IMAGE_URL + " TEXT"); + db.execSQL("DROP TABLE " + PodDBAdapter.TABLE_NAME_FEED_IMAGES); + } EventBus.getDefault().post(ProgressEvent.end()); } -- cgit v1.2.3 From eba0817ee047272d8d8a8ef7f5392638bae40741 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 00:08:22 +0200 Subject: Prevent crash --- core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java | 5 ----- 1 file changed, 5 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index b090f30a1..5eb5145e8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -200,14 +200,9 @@ public final class DBReader { private static List extractItemlistFromCursor(PodDBAdapter adapter, Cursor cursor) { List result = new ArrayList<>(cursor.getCount()); - LongList imageIds = new LongList(cursor.getCount()); LongList itemIds = new LongList(cursor.getCount()); if (cursor.moveToFirst()) { do { - int indexImage = cursor.getColumnIndex(PodDBAdapter.KEY_IMAGE); - long imageId = cursor.getLong(indexImage); - imageIds.add(imageId); - FeedItem item = FeedItem.fromCursor(cursor); result.add(item); itemIds.add(item.getId()); -- cgit v1.2.3 From fa4807617598a83619b49a85c5c0eeb915a9526b Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 00:15:19 +0200 Subject: Write feed url to database --- core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java | 3 ++- core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java | 4 +++- .../src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java index 4f0659a64..3395653f3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java @@ -191,6 +191,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { int indexNextPageLink = cursor.getColumnIndex(PodDBAdapter.KEY_NEXT_PAGE_LINK); int indexHide = cursor.getColumnIndex(PodDBAdapter.KEY_HIDE); int indexLastUpdateFailed = cursor.getColumnIndex(PodDBAdapter.KEY_LAST_UPDATE_FAILED); + int indexImageUrl = cursor.getColumnIndex(PodDBAdapter.KEY_IMAGE_URL); Feed feed = new Feed( cursor.getLong(indexId), @@ -204,7 +205,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource { cursor.getString(indexLanguage), cursor.getString(indexType), cursor.getString(indexFeedIdentifier), - null, + cursor.getString(indexImageUrl), cursor.getString(indexFileUrl), cursor.getString(indexDownloadUrl), cursor.getInt(indexDownloaded) > 0, diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java index d6a6996fe..b0a87c885 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java @@ -158,6 +158,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr int indexRead = cursor.getColumnIndex(PodDBAdapter.KEY_READ); int indexItemIdentifier = cursor.getColumnIndex(PodDBAdapter.KEY_ITEM_IDENTIFIER); int indexAutoDownload = cursor.getColumnIndex(PodDBAdapter.KEY_AUTO_DOWNLOAD); + int indexImageUrl = cursor.getColumnIndex(PodDBAdapter.KEY_IMAGE_URL); long id = cursor.getInt(indexId); String title = cursor.getString(indexTitle); @@ -170,9 +171,10 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr int state = cursor.getInt(indexRead); String itemIdentifier = cursor.getString(indexItemIdentifier); long autoDownload = cursor.getLong(indexAutoDownload); + String imageUrl = cursor.getString(indexImageUrl); return new FeedItem(id, title, link, pubDate, paymentLink, feedId, flattrStatus, - hasChapters, null, state, itemIdentifier, autoDownload); + hasChapters, imageUrl, state, itemIdentifier, autoDownload); } public void updateFromOther(FeedItem other) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 4b86536d8..ffd44e73a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -378,7 +378,7 @@ public class PodDBAdapter { values.put(KEY_PAYMENT_LINK, feed.getPaymentLink()); values.put(KEY_AUTHOR, feed.getAuthor()); values.put(KEY_LANGUAGE, feed.getLanguage()); - //TODO values.put(KEY_IMAGE_URL, feed.getImageUrl()); + values.put(KEY_IMAGE_URL, feed.getImageUrl()); values.put(KEY_FILE_URL, feed.getFile_url()); values.put(KEY_DOWNLOAD_URL, feed.getDownload_url()); -- cgit v1.2.3 From 9b738ca5d47c7e47b691e900381eea27cf2ba34d Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 14:52:50 +0200 Subject: Fixed feed item display --- .../antennapod/core/storage/PodDBAdapter.java | 29 ++++++++-------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index ffd44e73a..7289a3352 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -14,19 +14,10 @@ import android.database.sqlite.SQLiteOpenHelper; import android.media.MediaMetadataRetriever; import android.text.TextUtils; import android.util.Log; - -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Set; - import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.event.ProgressEvent; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.feed.Feed; -import de.danoeh.antennapod.core.feed.FeedComponent; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedPreferences; @@ -37,6 +28,13 @@ import de.danoeh.antennapod.core.util.flattr.FlattrStatus; import de.greenrobot.event.EventBus; import org.apache.commons.io.FileUtils; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Set; + // TODO Remove media column from feeditem table /** @@ -1285,17 +1283,10 @@ public class PodDBAdapter { public Cursor getImageAuthenticationCursor(final String imageUrl) { String downloadUrl = DatabaseUtils.sqlEscapeString(imageUrl); final String query = "" - + "SELECT " + KEY_USERNAME + "," + KEY_PASSWORD + " FROM " + TABLE_NAME_FEED_IMAGES + + "SELECT " + KEY_USERNAME + "," + KEY_PASSWORD + " FROM " + TABLE_NAME_FEED_ITEMS + " INNER JOIN " + TABLE_NAME_FEEDS - + " ON " + TABLE_NAME_FEED_IMAGES + "." + KEY_ID + "=" + TABLE_NAME_FEEDS + "." + KEY_IMAGE - + " WHERE " + TABLE_NAME_FEED_IMAGES + "." + KEY_DOWNLOAD_URL + "=" + downloadUrl - + " UNION SELECT " + KEY_USERNAME + "," + KEY_PASSWORD - + " FROM " + TABLE_NAME_FEED_IMAGES - + " INNER JOIN " + TABLE_NAME_FEED_ITEMS - + " ON " + TABLE_NAME_FEED_IMAGES + "." + KEY_ID + "=" + TABLE_NAME_FEED_ITEMS + "." + KEY_IMAGE - + " INNER JOIN " + TABLE_NAME_FEEDS - + " ON " + TABLE_NAME_FEED_ITEMS + "." + KEY_FEED + "=" + TABLE_NAME_FEEDS + "." + KEY_ID - + " WHERE " + TABLE_NAME_FEED_IMAGES + "." + KEY_DOWNLOAD_URL + "=" + downloadUrl; + + " ON " + TABLE_NAME_FEED_ITEMS + "." + KEY_FEED + " = " + TABLE_NAME_FEEDS + "." + KEY_ID + + " WHERE " + TABLE_NAME_FEED_ITEMS + "." + KEY_IMAGE_URL + "=" + downloadUrl; return db.rawQuery(query, null); } -- cgit v1.2.3 From e15451177bf7fd5770d965e7210f59981d467a58 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 15:17:39 +0200 Subject: Moved database upgrades to their own class --- .../danoeh/antennapod/core/storage/DBUpgrader.java | 273 +++++++++++++++++++ .../antennapod/core/storage/PodDBAdapter.java | 292 ++------------------- 2 files changed, 291 insertions(+), 274 deletions(-) create mode 100644 core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java new file mode 100644 index 000000000..f2451b66c --- /dev/null +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java @@ -0,0 +1,273 @@ +package de.danoeh.antennapod.core.storage; + +import android.content.ContentValues; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.media.MediaMetadataRetriever; +import android.util.Log; +import de.danoeh.antennapod.core.feed.FeedItem; + +class DBUpgrader { + /** + * Upgrades the given database to a new schema version + */ + static void upgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { + if (oldVersion <= 1) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " + + PodDBAdapter.KEY_TYPE + " TEXT"); + } + if (oldVersion <= 2) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS + + " ADD COLUMN " + PodDBAdapter.KEY_LINK + " TEXT"); + } + if (oldVersion <= 3) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_ITEM_IDENTIFIER + " TEXT"); + } + if (oldVersion <= 4) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " + + PodDBAdapter.KEY_FEED_IDENTIFIER + " TEXT"); + } + if (oldVersion <= 5) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG + + " ADD COLUMN " + PodDBAdapter.KEY_REASON_DETAILED + " TEXT"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG + + " ADD COLUMN " + PodDBAdapter.KEY_DOWNLOADSTATUS_TITLE + " TEXT"); + } + if (oldVersion <= 6) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS + + " ADD COLUMN " + PodDBAdapter.KEY_CHAPTER_TYPE + " INTEGER"); + } + if (oldVersion <= 7) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_PLAYBACK_COMPLETION_DATE + + " INTEGER"); + } + if (oldVersion <= 8) { + final int KEY_ID_POSITION = 0; + final int KEY_MEDIA_POSITION = 1; + + // Add feeditem column to feedmedia table + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_FEEDITEM + + " INTEGER"); + Cursor feeditemCursor = db.query(PodDBAdapter.TABLE_NAME_FEED_ITEMS, + new String[]{PodDBAdapter.KEY_ID, PodDBAdapter.KEY_MEDIA}, "? > 0", + new String[]{PodDBAdapter.KEY_MEDIA}, null, null, null); + if (feeditemCursor.moveToFirst()) { + db.beginTransaction(); + ContentValues contentValues = new ContentValues(); + do { + long mediaId = feeditemCursor.getLong(KEY_MEDIA_POSITION); + contentValues.put(PodDBAdapter.KEY_FEEDITEM, feeditemCursor.getLong(KEY_ID_POSITION)); + db.update(PodDBAdapter.TABLE_NAME_FEED_MEDIA, contentValues, PodDBAdapter.KEY_ID + "=?", new String[]{String.valueOf(mediaId)}); + contentValues.clear(); + } while (feeditemCursor.moveToNext()); + db.setTransactionSuccessful(); + db.endTransaction(); + } + feeditemCursor.close(); + } + if (oldVersion <= 9) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_AUTO_DOWNLOAD + + " INTEGER DEFAULT 1"); + } + if (oldVersion <= 10) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_FLATTR_STATUS + + " INTEGER"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_FLATTR_STATUS + + " INTEGER"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_PLAYED_DURATION + + " INTEGER"); + } + if (oldVersion <= 11) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_USERNAME + + " TEXT"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_PASSWORD + + " TEXT"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_IMAGE + + " INTEGER"); + } + if (oldVersion <= 12) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_IS_PAGED + " INTEGER DEFAULT 0"); + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_NEXT_PAGE_LINK + " TEXT"); + } + if (oldVersion <= 13) { + // remove duplicate rows in "Chapters" table that were created because of a bug. + db.execSQL(String.format("DELETE FROM %s WHERE %s NOT IN " + + "(SELECT MIN(%s) as %s FROM %s GROUP BY %s,%s,%s,%s,%s)", + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS, + PodDBAdapter.KEY_ID, + PodDBAdapter.KEY_ID, + PodDBAdapter.KEY_ID, + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS, + PodDBAdapter.KEY_TITLE, + PodDBAdapter.KEY_START, + PodDBAdapter.KEY_FEEDITEM, + PodDBAdapter.KEY_LINK, + PodDBAdapter.KEY_CHAPTER_TYPE)); + } + if (oldVersion <= 14) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " ADD COLUMN " + PodDBAdapter.KEY_AUTO_DOWNLOAD + " INTEGER"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " SET " + PodDBAdapter.KEY_AUTO_DOWNLOAD + " = " + + "(SELECT " + PodDBAdapter.KEY_AUTO_DOWNLOAD + + " FROM " + PodDBAdapter.TABLE_NAME_FEEDS + + " WHERE " + PodDBAdapter.TABLE_NAME_FEEDS + "." + PodDBAdapter.KEY_ID + + " = " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + PodDBAdapter.KEY_FEED + ")"); + + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_HIDE + " TEXT"); + + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_LAST_UPDATE_FAILED + " INTEGER DEFAULT 0"); + + // create indexes + db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_FEED); + db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_IMAGE); + db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDMEDIA_FEEDITEM); + db.execSQL(PodDBAdapter.CREATE_INDEX_QUEUE_FEEDITEM); + db.execSQL(PodDBAdapter.CREATE_INDEX_SIMPLECHAPTERS_FEEDITEM); + } + if (oldVersion <= 15) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_HAS_EMBEDDED_PICTURE + " INTEGER DEFAULT -1"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " SET " + PodDBAdapter.KEY_HAS_EMBEDDED_PICTURE + "=0" + + " WHERE " + PodDBAdapter.KEY_DOWNLOADED + "=0"); + Cursor c = db.rawQuery("SELECT " + PodDBAdapter.KEY_FILE_URL + + " FROM " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " WHERE " + PodDBAdapter.KEY_DOWNLOADED + "=1 " + + " AND " + PodDBAdapter.KEY_HAS_EMBEDDED_PICTURE + "=-1", null); + if (c.moveToFirst()) { + MediaMetadataRetriever mmr = new MediaMetadataRetriever(); + do { + String fileUrl = c.getString(0); + try { + mmr.setDataSource(fileUrl); + byte[] image = mmr.getEmbeddedPicture(); + if (image != null) { + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " SET " + PodDBAdapter.KEY_HAS_EMBEDDED_PICTURE + "=1" + + " WHERE " + PodDBAdapter.KEY_FILE_URL + "='" + fileUrl + "'"); + } else { + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " SET " + PodDBAdapter.KEY_HAS_EMBEDDED_PICTURE + "=0" + + " WHERE " + PodDBAdapter.KEY_FILE_URL + "='" + fileUrl + "'"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } while (c.moveToNext()); + } + c.close(); + } + if (oldVersion <= 16) { + String selectNew = "SELECT " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + PodDBAdapter.KEY_ID + + " FROM " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " INNER JOIN " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + " ON " + + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + PodDBAdapter.KEY_ID + "=" + + PodDBAdapter.TABLE_NAME_FEED_MEDIA + "." + PodDBAdapter.KEY_FEEDITEM + + " LEFT OUTER JOIN " + PodDBAdapter.TABLE_NAME_QUEUE + " ON " + + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + PodDBAdapter.KEY_ID + "=" + + PodDBAdapter.TABLE_NAME_QUEUE + "." + PodDBAdapter.KEY_FEEDITEM + + " WHERE " + + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + PodDBAdapter.KEY_READ + " = 0 AND " // unplayed + + PodDBAdapter.TABLE_NAME_FEED_MEDIA + "." + PodDBAdapter.KEY_DOWNLOADED + " = 0 AND " // undownloaded + + PodDBAdapter.TABLE_NAME_FEED_MEDIA + "." + PodDBAdapter.KEY_POSITION + " = 0 AND " // not partially played + + PodDBAdapter.TABLE_NAME_QUEUE + "." + PodDBAdapter.KEY_ID + " IS NULL"; // not in queue + String sql = "UPDATE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + + " SET " + PodDBAdapter.KEY_READ + "=" + FeedItem.NEW + + " WHERE " + PodDBAdapter.KEY_ID + " IN (" + selectNew + ")"; + Log.d("Migration", "SQL: " + sql); + db.execSQL(sql); + } + if (oldVersion <= 17) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_AUTO_DELETE_ACTION + " INTEGER DEFAULT 0"); + } + if (oldVersion < 1030005) { + db.execSQL("UPDATE FeedItems SET auto_download=0 WHERE " + + "(read=1 OR id IN (SELECT feeditem FROM FeedMedia WHERE position>0 OR downloaded=1)) " + + "AND id NOT IN (SELECT feeditem FROM Queue)"); + } + if (oldVersion < 1040001) { + db.execSQL(PodDBAdapter.CREATE_TABLE_FAVORITES); + } + if (oldVersion < 1040002) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + + " ADD COLUMN " + PodDBAdapter.KEY_LAST_PLAYED_TIME + " INTEGER DEFAULT 0"); + } + if (oldVersion < 1040013) { + db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_PUBDATE); + db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_READ); + } + if (oldVersion < 1050003) { + // Migrates feed list filter data + + db.beginTransaction(); + + // Change to intermediate values to avoid overwriting in the following find/replace + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'unplayed', 'noplay')"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'not_queued', 'noqueue')"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'not_downloaded', 'nodl')"); + + // Replace played, queued, and downloaded with their opposites + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'played', 'unplayed')"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'queued', 'not_queued')"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'downloaded', 'not_downloaded')"); + + // Now replace intermediates for unplayed, not queued, etc. with their opposites + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'noplay', 'played')"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'noqueue', 'queued')"); + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'nodl', 'downloaded')"); + + // Paused doesn't have an opposite, so unplayed is the next best option + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + "\n" + + "SET " + PodDBAdapter.KEY_HIDE + " = replace(" + PodDBAdapter.KEY_HIDE + ", 'paused', 'unplayed')"); + + db.setTransactionSuccessful(); + db.endTransaction(); + + // and now get ready for autodownload filters + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_INCLUDE_FILTER + " TEXT DEFAULT ''"); + + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_EXCLUDE_FILTER + " TEXT DEFAULT ''"); + + // and now auto refresh + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_KEEP_UPDATED + " INTEGER DEFAULT 1"); + } + if (oldVersion < 1050004) { + // prevent old timestamps to be misinterpreted as ETags + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + + " SET " + PodDBAdapter.KEY_LASTUPDATE + "=NULL"); + } + if (oldVersion < 1060200) { + db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + + " ADD COLUMN " + PodDBAdapter.KEY_CUSTOM_TITLE + " TEXT"); + } + } + +} diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index e82252310..db1e63aee 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -75,7 +75,7 @@ public class PodDBAdapter { public static final String KEY_MIME_TYPE = "mime_type"; public static final String KEY_IMAGE = "image"; public static final String KEY_FEED = "feed"; - private static final String KEY_MEDIA = "media"; + public static final String KEY_MEDIA = "media"; public static final String KEY_DOWNLOADED = "downloaded"; public static final String KEY_LASTUPDATE = "last_update"; public static final String KEY_FEEDFILE = "feedfile"; @@ -114,14 +114,14 @@ public class PodDBAdapter { public static final String KEY_EXCLUDE_FILTER = "exclude_filter"; // Table names - private static final String TABLE_NAME_FEEDS = "Feeds"; - private static final String TABLE_NAME_FEED_ITEMS = "FeedItems"; - private static final String TABLE_NAME_FEED_IMAGES = "FeedImages"; - private static final String TABLE_NAME_FEED_MEDIA = "FeedMedia"; - private static final String TABLE_NAME_DOWNLOAD_LOG = "DownloadLog"; - private static final String TABLE_NAME_QUEUE = "Queue"; - private static final String TABLE_NAME_SIMPLECHAPTERS = "SimpleChapters"; - private static final String TABLE_NAME_FAVORITES = "Favorites"; + static final String TABLE_NAME_FEEDS = "Feeds"; + static final String TABLE_NAME_FEED_ITEMS = "FeedItems"; + static final String TABLE_NAME_FEED_IMAGES = "FeedImages"; + static final String TABLE_NAME_FEED_MEDIA = "FeedMedia"; + static final String TABLE_NAME_DOWNLOAD_LOG = "DownloadLog"; + static final String TABLE_NAME_QUEUE = "Queue"; + static final String TABLE_NAME_SIMPLECHAPTERS = "SimpleChapters"; + static final String TABLE_NAME_FAVORITES = "Favorites"; // SQL Statements for creating new tables private static final String TABLE_PRIMARY_KEY = KEY_ID @@ -191,36 +191,36 @@ public class PodDBAdapter { + KEY_LINK + " TEXT," + KEY_CHAPTER_TYPE + " INTEGER)"; // SQL Statements for creating indexes - private static final String CREATE_INDEX_FEEDITEMS_FEED = "CREATE INDEX " + static final String CREATE_INDEX_FEEDITEMS_FEED = "CREATE INDEX " + TABLE_NAME_FEED_ITEMS + "_" + KEY_FEED + " ON " + TABLE_NAME_FEED_ITEMS + " (" + KEY_FEED + ")"; - private static final String CREATE_INDEX_FEEDITEMS_IMAGE = "CREATE INDEX " + static final String CREATE_INDEX_FEEDITEMS_IMAGE = "CREATE INDEX " + TABLE_NAME_FEED_ITEMS + "_" + KEY_IMAGE + " ON " + TABLE_NAME_FEED_ITEMS + " (" + KEY_IMAGE + ")"; - private static final String CREATE_INDEX_FEEDITEMS_PUBDATE = "CREATE INDEX IF NOT EXISTS " + static final String CREATE_INDEX_FEEDITEMS_PUBDATE = "CREATE INDEX IF NOT EXISTS " + TABLE_NAME_FEED_ITEMS + "_" + KEY_PUBDATE + " ON " + TABLE_NAME_FEED_ITEMS + " (" + KEY_PUBDATE + ")"; - private static final String CREATE_INDEX_FEEDITEMS_READ = "CREATE INDEX IF NOT EXISTS " + static final String CREATE_INDEX_FEEDITEMS_READ = "CREATE INDEX IF NOT EXISTS " + TABLE_NAME_FEED_ITEMS + "_" + KEY_READ + " ON " + TABLE_NAME_FEED_ITEMS + " (" + KEY_READ + ")"; - private static final String CREATE_INDEX_QUEUE_FEEDITEM = "CREATE INDEX " + static final String CREATE_INDEX_QUEUE_FEEDITEM = "CREATE INDEX " + TABLE_NAME_QUEUE + "_" + KEY_FEEDITEM + " ON " + TABLE_NAME_QUEUE + " (" + KEY_FEEDITEM + ")"; - private static final String CREATE_INDEX_FEEDMEDIA_FEEDITEM = "CREATE INDEX " + static final String CREATE_INDEX_FEEDMEDIA_FEEDITEM = "CREATE INDEX " + TABLE_NAME_FEED_MEDIA + "_" + KEY_FEEDITEM + " ON " + TABLE_NAME_FEED_MEDIA + " (" + KEY_FEEDITEM + ")"; - private static final String CREATE_INDEX_SIMPLECHAPTERS_FEEDITEM = "CREATE INDEX " + static final String CREATE_INDEX_SIMPLECHAPTERS_FEEDITEM = "CREATE INDEX " + TABLE_NAME_SIMPLECHAPTERS + "_" + KEY_FEEDITEM + " ON " + TABLE_NAME_SIMPLECHAPTERS + " (" + KEY_FEEDITEM + ")"; - private static final String CREATE_TABLE_FAVORITES = "CREATE TABLE " + static final String CREATE_TABLE_FAVORITES = "CREATE TABLE " + TABLE_NAME_FAVORITES + "(" + KEY_ID + " INTEGER PRIMARY KEY," + KEY_FEEDITEM + " INTEGER," + KEY_FEED + " INTEGER)"; @@ -1716,263 +1716,7 @@ public class PodDBAdapter { EventBus.getDefault().post(ProgressEvent.start(context.getString(R.string.progress_upgrading_database))); Log.w("DBAdapter", "Upgrading from version " + oldVersion + " to " + newVersion + "."); - if (oldVersion <= 1) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " - + KEY_TYPE + " TEXT"); - } - if (oldVersion <= 2) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS - + " ADD COLUMN " + KEY_LINK + " TEXT"); - } - if (oldVersion <= 3) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS - + " ADD COLUMN " + KEY_ITEM_IDENTIFIER + " TEXT"); - } - if (oldVersion <= 4) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " - + KEY_FEED_IDENTIFIER + " TEXT"); - } - if (oldVersion <= 5) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG - + " ADD COLUMN " + KEY_REASON_DETAILED + " TEXT"); - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG - + " ADD COLUMN " + KEY_DOWNLOADSTATUS_TITLE + " TEXT"); - } - if (oldVersion <= 6) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS - + " ADD COLUMN " + KEY_CHAPTER_TYPE + " INTEGER"); - } - if (oldVersion <= 7) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + KEY_PLAYBACK_COMPLETION_DATE - + " INTEGER"); - } - if (oldVersion <= 8) { - final int KEY_ID_POSITION = 0; - final int KEY_MEDIA_POSITION = 1; - - // Add feeditem column to feedmedia table - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + KEY_FEEDITEM - + " INTEGER"); - Cursor feeditemCursor = db.query(PodDBAdapter.TABLE_NAME_FEED_ITEMS, - new String[]{KEY_ID, KEY_MEDIA}, "? > 0", - new String[]{KEY_MEDIA}, null, null, null); - if (feeditemCursor.moveToFirst()) { - db.beginTransaction(); - ContentValues contentValues = new ContentValues(); - do { - long mediaId = feeditemCursor.getLong(KEY_MEDIA_POSITION); - contentValues.put(KEY_FEEDITEM, feeditemCursor.getLong(KEY_ID_POSITION)); - db.update(PodDBAdapter.TABLE_NAME_FEED_MEDIA, contentValues, KEY_ID + "=?", new String[]{String.valueOf(mediaId)}); - contentValues.clear(); - } while (feeditemCursor.moveToNext()); - db.setTransactionSuccessful(); - db.endTransaction(); - } - feeditemCursor.close(); - } - if (oldVersion <= 9) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_AUTO_DOWNLOAD - + " INTEGER DEFAULT 1"); - } - if (oldVersion <= 10) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_FLATTR_STATUS - + " INTEGER"); - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS - + " ADD COLUMN " + KEY_FLATTR_STATUS - + " INTEGER"); - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + KEY_PLAYED_DURATION - + " INTEGER"); - } - if (oldVersion <= 11) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_USERNAME - + " TEXT"); - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_PASSWORD - + " TEXT"); - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS - + " ADD COLUMN " + KEY_IMAGE - + " INTEGER"); - } - if (oldVersion <= 12) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_IS_PAGED + " INTEGER DEFAULT 0"); - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_NEXT_PAGE_LINK + " TEXT"); - } - if (oldVersion <= 13) { - // remove duplicate rows in "Chapters" table that were created because of a bug. - db.execSQL(String.format("DELETE FROM %s WHERE %s NOT IN " + - "(SELECT MIN(%s) as %s FROM %s GROUP BY %s,%s,%s,%s,%s)", - PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS, - KEY_ID, - KEY_ID, - KEY_ID, - PodDBAdapter.TABLE_NAME_SIMPLECHAPTERS, - KEY_TITLE, - KEY_START, - KEY_FEEDITEM, - KEY_LINK, - KEY_CHAPTER_TYPE)); - } - if (oldVersion <= 14) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS - + " ADD COLUMN " + KEY_AUTO_DOWNLOAD + " INTEGER"); - db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS - + " SET " + KEY_AUTO_DOWNLOAD + " = " - + "(SELECT " + KEY_AUTO_DOWNLOAD - + " FROM " + PodDBAdapter.TABLE_NAME_FEEDS - + " WHERE " + PodDBAdapter.TABLE_NAME_FEEDS + "." + KEY_ID - + " = " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + KEY_FEED + ")"); - - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_HIDE + " TEXT"); - - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + KEY_LAST_UPDATE_FAILED + " INTEGER DEFAULT 0"); - - // create indexes - db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_FEED); - db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_IMAGE); - db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDMEDIA_FEEDITEM); - db.execSQL(PodDBAdapter.CREATE_INDEX_QUEUE_FEEDITEM); - db.execSQL(PodDBAdapter.CREATE_INDEX_SIMPLECHAPTERS_FEEDITEM); - } - if (oldVersion <= 15) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + KEY_HAS_EMBEDDED_PICTURE + " INTEGER DEFAULT -1"); - db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " SET " + KEY_HAS_EMBEDDED_PICTURE + "=0" - + " WHERE " + KEY_DOWNLOADED + "=0"); - Cursor c = db.rawQuery("SELECT " + KEY_FILE_URL - + " FROM " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " WHERE " + KEY_DOWNLOADED + "=1 " - + " AND " + KEY_HAS_EMBEDDED_PICTURE + "=-1", null); - if (c.moveToFirst()) { - MediaMetadataRetriever mmr = new MediaMetadataRetriever(); - do { - String fileUrl = c.getString(0); - try { - mmr.setDataSource(fileUrl); - byte[] image = mmr.getEmbeddedPicture(); - if (image != null) { - db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " SET " + KEY_HAS_EMBEDDED_PICTURE + "=1" - + " WHERE " + KEY_FILE_URL + "='" + fileUrl + "'"); - } else { - db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " SET " + KEY_HAS_EMBEDDED_PICTURE + "=0" - + " WHERE " + KEY_FILE_URL + "='" + fileUrl + "'"); - } - } catch (Exception e) { - e.printStackTrace(); - } - } while (c.moveToNext()); - } - c.close(); - } - if (oldVersion <= 16) { - String selectNew = "SELECT " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + KEY_ID - + " FROM " + PodDBAdapter.TABLE_NAME_FEED_ITEMS - + " INNER JOIN " + PodDBAdapter.TABLE_NAME_FEED_MEDIA + " ON " - + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + KEY_ID + "=" - + PodDBAdapter.TABLE_NAME_FEED_MEDIA + "." + KEY_FEEDITEM - + " LEFT OUTER JOIN " + PodDBAdapter.TABLE_NAME_QUEUE + " ON " - + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + KEY_ID + "=" - + PodDBAdapter.TABLE_NAME_QUEUE + "." + KEY_FEEDITEM - + " WHERE " - + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + KEY_READ + " = 0 AND " // unplayed - + PodDBAdapter.TABLE_NAME_FEED_MEDIA + "." + KEY_DOWNLOADED + " = 0 AND " // undownloaded - + PodDBAdapter.TABLE_NAME_FEED_MEDIA + "." + KEY_POSITION + " = 0 AND " // not partially played - + PodDBAdapter.TABLE_NAME_QUEUE + "." + KEY_ID + " IS NULL"; // not in queue - String sql = "UPDATE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS - + " SET " + KEY_READ + "=" + FeedItem.NEW - + " WHERE " + KEY_ID + " IN (" + selectNew + ")"; - Log.d("Migration", "SQL: " + sql); - db.execSQL(sql); - } - if (oldVersion <= 17) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + PodDBAdapter.KEY_AUTO_DELETE_ACTION + " INTEGER DEFAULT 0"); - } - if (oldVersion < 1030005) { - db.execSQL("UPDATE FeedItems SET auto_download=0 WHERE " + - "(read=1 OR id IN (SELECT feeditem FROM FeedMedia WHERE position>0 OR downloaded=1)) " + - "AND id NOT IN (SELECT feeditem FROM Queue)"); - } - if (oldVersion < 1040001) { - db.execSQL(CREATE_TABLE_FAVORITES); - } - if (oldVersion < 1040002) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + PodDBAdapter.KEY_LAST_PLAYED_TIME + " INTEGER DEFAULT 0"); - } - if (oldVersion < 1040013) { - db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_PUBDATE); - db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_READ); - } - if (oldVersion < 1050003) { - // Migrates feed list filter data - - db.beginTransaction(); - - // Change to intermediate values to avoid overwriting in the following find/replace - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'unplayed', 'noplay')"); - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'not_queued', 'noqueue')"); - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'not_downloaded', 'nodl')"); - - // Replace played, queued, and downloaded with their opposites - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'played', 'unplayed')"); - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'queued', 'not_queued')"); - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'downloaded', 'not_downloaded')"); - - // Now replace intermediates for unplayed, not queued, etc. with their opposites - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'noplay', 'played')"); - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'noqueue', 'queued')"); - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'nodl', 'downloaded')"); - - // Paused doesn't have an opposite, so unplayed is the next best option - db.execSQL("UPDATE " + TABLE_NAME_FEEDS + "\n" + - "SET " + KEY_HIDE + " = replace(" + KEY_HIDE + ", 'paused', 'unplayed')"); - - db.setTransactionSuccessful(); - db.endTransaction(); - - // and now get ready for autodownload filters - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + PodDBAdapter.KEY_INCLUDE_FILTER + " TEXT DEFAULT ''"); - - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + PodDBAdapter.KEY_EXCLUDE_FILTER + " TEXT DEFAULT ''"); - - // and now auto refresh - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + PodDBAdapter.KEY_KEEP_UPDATED + " INTEGER DEFAULT 1"); - } - if (oldVersion < 1050004) { - // prevent old timestamps to be misinterpreted as ETags - db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS - + " SET " + PodDBAdapter.KEY_LASTUPDATE + "=NULL"); - } - if (oldVersion < 1060200) { - db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS - + " ADD COLUMN " + PodDBAdapter.KEY_CUSTOM_TITLE + " TEXT"); - } - + DBUpgrader.upgrade(db, oldVersion, newVersion); EventBus.getDefault().post(ProgressEvent.end()); } } -- cgit v1.2.3 From 9cf71f85b99382456c70425946e3482a59521275 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 16:05:05 +0200 Subject: Using utils --- .../de/danoeh/antennapod/core/asynctask/FeedRemover.java | 5 +++-- .../antennapod/core/service/playback/PlaybackService.java | 6 ++---- .../java/de/danoeh/antennapod/core/storage/DBTasks.java | 5 ++--- .../java/de/danoeh/antennapod/core/storage/DBWriter.java | 13 ++++--------- .../danoeh/antennapod/core/storage/DownloadRequester.java | 6 +++--- .../java/de/danoeh/antennapod/core/util/IntentUtils.java | 4 ++++ 6 files changed, 18 insertions(+), 21 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java index 849dfef93..74693cf21 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java +++ b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FeedRemover.java @@ -9,8 +9,10 @@ import java.util.concurrent.ExecutionException; import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBWriter; +import de.danoeh.antennapod.core.util.IntentUtils; /** Removes a feed in the background. */ public class FeedRemover extends AsyncTask { @@ -41,8 +43,7 @@ public class FeedRemover extends AsyncTask { dialog.dismiss(); } if(skipOnCompletion) { - context.sendBroadcast(new Intent(PlaybackService.ACTION_SKIP_CURRENT_EPISODE) - .setPackage(context.getPackageName())); + IntentUtils.sendLocalBroadcast(context, PlaybackService.ACTION_SKIP_CURRENT_EPISODE); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 5cccd754f..2b5b07f34 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -65,6 +65,7 @@ import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.FeedSearcher; import de.danoeh.antennapod.core.util.IntList; +import de.danoeh.antennapod.core.util.IntentUtils; import de.danoeh.antennapod.core.util.gui.NotificationUtils; import de.danoeh.antennapod.core.util.QueueAccess; import de.danoeh.antennapod.core.util.playback.ExternalMedia; @@ -699,10 +700,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { } - Intent statusUpdate = new Intent(ACTION_PLAYER_STATUS_CHANGED); - // statusUpdate.putExtra(EXTRA_NEW_PLAYER_STATUS, newInfo.playerStatus.ordinal()); - statusUpdate.setPackage(getPackageName()); - sendBroadcast(statusUpdate); + IntentUtils.sendLocalBroadcast(getApplicationContext(), ACTION_PLAYER_STATUS_CHANGED); PlayerWidgetJobService.updateWidget(getBaseContext()); bluetoothNotifyChange(newInfo, AVRCP_ACTION_PLAYER_STATUS_CHANGED); bluetoothNotifyChange(newInfo, AVRCP_ACTION_META_CHANGED); diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index 7ce2e7bd0..41dbe0a6a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -36,6 +36,7 @@ import de.danoeh.antennapod.core.service.download.DownloadStatus; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.DownloadError; +import de.danoeh.antennapod.core.util.IntentUtils; import de.danoeh.antennapod.core.util.LongList; import de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator; import de.danoeh.antennapod.core.util.exception.MediaFileNotFoundException; @@ -142,9 +143,7 @@ public final class DBTasks { } catch (MediaFileNotFoundException e) { e.printStackTrace(); if (media.isPlaying()) { - context.sendBroadcast(new Intent( - PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE) - .setPackage(context.getPackageName())); + IntentUtils.sendLocalBroadcast(context, PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE); } notifyMissingFeedMediaFile(context, media); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 17a02961c..b354ef8f6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -7,6 +7,7 @@ import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.util.Log; +import de.danoeh.antennapod.core.util.IntentUtils; import org.shredzone.flattr4j.model.Flattr; import java.io.File; @@ -116,12 +117,8 @@ public class DBWriter { true); editor.commit(); } - if (PlaybackPreferences - .getCurrentlyPlayingFeedMediaId() == media - .getId()) { - context.sendBroadcast(new Intent( - PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE) - .setPackage(context.getPackageName())); + if (PlaybackPreferences.getCurrentlyPlayingFeedMediaId() == media.getId()) { + IntentUtils.sendLocalBroadcast(context, PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE); } } // Gpodder: queue delete action for synchronization @@ -158,9 +155,7 @@ public class DBWriter { if (PlaybackPreferences.getCurrentlyPlayingMedia() == FeedMedia.PLAYABLE_TYPE_FEEDMEDIA && PlaybackPreferences.getLastPlayedFeedId() == feed .getId()) { - context.sendBroadcast(new Intent( - PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE) - .setPackage(context.getPackageName())); + IntentUtils.sendLocalBroadcast(context, PlaybackService.ACTION_SHUTDOWN_PLAYBACK_SERVICE); SharedPreferences.Editor editor = prefs.edit(); editor.putLong( PlaybackPreferences.PREF_CURRENTLY_PLAYING_FEED_ID, diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java index 6e062a318..827874f54 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java @@ -9,6 +9,8 @@ import android.text.TextUtils; import android.util.Log; import android.webkit.URLUtil; +import de.danoeh.antennapod.core.service.playback.PlaybackService; +import de.danoeh.antennapod.core.util.IntentUtils; import org.apache.commons.io.FilenameUtils; import java.io.File; @@ -251,9 +253,7 @@ public class DownloadRequester { */ public synchronized void cancelAllDownloads(Context context) { Log.d(TAG, "Cancelling all running downloads"); - context.sendBroadcast(new Intent( - DownloadService.ACTION_CANCEL_ALL_DOWNLOADS) - .setPackage(context.getPackageName())); + IntentUtils.sendLocalBroadcast(context, DownloadService.ACTION_CANCEL_ALL_DOWNLOADS); } /** diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java index 1571b71c2..aaaaf8f4d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java @@ -23,4 +23,8 @@ public class IntentUtils { return false; } + public static void sendLocalBroadcast(Context context, String action) { + context.sendBroadcast(new Intent(action).setPackage(context.getPackageName())); + } + } -- cgit v1.2.3 From ca6639892d1c0015390c09971b795ce5b755e690 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 16:16:42 +0200 Subject: Fixed build --- core/src/main/res/values/styles.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 62d35eb86..908f411ee 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -145,12 +145,12 @@ @@ -136,6 +137,7 @@ @drawable/ic_create_new_folder_white_24dp @drawable/ic_cast_disconnect_white_36dp @color/master_switch_background_dark + @color/highlight_dark @style/PreferenceThemeOverlay.v14.Material @@ -227,6 +229,7 @@ @drawable/ic_create_new_folder_grey600_24dp @drawable/ic_cast_disconnect_grey600_36dp @color/master_switch_background_light + @color/highlight_light @style/PreferenceThemeOverlay.v14.Material @@ -297,6 +300,7 @@ @drawable/ic_create_new_folder_white_24dp @drawable/ic_cast_disconnect_white_36dp @color/master_switch_background_dark + @color/highlight_dark @style/PreferenceThemeOverlay.v14.Material @@ -312,6 +316,7 @@ @drawable/ic_drag_vertical_white_48dp @color/black @color/black + @color/highlight_trueblack @color/white @color/white @color/black -- cgit v1.2.3 From 0ece32ab0e65b7c946a9ebfa729ef047d66ff989 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 18:01:23 +0200 Subject: Move old image url to new column --- .../java/de/danoeh/antennapod/core/storage/DBUpgrader.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java index 95dfcca1b..29ed5f7f9 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java @@ -272,6 +272,19 @@ class DBUpgrader { + " ADD COLUMN " + PodDBAdapter.KEY_IMAGE_URL + " TEXT"); db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + " ADD COLUMN " + PodDBAdapter.KEY_IMAGE_URL + " TEXT"); + + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + " SET " + PodDBAdapter.KEY_IMAGE_URL + " = (" + + " SELECT " + PodDBAdapter.KEY_DOWNLOAD_URL + + " FROM " + PodDBAdapter.TABLE_NAME_FEED_IMAGES + + " WHERE " + PodDBAdapter.TABLE_NAME_FEED_IMAGES + "." + PodDBAdapter.KEY_ID + + " = " + PodDBAdapter.TABLE_NAME_FEED_ITEMS + "." + PodDBAdapter.KEY_IMAGE + ")"); + + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + " SET " + PodDBAdapter.KEY_IMAGE_URL + " = (" + + " SELECT " + PodDBAdapter.KEY_DOWNLOAD_URL + + " FROM " + PodDBAdapter.TABLE_NAME_FEED_IMAGES + + " WHERE " + PodDBAdapter.TABLE_NAME_FEED_IMAGES + "." + PodDBAdapter.KEY_ID + + " = " + PodDBAdapter.TABLE_NAME_FEEDS + "." + PodDBAdapter.KEY_IMAGE + ")"); + db.execSQL("DROP TABLE " + PodDBAdapter.TABLE_NAME_FEED_IMAGES); } } -- cgit v1.2.3 From c2ace741563f33d507ae7fd425ad659298cbd655 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 6 Jun 2018 18:37:33 +0200 Subject: Stop service on status change --- .../danoeh/antennapod/core/service/playback/PlaybackService.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 90df9871b..68583c840 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -677,11 +677,6 @@ public class PlaybackService extends MediaBrowserServiceCompat { writePlayerStatusPlaybackPreferences(); break; - case STOPPED: - //setCurrentlyPlayingMedia(PlaybackPreferences.NO_MEDIA_PLAYING); - //stopSelf(); - break; - case PLAYING: writePlayerStatusPlaybackPreferences(); setupNotification(newInfo); @@ -694,8 +689,9 @@ public class PlaybackService extends MediaBrowserServiceCompat { } break; - case ERROR: + case ERROR: case STOPPED: writePlaybackPreferencesNoMediaPlaying(); + stopSelf(); break; } -- cgit v1.2.3 From e282250c089efb29ed7de96c5e4071be737a0af8 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 8 Jun 2018 00:15:43 +0200 Subject: Fixed image url of Feed --- .../src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 9ad74ecf3..591015dff 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -1285,7 +1285,9 @@ public class PodDBAdapter { + "SELECT " + KEY_USERNAME + "," + KEY_PASSWORD + " FROM " + TABLE_NAME_FEED_ITEMS + " INNER JOIN " + TABLE_NAME_FEEDS + " ON " + TABLE_NAME_FEED_ITEMS + "." + KEY_FEED + " = " + TABLE_NAME_FEEDS + "." + KEY_ID - + " WHERE " + TABLE_NAME_FEED_ITEMS + "." + KEY_IMAGE_URL + "=" + downloadUrl; + + " WHERE " + TABLE_NAME_FEED_ITEMS + "." + KEY_IMAGE_URL + "=" + downloadUrl + + " UNION SELECT " + KEY_USERNAME + "," + KEY_PASSWORD + " FROM " + TABLE_NAME_FEEDS + + " WHERE " + TABLE_NAME_FEEDS + "." + KEY_IMAGE_URL + "=" + downloadUrl; return db.rawQuery(query, null); } -- cgit v1.2.3 From 9fb695822a49037a60bb4c0f0df005e262fa3b12 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 8 Jun 2018 00:28:32 +0200 Subject: Removed delibertate fallthrough --- .../danoeh/antennapod/core/service/playback/PlaybackService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 68583c840..fb6291234 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -677,6 +677,11 @@ public class PlaybackService extends MediaBrowserServiceCompat { writePlayerStatusPlaybackPreferences(); break; + case STOPPED: + writePlaybackPreferencesNoMediaPlaying(); + stopSelf(); + break; + case PLAYING: writePlayerStatusPlaybackPreferences(); setupNotification(newInfo); @@ -689,7 +694,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { } break; - case ERROR: case STOPPED: + case ERROR: writePlaybackPreferencesNoMediaPlaying(); stopSelf(); break; -- cgit v1.2.3 From 1331c92c1da0fc531db1424d334684c6480f202c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 10 Jun 2018 10:31:51 +0200 Subject: Do not call error handler when shutting down playback service --- .../antennapod/core/service/playback/LocalPSMP.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 0e64f484f..a0e74355f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -610,13 +610,26 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { executor.shutdown(); if (mediaPlayer != null) { try { - mediaPlayer.stop(); + removeMediaPlayerErrorListener(); + if (mediaPlayer.isPlaying()) { + mediaPlayer.stop(); + } } catch (Exception ignore) { } mediaPlayer.release(); } releaseWifiLockIfNecessary(); } + private void removeMediaPlayerErrorListener() { + if (mediaPlayer instanceof VideoPlayer) { + VideoPlayer vp = (VideoPlayer) mediaPlayer; + vp.setOnErrorListener((mp, what, extra) -> true); + } else if (mediaPlayer instanceof AudioPlayer) { + AudioPlayer ap = (AudioPlayer) mediaPlayer; + ap.setOnErrorListener((mediaPlayer, i, i1) -> true); + } + } + /** * Releases internally used resources. This method should only be called when the object is not used anymore. * This method is executed on an internal executor service. -- cgit v1.2.3 From de21ff42d9a96a3993d2a1b2603d526fd38f16a9 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 10 Jun 2018 11:04:29 +0200 Subject: Applied suggestions --- .../antennapod/core/service/playback/PlaybackService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index fb6291234..0d7bbdae4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -678,8 +678,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { break; case STOPPED: - writePlaybackPreferencesNoMediaPlaying(); - stopSelf(); + //writePlaybackPreferencesNoMediaPlaying(); + //stopSelf(); break; case PLAYING: @@ -1219,6 +1219,9 @@ public class PlaybackService extends MediaBrowserServiceCompat { } if (playable == null) { Log.d(TAG, "setupNotification: playable is null"); + if (!started) { + stopSelf(); + } return; } Runnable notificationSetupTask = new Runnable() { @@ -1230,6 +1233,9 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (mediaPlayer == null) { Log.d(TAG, "notificationSetupTask: mediaPlayer is null"); + if (!started) { + stopSelf(); + } return; } -- cgit v1.2.3 From 67d3115049b8521fc03a656a29bd92ad056737d9 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 4 Jul 2018 23:28:16 +0200 Subject: Only highlight currently playing item if playback service is running Killing the service while playing left the queue entry highlighted --- core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java index a22422596..73d2bb34d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java @@ -19,6 +19,7 @@ import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction; import de.danoeh.antennapod.core.preferences.GpodnetPreferences; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; @@ -218,7 +219,7 @@ public class FeedMedia extends FeedFile implements Playable { * currently being played and the current player status is playing. */ public boolean isCurrentlyPlaying() { - return isPlaying() && + return isPlaying() && PlaybackService.isRunning && ((PlaybackPreferences.getCurrentPlayerStatus() == PlaybackPreferences.PLAYER_STATUS_PLAYING)); } -- cgit v1.2.3 From a9d9a5ac4262751a5ff660c47915c190bcd6c414 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 4 Jul 2018 23:54:04 +0200 Subject: Added Exoplayer to new method --- .../java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 2bc247d9f..91c4a0fd7 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -631,6 +631,9 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { } else if (mediaPlayer instanceof AudioPlayer) { AudioPlayer ap = (AudioPlayer) mediaPlayer; ap.setOnErrorListener((mediaPlayer, i, i1) -> true); + } else if (mediaPlayer instanceof ExoPlayerWrapper) { + ExoPlayerWrapper ap = (ExoPlayerWrapper) mediaPlayer; + ap.setOnErrorListener((mediaPlayer, i, i1) -> true); } } -- cgit v1.2.3 From 8a0769d466e8f1148ecdc1f947821dfac9583f1a Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 6 Jul 2018 10:10:21 +0200 Subject: Better feed parser errors --- .../antennapod/core/syndication/handler/TypeGetter.java | 3 ++- .../syndication/handler/UnsupportedFeedtypeException.java | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java index ee0a71f30..54a0b1b97 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java @@ -64,8 +64,9 @@ public class TypeGetter { Log.d(TAG, "Recognized type RSS 0.91/0.92"); return Type.RSS091; } + throw new UnsupportedFeedtypeException("Unsupported rss version"); } - throw new UnsupportedFeedtypeException(Type.INVALID); + throw new UnsupportedFeedtypeException("No rss version attribute found"); default: Log.d(TAG, "Type is invalid"); throw new UnsupportedFeedtypeException(Type.INVALID, tag); diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java index 606f93faf..fd7d0a4e1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/UnsupportedFeedtypeException.java @@ -5,7 +5,8 @@ import de.danoeh.antennapod.core.syndication.handler.TypeGetter.Type; public class UnsupportedFeedtypeException extends Exception { private static final long serialVersionUID = 9105878964928170669L; private final TypeGetter.Type type; - private String rootElement; + private String rootElement; + private String message = null; public UnsupportedFeedtypeException(Type type) { super(); @@ -17,6 +18,11 @@ public class UnsupportedFeedtypeException extends Exception { this.rootElement = rootElement; } + public UnsupportedFeedtypeException(String message) { + this.message = message; + type = Type.INVALID; + } + public TypeGetter.Type getType() { return type; } @@ -27,7 +33,9 @@ public class UnsupportedFeedtypeException extends Exception { @Override public String getMessage() { - if (type == TypeGetter.Type.INVALID) { + if (message != null) { + return message; + } else if (type == TypeGetter.Type.INVALID) { return "Invalid type"; } else { return "Type " + type + " not supported"; -- cgit v1.2.3 From 43911c3dab9e7f3ae91f3eac78f178509d6caccd Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sat, 7 Jul 2018 09:09:57 +0200 Subject: Assume version 2.0 for RSS if property is missing --- .../core/syndication/handler/TypeGetter.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java index 54a0b1b97..b4c77e58d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/handler/TypeGetter.java @@ -54,19 +54,19 @@ public class TypeGetter { return Type.ATOM; case RSS_ROOT: String strVersion = xpp.getAttributeValue(null, "version"); - if (strVersion != null) { - if (strVersion.equals("2.0")) { - feed.setType(Feed.TYPE_RSS2); - Log.d(TAG, "Recognized type RSS 2.0"); - return Type.RSS20; - } else if (strVersion.equals("0.91") - || strVersion.equals("0.92")) { - Log.d(TAG, "Recognized type RSS 0.91/0.92"); - return Type.RSS091; - } - throw new UnsupportedFeedtypeException("Unsupported rss version"); + if (strVersion == null) { + feed.setType(Feed.TYPE_RSS2); + Log.d(TAG, "Assuming type RSS 2.0"); + return Type.RSS20; + } else if (strVersion.equals("2.0")) { + feed.setType(Feed.TYPE_RSS2); + Log.d(TAG, "Recognized type RSS 2.0"); + return Type.RSS20; + } else if (strVersion.equals("0.91") || strVersion.equals("0.92")) { + Log.d(TAG, "Recognized type RSS 0.91/0.92"); + return Type.RSS091; } - throw new UnsupportedFeedtypeException("No rss version attribute found"); + throw new UnsupportedFeedtypeException("Unsupported rss version"); default: Log.d(TAG, "Type is invalid"); throw new UnsupportedFeedtypeException(Type.INVALID, tag); -- cgit v1.2.3 From 37f407dc07513b8319b970abe13fe057f8bd5510 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 7 Jul 2018 09:45:22 +0200 Subject: Do not authenticate image without user --- core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 5eb5145e8..456d05ded 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.core.storage; import android.database.Cursor; import android.support.v4.util.ArrayMap; +import android.text.TextUtils; import android.util.Log; import java.util.ArrayList; @@ -688,7 +689,7 @@ public final class DBReader { if (cursor.moveToFirst()) { String username = cursor.getString(0); String password = cursor.getString(1); - if (username != null && password != null) { + if (!TextUtils.isEmpty(username) && password != null) { credentials = username + ":" + password; } else { credentials = ""; -- cgit v1.2.3 From 53a3b85272ad7ca68c2bfb2793b993b39a53986b Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 13 Jul 2018 09:23:36 +0200 Subject: Actually stop PlaybackService --- .../core/service/playback/PlaybackService.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 91ae9da28..574e43faa 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -341,6 +341,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { public void onDestroy() { super.onDestroy(); Log.d(TAG, "Service is about to be destroyed"); + stopForeground(true); isRunning = false; started = false; currentMediaType = MediaType.UNKNOWN; @@ -363,6 +364,11 @@ public class PlaybackService extends MediaBrowserServiceCompat { mediaPlayer.shutdown(); taskManager.shutdown(); } + + private void stopService() { + stopForeground(true); + stopSelf(); + } @Override public BrowserRoot onGetRoot(@NonNull String clientPackageName, int clientUid, Bundle rootHints) { @@ -458,7 +464,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { Playable playable = intent.getParcelableExtra(EXTRA_PLAYABLE); if (keycode == -1 && playable == null && !castDisconnect) { Log.e(TAG, "PlaybackService was started with no arguments"); - stopSelf(); + stopService(); return Service.START_NOT_STICKY; } @@ -470,7 +476,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { Log.d(TAG, "Received media button event"); boolean handled = handleKeycode(keycode, true); if (!handled) { - stopSelf(); + stopService(); return Service.START_NOT_STICKY; } } else if (!flavorHelper.castDisconnect(castDisconnect) && playable != null) { @@ -680,7 +686,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { case STOPPED: //writePlaybackPreferencesNoMediaPlaying(); - //stopSelf(); + //stopService(); break; case PLAYING: @@ -697,7 +703,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { case ERROR: writePlaybackPreferencesNoMediaPlaying(); - stopSelf(); + stopService(); break; } @@ -710,7 +716,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { @Override public void shouldStop() { - stopSelf(); + stopService(); } @Override @@ -759,7 +765,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { } sendNotificationBroadcast(NOTIFICATION_TYPE_ERROR, what); writePlaybackPreferencesNoMediaPlaying(); - stopSelf(); + stopService(); return true; } @@ -1213,7 +1219,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (playable == null) { Log.d(TAG, "setupNotification: playable is null"); if (!started) { - stopSelf(); + stopService(); } return; } @@ -1227,7 +1233,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { if (mediaPlayer == null) { Log.d(TAG, "notificationSetupTask: mediaPlayer is null"); if (!started) { - stopSelf(); + stopService(); } return; } @@ -1548,7 +1554,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { @Override public void onReceive(Context context, Intent intent) { if (TextUtils.equals(intent.getAction(), ACTION_SHUTDOWN_PLAYBACK_SERVICE)) { - stopSelf(); + stopService(); } } -- cgit v1.2.3 From 683e5769874176d95d0e96365ba1c139530d88be Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 13 Jul 2018 09:38:34 +0200 Subject: Do not show badges for ongoing notifications (Closes #2724) --- .../main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java index 1c42364ea..2a537dc62 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/gui/NotificationUtils.java @@ -41,6 +41,7 @@ public class NotificationUtils { NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID_DOWNLOADING, c.getString(R.string.notification_channel_downloading), NotificationManager.IMPORTANCE_LOW); mChannel.setDescription(c.getString(R.string.notification_channel_downloading_description)); + mChannel.setShowBadge(false); return mChannel; } @@ -49,6 +50,7 @@ public class NotificationUtils { NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID_PLAYING, c.getString(R.string.notification_channel_playing), NotificationManager.IMPORTANCE_LOW); mChannel.setDescription(c.getString(R.string.notification_channel_playing_description)); + mChannel.setShowBadge(false); return mChannel; } -- cgit v1.2.3 From 3fce9490c257ac7fa10a70b74f05d0133fbf44b7 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 13 Jul 2018 10:18:29 +0200 Subject: Do not overwrite feed description with item description --- .../de/danoeh/antennapod/core/syndication/namespace/NSITunes.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java index 18af0800f..b3b8a40ce 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/NSITunes.java @@ -47,6 +47,9 @@ public class NSITunes extends Namespace { if(state.getContentBuf() == null) { return; } + SyndElement secondElement = state.getSecondTag(); + String second = secondElement.getName(); + if (AUTHOR.equals(localName)) { if (state.getFeed() != null) { String author = state.getContentBuf().toString(); @@ -95,10 +98,9 @@ public class NSITunes extends Namespace { } if (state.getCurrentItem() != null && (TextUtils.isEmpty(state.getCurrentItem().getDescription()) || - state.getCurrentItem().getDescription().length() * 1.25 < summary.length()) - ) { + state.getCurrentItem().getDescription().length() * 1.25 < summary.length())) { state.getCurrentItem().setDescription(summary); - } else if (state.getFeed() != null) { + } else if (NSRSS20.CHANNEL.equals(second) && state.getFeed() != null) { state.getFeed().setDescription(summary); } } -- cgit v1.2.3 From 626621044f0dcb77080400d86571ca4a46043b06 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 13 Jul 2018 10:33:01 +0200 Subject: Player names are not translatable --- core/src/main/res/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 6312a5bbd..0cf8f4b46 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -459,8 +459,8 @@ Enqueue Downloaded Add downloaded episodes to the queue Built-in Android player - Sonic Media Player - Exoplayer + Sonic Media Player + Exoplayer Video behavior Behavior when leaving video playback Stop playback -- cgit v1.2.3 From 0d43cc8658d49e45fa9ad94a3e44a15bc8e9dffc Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 13 Jul 2018 18:29:05 +0200 Subject: Requesting storage permissions for external files --- core/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'core/src/main') diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 704cc077c..236ef97e0 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -77,6 +77,7 @@ Picture Error An error occurred: + Storage permission is needed for this operation Refresh No external storage is available. Please make sure that external storage is mounted so that the app can work properly. Chapters -- cgit v1.2.3 From e1b0da978d7d53d3da4238bdb2d3625aee36dace Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 22 Jul 2018 18:37:37 +0200 Subject: Update translations --- core/src/main/res/values-ar/strings.xml | 1 + core/src/main/res/values-bg/strings.xml | 21 +- core/src/main/res/values-de/strings.xml | 8 +- core/src/main/res/values-es/strings.xml | 8 +- core/src/main/res/values-et/strings.xml | 16 +- core/src/main/res/values-fr/strings.xml | 72 +-- core/src/main/res/values-gl-rES/strings.xml | 8 +- core/src/main/res/values-hu/strings.xml | 204 +++++++- core/src/main/res/values-it-rIT/strings.xml | 140 +++++- core/src/main/res/values-it/strings.xml | 15 +- core/src/main/res/values-iw-rIL/strings.xml | 729 +++++++++++++++++++--------- core/src/main/res/values-ja/strings.xml | 8 +- core/src/main/res/values-ko/strings.xml | 13 +- core/src/main/res/values-nl/strings.xml | 8 +- core/src/main/res/values-pl-rPL/strings.xml | 21 +- core/src/main/res/values-pt/strings.xml | 14 +- core/src/main/res/values-ro-rRO/strings.xml | 22 +- core/src/main/res/values-ru/strings.xml | 13 +- core/src/main/res/values-sv-rSE/strings.xml | 14 +- core/src/main/res/values-te/strings.xml | 47 ++ core/src/main/res/values-uk-rUA/strings.xml | 19 +- 21 files changed, 1089 insertions(+), 312 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/res/values-ar/strings.xml b/core/src/main/res/values-ar/strings.xml index fe932e959..848a31add 100644 --- a/core/src/main/res/values-ar/strings.xml +++ b/core/src/main/res/values-ar/strings.xml @@ -1,6 +1,7 @@ + Feeds الكل المفضلات جديد diff --git a/core/src/main/res/values-bg/strings.xml b/core/src/main/res/values-bg/strings.xml index 286c9a3eb..e06a2cca0 100644 --- a/core/src/main/res/values-bg/strings.xml +++ b/core/src/main/res/values-bg/strings.xml @@ -30,6 +30,7 @@ Брой изтеглени епизоди Никакви + Отвори в браузъра Копирай URL адрес Сподели URL адрес Адресът е копиран @@ -40,6 +41,7 @@ Отказ Да Не + Нулиране Автор Език URL @@ -47,7 +49,9 @@ Снимка Грешка Възникна грешка: + Обнови Няма налична външна памет. Уверете се, че външната памет е монтирана, за да може приложението да работи правилно. + Времетраене: %1$s Описание Най-нов епизод:\u0020 Размер:\u0020 @@ -60,6 +64,7 @@ www.primer.com/emisiq Добавяне на подкаст по URL адрес Намиране на подкаст в директория + Можете да търсите нови подкасти в iTunes или fyyd, или да прегледате gpodder.net според име, категория и популярност. Маркирай всички като слушани Всички епизоди са маркирани като слушани @@ -79,6 +84,8 @@ Сподели URL адрес на епизода Сподели URL адрес на епизода с позиция Премахване на емисията + Изтеглени + Неизтеглени Стрийм Маркиран като прегледан @@ -175,6 +182,7 @@ Изпратете най-новия доклад за срив чрез имейл Изпращане на имейл Експериментални + Текуща стойност: %1$s Прокси Често задавани въпроси Известни проблеми @@ -193,10 +201,9 @@ HTML експортиране Експортиране... Грешка при експортиране - Успешно OPML експортиране. - .opml файлът беше записан в:\u0020 Необходим е достъп до външната памет за прочитане на OPML файла + Вибрация секунди минути часа @@ -216,6 +223,7 @@ КАТЕГОРИИ ТОП ПОДКАСТИ ПРЕДЛОЖЕНИЯ + Търсене в gpodder.net Вход Вход Потребителско име @@ -229,11 +237,20 @@ Филтър + Търсене във fyyd + Тип + Хост + Порт + Тест + Тестът е успешен + Тестът е неуспешен + Портът не е валиден + diff --git a/core/src/main/res/values-de/strings.xml b/core/src/main/res/values-de/strings.xml index c1faf9b5b..be32e70eb 100644 --- a/core/src/main/res/values-de/strings.xml +++ b/core/src/main/res/values-de/strings.xml @@ -168,6 +168,8 @@ fehlgeschlagen Download anstehend Download läuft + Details + %1$s \n\nDatei-URL:\n%2$s Speichermedium nicht gefunden Zu wenig Speicherplatz Dateifehler @@ -451,8 +453,8 @@ HTML Export Exportiere… Exportfehler - OPML Export erfolgreich - Die OPML Datei wurde unter dem folgenden Pfad gespeichert:\u0020 + Export erfolgreich + Die exportierte Datei wurde geschrieben nach:\n\n%1$s Zugriff auf externen Speicher wird benötigt, um die OPML Datei zu lesen Timer einstellen @@ -625,7 +627,7 @@ Import Export Zu importierende Datei auswählen - Export erfolgreich. Die Datenbank wurde auf die SD-Karte geschrieben. + Export erfolgreich. Import erfolgreich.\n\nBitte OK drücken, um AntennaPod neuzustarten Abspielen auf... diff --git a/core/src/main/res/values-es/strings.xml b/core/src/main/res/values-es/strings.xml index 7c6341a06..ff16ff05d 100644 --- a/core/src/main/res/values-es/strings.xml +++ b/core/src/main/res/values-es/strings.xml @@ -168,6 +168,8 @@ fallido Descarga pendiente Descarga en curso + Detalles + %1$s \n\nURL de archivo:\n%2$s No se ha encontrado un dispositivo de almacenamiento Espacio insuficiente Error de archivo @@ -451,8 +453,8 @@ Exportar a HTML Exportando… Error en la exportación - Exportación a OPML exitosa - El archivo OPML se ha escrito en:\u0020 + Exportación exitosa + El archivo exportado fué grabado en::\n\n%1$s Es necesario el acceso al almacenamiento externo para leer archivos OPML Establecer un temporizador @@ -625,7 +627,7 @@ Importar Exportar Seleccionar firchero a importar - Exportación exitosa. La base de datos se guardó en la tarjeta SD. + Exportación exitosa. Importación exitosa.\n\nPor favor, pulse OK para reiniciar AntennaPod Reproducir en... diff --git a/core/src/main/res/values-et/strings.xml b/core/src/main/res/values-et/strings.xml index d7afdf834..cff276e09 100644 --- a/core/src/main/res/values-et/strings.xml +++ b/core/src/main/res/values-et/strings.xml @@ -99,6 +99,7 @@ Eemalda taskuhääling Jaga... Jaga linki + Jaga faili Jaga linki koos asukohaga Jaga uudisvoo URL-i Uudisvoo eemaldamine @@ -147,6 +148,7 @@ ebaõnnestus Ootel allalaadimine Allalaadimine on käimas + Üksikasjad Salvestuskohta ei leitud Pole piisavalt ruumi Faili viga @@ -241,6 +243,7 @@ Automaatne kustutamine Hoia saated alles, kui need jäetakse vahele Hoia vahelejäetud osad alles + Säilita lemmikosad Esitamine Võrk Uuendamise intervall või kellaaeg @@ -342,8 +345,6 @@ HTML eksport Eksportimine... Viga eksportimisel - OPML eksport oli edukas. - .opml fail kirjutati kausta:\u0020 Määra unetaimer Keela unetaimer @@ -368,6 +369,9 @@ 1 tund %d tundi + Automaatne kustutamine + Unetaimer on sisse lülitatud + Unetaimer on välja lülitatud KATEGOORIAD POPIMAD TASKUHÄÄLINGUD @@ -385,6 +389,7 @@ Vali olemasolev seade: Seadme ID ei tohi olla tühi Seadme ID on juba kasutuses + Pealkiri ei tohi olla tühi Vali Sisse logitud! Alusta kohe sünkroonimist @@ -490,9 +495,16 @@ Kontroll oli edukas Kontroll ebaõnnestus Hostinimi ei saa olla tühi + Se pole korrektne IP aadress või domeen Port pole korrektne + Andmebaasi importimine/eksportimine + Impordi + Ekspordi + Vali fail, mida importida + Eksportimine on sooritatud. Esita... + Tõrge meedia esitamisel. Jätame vahele... diff --git a/core/src/main/res/values-fr/strings.xml b/core/src/main/res/values-fr/strings.xml index dc4e356bf..f90bbd5fe 100644 --- a/core/src/main/res/values-fr/strings.xml +++ b/core/src/main/res/values-fr/strings.xml @@ -44,9 +44,9 @@ Aucun Ouvrir dans le navigateur - Copier l\'URL - Partager l\'URL - URL copiée dans le presse-papier + Copier le lien + Partager le lien + Lien copié dans le presse-papier Aller à cette position Effacer le journal @@ -58,7 +58,7 @@ Réinitialiser Auteur Langue - URL + Lien Préférences Image Erreur @@ -83,7 +83,7 @@ Le nouveau paramètre Téléchargement Automatique sera automatiquement appliqué sur chaque nouvel épisode.\nVoulez-vous faire de même avec les épisodes précédents ? Suppression automatique de l\'épisode \u0020téléchargements parallèles - Global défaut + Param.par défaut Toujours Jamais Envoyer... @@ -95,9 +95,9 @@ %d jours après avoir été écouté - URL du flux - URL du flux - Ajouter un podcast par son URL + Lien du flux + www.example.com/feed + Ajouter un podcast à partir de son lien Trouver le podcast dans la bibliothèque Pour de nouveaux podcasts vous pouvez chercher iTunes ou fyyd ou parcourir gpodder.net par nom, catégorie ou popularité. Chercher sur gpodder.net @@ -113,25 +113,25 @@ Renommer le podcast Supprimer le podcast Partager... - Partager un lien vers le site + Partager le lien du site Partager le fichier - Partager lien avec position - Partager lien du flux - Partager le lien de l\'épisode - Partager le lien de l\'épisode avec la position + Partager le lien avec la position + Partager le lien du flux + Partager le lien du fichier + Partager le lien du fichier avec la position Confirmer que vous voulez supprimer le flux \"%1$s\" et TOUS les épisodes que vous avez téléchargés. Flux en cours de suppression Mettre à jour tout le flux Cacher épisodes Appliquer les actions - Non joués + Non lus En pause - Joués - Rajouté à la liste de lecture - Non rajouté à la liste de lecture + Lus + Dans la liste de lecture + Pas dans la liste de lecture Téléchargé Non téléchargé - À des médias + Avec média Filtré {fa-exclamation-circle} La dernière mise à jour a échoué Ouvrir Podcast @@ -168,6 +168,8 @@ échoué Téléchargement en attente Téléchargement en cours + Détails + %1$s \n\nLien du fichier :\n%2$s Volume de stockage non trouvé Espace insuffisant Accès au fichier impossible @@ -185,7 +187,7 @@ Téléchargement annulé\n Téléchargement Automatique désactivé pour cet élément Téléchargements terminés avec des erreurs Rapport des téléchargements - URL incorrecte + Lien incorrecte Erreur d\'E/S Erreur de requête Problème d\'accès à la base de données @@ -274,7 +276,7 @@ Cette liste est vide. Vous n\'êtes encore abonné à aucun flux. Cet épisode n\'a pas de chapitres. - Aucun descriptif pour cet épisode. + Aucune notes pour cet épisode. Stockage Projet @@ -295,7 +297,7 @@ Après la fin d\'un épisode, passer au suivant Supprimer l\'épisode quand la lecture est finie Suppression automatique - Les épisodes seront marqués comme lus même s\'il reste quelques secondes à jouer + Les épisodes seront marqués comme lus même s\'il reste quelques secondes à écouter Marquer comme lu intelligemment Garder les épisodes quand ils sont passés Garder les épisodes passés @@ -305,7 +307,7 @@ Réseau Mettre à jour l’intervalle ou l\'heure Indiquer un intervalle ou une heure spécifique de mise à jour des flux - Vous pouvez mettre en place un intervalle comme \"toutes les 2 heures\", une heure précise comme \"7:00\" ou désactiver les mises à jours automatique.\n\nNote: Il est possible qu\'il y ait un délai car l\'heure de mise à jour peut être inexacte. + Vous pouvez mettre en place un intervalle comme \"toutes les 2 heures\", une heure précise comme \"7:00\" ou désactiver les mises à jours automatique.\n\nNote: les heures de mise à jour ne sont pas précises. Vous pouvez avoir un petit délai. Désactiver Définir intervalle Régler l\'heure @@ -417,7 +419,7 @@ Mettre les épisodes dans la la liste de lecture après téléchargement Activer le paiement flattr automatique - Lancer un paiement flattr pour un épisode dès que %d de l\'épisode a été joué + Lancer un paiement flattr quand %d pourcent de l\'épisode a été lu Lancer le paiement flattr d\'un épisode dès que la lecture commence Lancer le paiement flattr d\'un épisode à la fin de la lecture @@ -437,7 +439,7 @@ Utiliser une application tierce comme Dropbox, Google Drive ou votre gestionnaire de fichier favori pour ouvrir un fichier OPML De nombreuses applications comme Google Mail, Dropbox ou Google Drive et la plupart des gestionnaires de fichiers peuvent ouvrir les fichiers OPML avec AntennaPod. Démarrer l\'importation - Importation OPML + Import OPML ERREUR ! Lecture du fichier OPML en cours Une erreur s\'est produite pendant la lecture du fichier OPML : @@ -447,12 +449,12 @@ Choisir... Depuis le système de fichier local Utiliser une application tierce - Exportation OPML + Export OPML Export HTML Export en cours... Erreur d\'exportation - Exportation OPML réussie. - Le fichier .opml a été écrit ici :\u0020 + Export réussi + Le fichier a été exporté dans :\n\n%1$s L\'accès au stockage externe est requis pour lire le fichier OPML Activation du minuteur d\'arrêt @@ -571,15 +573,15 @@ Tous les épisodes ont été sélectionné Aucun Tous les épisodes ont été désélectionné - Joués - Episodes joués sélectionnés - Non joués - Episodes non joués sélectionnés + Lus + Episodes lus sélectionnés + Non lus + Episodes non lus sélectionnés Téléchargés Episodes téléchargés sélectionnés Non téléchargés Épisodes non téléchargés sélectionnés - Dans liste de lecture + Dans la liste de lecture Episodes présents dans la liste de lecture sélectionnés En dehors de la liste de lecture Episodes absents de la liste de lecture sélectionnés @@ -620,12 +622,12 @@ L\'hôte n\'est pas une adresse IP ou un domaine valide Port non valide - Importer/Exporter la base de données - Cette fonction expérimentale peut-être utilisée pour transférer vos abonnements et épisodes joués sur un autre appareil.\n\nLes bases de données exportées peuvent uniquement être importées sur la même version d\'AntennaPod. Dans le cas contraire, des dysfonctionnements peuvent survenir.\n\nAprès import, il est possible que des épisodes apparaissent téléchargés alors qu\'ils ne le sont pas. Appuyer sur le bouton de lecture pour qu\'AntennaPod le détecte. + Import / Export de la base de données + Cette fonction expérimentale peut-être utilisée pour transférer vos abonnements et épisodes lus sur un autre appareil.\n\nLes bases de données exportées peuvent uniquement être importées sur la même version d\'AntennaPod. Dans le cas contraire, des dysfonctionnements peuvent apparaître.\n\nAprès import, il est possible que des épisodes apparaissent téléchargés alors qu\'ils ne le sont pas. Appuyer sur le bouton de lecture pour qu\'AntennaPod le détecte. Importer Exporter Sélectionner le fichier à importer - Export réussi. La base de données a été écrite sur la carte SD. + Export réussi. Import réussi.\n\nAppuyer sur OK pour redémarrer AntennaPod Lire sur... diff --git a/core/src/main/res/values-gl-rES/strings.xml b/core/src/main/res/values-gl-rES/strings.xml index 2dc04a5db..54a270312 100644 --- a/core/src/main/res/values-gl-rES/strings.xml +++ b/core/src/main/res/values-gl-rES/strings.xml @@ -168,6 +168,8 @@ fallou Descarga pendente Descarga en proceso + Detalles + %1$s\n\nURL do ficheiro:\n %2$s Non se atopou dispositivo de almacenamento Non hai suficiente espacio Fallo de ficheiro @@ -451,8 +453,8 @@ Exportar HTML Exportando... Fallo ao exportar - Exportación OPML exitosa. - O ficheiro .opml foi gardado en:\u0020 + Exportado con éxito + Escribeuse o ficheiro exportado en:\n\n%1$s Precísase acceso ao almacenamento externo para ler o ficheiro OPML Establecer apagado automático @@ -625,7 +627,7 @@ Importar Exportar Escolla o ficheiro a importar - Exportouse correctamente. A base de datos escribeuse na tarxeta SD. + Exportado con éxito. Importación correcta.\n\nPulse OK para reiniciar AntennaPod Reproducir en... diff --git a/core/src/main/res/values-hu/strings.xml b/core/src/main/res/values-hu/strings.xml index 878925133..5d515b926 100644 --- a/core/src/main/res/values-hu/strings.xml +++ b/core/src/main/res/values-hu/strings.xml @@ -32,6 +32,7 @@ Rendezés számláló szerint Rendezés ABC rendben Rendezés megjelenés dátuma szerint + Rendezés játszott epizódok szerint Új és nem játszott epizódok száma Új epizódok száma Nem játszott epizódok száma @@ -61,6 +62,7 @@ Frissítés Nem található külső tárhely. Biztosíts egy külső tárhelyet hogy az alkalmazás működni tudjon. Fejezetek + Hossz: %1$s Jegyzetek Leírás Legfrissebb epizód:\u0020 @@ -82,7 +84,7 @@ Soha Küldés… Soha - Ha nem várakozik + Ha nincs sorbaállítva Befejezés után 1 nappal a befejezés után @@ -108,10 +110,12 @@ Podcast eltávolítása Megosztás… Link megosztása + Fájl megosztása Link megosztása pozícióval Idővonal URL megosztása Epizód fájl URL megosztása Epizód fájl URL megosztása pozícióval + Kérlek erősítsd meg, hogy törlöd a %1$s csatornát, az összes letöltött epizóddal együtt. Idővonal eltávolítása Teljes idővonal frissítése Epizódok elrejtése @@ -119,8 +123,8 @@ Nem lejátszott Szüneteltetett Lejátszott - Várakozó - Nem várakozó + Sorbaállítva + Nincs sorbaállítva Letöltött Nem letöltött További tartalma van @@ -137,12 +141,12 @@ Törlés Epizód eltávolítása Megtekintettként megjelölve - Lejátszottként megjelölés + Jelölés játszottnak Lejátszottként megjelölve - Nem lejátszottként megjelölés - Várakozási sorhoz adás - Várakozási sorhoz adva - Várakozási sorból eltávolítás + Jelölés nem játszottnak + Sorbaállítás + Hozzáadva a lejátszási sorhoz + Eltávolítás lejátszási sorból Kedvencekhez adás Kedvencekhez adva Kedvencekből eltávolítás @@ -159,6 +163,8 @@ sikertelen Letöltés várakozik Letöltés fut + Részletek + %1$s \n\nFájl URL:\n%2$s Táreszköz nem található Túl kevés tárhely Fájl Hiba @@ -173,30 +179,212 @@ Tiltott Az összes letöltés visszavonása Letöltés visszavonva + Letöltés befejeződött, hibák léptek fel + Jelentés letöltése + Lekérési hiba + Adatbázis hozzáférési hiba + + %d letöltés van hátra + %d letöltés van hátra + + Letöltések feldolgozása + Podcast adatok letöltése + %1$d letöltés sikeres, %2$d sikertelen + Ismeretlen cím + Csatorna + Média fájl + Kép + Bejelentkezés szükséges + A kért forrás felhasználónevet és jelszót kér + Átmenetileg engedélyez + Hiba! + Előkészítés + Kész + Tekerés + Szerver kapcsolat megszakadt + Ismeretlen hiba + Pufferelés + Podcast lejátszása + Lejátszási sor lezárása + Lejátszási sor feloldása + Lejátszási sor lezárva + Lejátszási sor feloldva + Lejátszási sor tisztítása + Visszavonás + Elem eltávolítva + Mozgatás az elejére + Mozgatás a végére + Rendezés + Dátum + Hossz + Epizód cím + Csatorna cím + Növekvő + Csökkenő + Flattr bejelentkezés + Hozzáférés megtagadva + Kiegészítő letöltése + Kiegészítő nincs telepítve + Lejátszási sebesség + Sonic engedélyezése + Nincs elem a listában + Egy csatornára sem iratkoztál még fel + Tároló + Projekt + Egyebek + Rólam + Lejátszási sor + Flattr + Lejátszás szüneteltetése fejhallgató és bluetooth leválasztásakor + Előre gomb átugor + Előző gomb újraindít + Autómata törlés + Intelligens játszottnak jelölés + Lejátszás + Hálózat + Intervallum + Időpont + minden %1$s + %1$s-kor + Média fájlok letöltése csak WiFi-n + Folyamatos lejátszás + WiFi média lejátszás + Fejhallgató leválasztása + Fejhallgató újracsatlakoztatása + Bluetooth újracsatlakozás + Frissítések mobiladat-kapcsolaton + Frissítések engedélyezése mobiladat-kapcsolaton keresztül + Flattr beállítások + Flattr bejelentkezés + Hozzáférés megvonása + Felhasználói felület + Téma kiválasztása + Navigációs fiók testreszabása + Navigációs fiók kinézetének testreszabás + Navigációs fiók elemeinek kiválaasztása + AntennaPod kinézetének megváltoztatása + Autómatikus letöltés + Epizódok autómatikus letöltésének beállítása + Wi-Fi szűrő beállítása + Párhuzamos letöltések + Epizód gyorsítótár + Világos + Sötét + óra + óra + Bejelentkezés + Jelentkezz be a gpodder.net fiókodba a feliratkozások szinkronizálásához. + Kijelentkezés + Kijelentkezés sikeres + Változások szinkronizálása most + Teljes szinkronizálás most + Lejátszási sebesség + Értesítés kibontása + Mindig kibontja az értesítést a vezérlő gombok megjelenítéséhez. + Zárképernyő gombok beállítása + Zárképernyő háttérkép + Zárképernyő háttérkép átállítása az epizód képeként. + Kép gyorsítótár mérete + Kép gyorsítótár méretének a lemezen + Hibajelentés + Kísérleti + Sonic Media Player + Proxy + Hálózati proxy beállítása + GYIK + Ismert hibák + Nem található webböngésző + Chromecast támogatás + Epizódok keresése + Keresés + Importálás indítása + OPML importálása + HIBA! + OPML fájl olvasása + Elalvás időzítő engedélyezése + Elalvás időzítő kikapcsolása + KATEGÓRIÁK + AJÁNLÁSOK + Bejelentkezés + Bejelentkezés + Felhasználónév + Jelszó + Eszköz kiválasztása + Sikeres + Sikertelen + Kiválasztott mappa: + Mappa létrehozása + Mappa már létezik + Mappa nem üres + Alapértelmezett mappa kiválasztása + Feliratkozás + Feliratkozva + Letöltés... + Hang + Video + Következő oldal betöltése + iTunes keresés + fyyd keresés + Mind + Letöltve + Nincs letöltve + Sorbaállítva + Nincs sorbaállítva + Cím (A \u2192 Z) + Cím (Z \u2192 A) + Dátum (Új \u2192 Régi) + Dátum (Régi \u2192 Új) + Hossz (Rövid \u2192 Hosszú) + Hossz (Hosszú \u2192 Rövid) + Kérdezz rákésőbb + Hang vezérlők + Lejátszási sebesség + Hangerő + B + J + Hangeffektek + Lekeverés: Sztereót Monora + Csak Sonic + Típus + Kiszolgáló + Port + (Opcionális) + Teszt + Teszt sikeres + Teszt sikertelen + Kiszolgáló nem lehet üres + Port nem helyes + Adatbázis importálása/exportálása + Importálás + Exportálás + Fájl kiálasztás importáláshoz + Exportálás sikeres + Hiba a hangerő beállítása közben + Hiba a lejátszás közben. Átugrás... diff --git a/core/src/main/res/values-it-rIT/strings.xml b/core/src/main/res/values-it-rIT/strings.xml index 23c8ec1c0..75c02130e 100644 --- a/core/src/main/res/values-it-rIT/strings.xml +++ b/core/src/main/res/values-it-rIT/strings.xml @@ -13,8 +13,8 @@ In esecuzione Completati Registro - Abbonamenti - Elenco degli Abbonamenti + Sottoscrizioni + Elenco sottoscrizioni Annulla\nil Download Cronologia delle riproduzioni gpodder.net @@ -131,6 +131,7 @@ Non in coda Scaricati Non scaricati + Pulizia dell\'episodio Filtrati {fa-exclamation-circle} Ultimo aggiornamento fallito Apri Podcast @@ -142,6 +143,7 @@ Stream Rimuovi Elimina + Impossibile eliminare il file. Il riavvio del dispositivo potrebbe aiutare. Rimuovi l\'episodio Segna come visto Segna come riprodotto @@ -166,6 +168,8 @@ fallito Download in attesa Download in corso + Dettagli + %1$s \n\nURL file:\n%2$s Spazio di archiviazione non trovato Spazio insufficiente Errore del file @@ -202,7 +206,9 @@ Autenticazione richiesta La risorsa che hai richiesto richiede un nome utente e una password Conferma il download su cellulare - Metti in Coda + Il download tramite rete mobile è disattivato nelle impostazioni.\n\nÈ possibile scegliere di aggiungere semplicemente l\'episodio alla coda o consentire temporaneamente il download.\n\nLa scelta verrà ricordata per 10 minuti. + Il download tramite rete mobile è disattivato nelle impostazioni.\n\nVuoi abilitare temporaneamente il download?\n\nLa scelta verrà ricordata per 10 minuti. + Aggiungi alla coda Consenti temporaneamente Errore! @@ -263,6 +269,7 @@ Scarica plugin Plugin non installato + Per far funzionare la riproduzione a velocità variabile raccomandiamo di usare il Sonic mediaplayer integrato [Android 4.1+].\n\nAltrimenti è possibile scaricare il plugin di terze parti Prestissimo dal Play Store.\nQualsiasi problema riscontrato con Prestissimo non dipende da AntennaPod e dovrebbe esser segnalato allo sviluppatore del plugin. Velocità di riproduzione Abilita Sonic @@ -278,16 +285,32 @@ Coda Servizi Flattr + Pulizia episodi + Gli episodi che non sono in coda e non sono tra i preferiti potrebbero essere rimossi se i Download Automatici richiedono maggiore spazio. + Sospendi la riproduzione quando le cuffie o il bluetooth sono disconnessi Riprendi la riproduzione quando vengono riconnesse le cuffie + Riprendere la riproduzione quando il Bluetooth si riconnette + Il tasto Avanti salta la traccia + Quando viene premuto un tasto Avanti fisico, viene saltata la traccia invece di andare avanti veloce + Il tasto Indietro riavvia la traccia + Quando viene premuto un tasto Indietro fisico, viene riavviata la traccia invece di tornare indietro Passa al prossimo episodio in coda quanto si completa una riproduzione Elimina l\'episodio quando viene completata la riproduzione Elimina automaticamente + Contrassegna gli episodi come riprodotti anche se rimangono alcuni secondi da riprodurre + Imposta come Riprodotto intelligente + Mantieni gli episodi quando vengono saltati Manteni gli Episodi Saltati + Mantieni gli episodi quando sono segnati come Preferiti + Mantieni episodi preferiti Riproduzione Rete + Intervallo o orario di aggiornamento + Imposta un intervallo di tempo o un orario specifico in cui le sottoscrizioni si aggiornano automaticamente Puoi impostare un intervallo come \"ogni 2 ore\", impostare un\'ora del giorno specifica, come \"7:00\" oppure disabilitare gli aggiornamenti automatici del tutto.\n\nNota: I tempi di aggiornamento non sono perfetti. Potrai riscontrare dei brevi ritardi. Disabilita Imposta Intervallo + Imposta orario ogni %1$s alle %1$s Abilita il download dei media solo tramite WiFi @@ -309,19 +332,28 @@ Flattr automatico Configura l\'esecuzione automatica di Flattr Interfaccia utente - Seleziona un Tema - Imposta l\'ordine delle Iscrizioni + Seleziona un tema + Personalizza menù di navigazione + Personalizza l\'aspetto del menù di navigazione + Seleziona elementi del menù + Aggiunti o rimuovi gli elementi che appaiono nel menù laterale. + Imposta l\'ordine delle sottoscrizioni + Modifica l\'ordine delle tue sottoscrizioni + Contatore delle sottoscrizioni + Scegli cosa rappresenta il numero nel menù laterale alla voce Sottoscrizioni Cambia l\'aspetto di AntennaPod Download Automatico Configura il download automatico degli episodi Abilita il filtro Wi-Fi Abilita il download automatico solo per alcune reti Wi-Fi selezionate. + Scarica da rete mobile + Abilita il download automatico anche tramite la rete mobile. Scarica quando la batteria non è in carica Permetti il download automatico quando la batteria non è in carica Download Contemporanei Cache degli Episodi - Light - Dark + Chiaro + Scuro Illimitato ore ora @@ -332,53 +364,98 @@ Logout effettuato Cambia le informazioni di login Cambia le informazioni di login per il tuo account gpodder.net. + Esegui sincronizzazione delle modifiche + Sincronizza le modifiche alle sottoscrizioni e allo stato degli episodi su gpodder.net + Esegui sincronizzazione completa + Sincronizza tutte le sottoscrizioni e gli stati degli episodi con gpodder.net + Ultimo tentativo: %1$s (%2$s) Sincronizzazione avviata + Sincronizzazione avviata + %1$s con il dispositivo %2$s]]> + Notifica gli errori di sincronizzazione + Non si applica agli errori di autenticazione. Velocità di riproduzione Personalizza le velocità disponibili per la riproduzione audio a velocità variabile + Tempo di salto in avanti + Personalizza il numero di secondi da saltare in avanti quando si preme il tasto Avanti Veloce + Tempo di salto indietro + Personalizza il numero di secondi da saltare indietro quando si preme il tasto Riavvolgi Imposta l\'hostname Usa l\'host di default Espandi le notifiche Espandi sempre le notifiche per mostrare i pulsanti di riproduzione. Controlli di riproduzione persistenti Mantieni le notifiche e i controlli del blocco dello schermo quando la riproduzione è in pausa. + Pulsanti su schermata di blocco + Modifica i pulsanti di riproduzione sulla schemata di blocco. Play/Pausa è sempre presente. + Seleziona al massimo %1$d voci + Puoi selezionare al massimo %1$d voci. + Cambia sfondo della schermata di blocco + Sostituisce l\'immagine della schermata di blocco con quella dell\'episodio in riproduzione. Mostrerà l\'immagine anche in app di terze parti. Mostra il Rapporto del Download + Se il download fallisce, genera un report che mostra i dettagli dell\'errore. Le versioni di Android prima della 4.1 non supportano le notifiche estese. Aggiungi un nuovo episodio in testa alla coda. Aggiungi in cima alla coda Disabilitato Dimensione Cache delle Immagini + Dimensione cache per le immagini + Report dei crash + Invia il report dell\'ultimo crash via e-mail Invia e-mail Sperimentale + Sonic Media Player + Usa il sonic media player integrato in sostituzione di Prestissimo e del mediaplayer nativo di Android Valore corrente: %1$s Proxy + Imposta proxy di rete FAQ Problemi noti + Nessun browser web trovato. Supporto a Chromecast + Abilita il supporto per la riproduzione multimediale remota sui device Cast (Chromecast, casse esterne o Android TV) + Chromecast richiede librerie proprietarie di terze parti che sono disabilitate in questa versione di AntennaPod + Aggiungi i download alla coda + Aggiungi gli episodi scaricati alla coda di riproduzione Abilita l\'esecuzione automatica di Flattr Carica l\'episodio su Flattr appena è stato riprodotto al %d percento Carica l\'episodio su Flattr appena comincia la riproduzione Carica l\'episodio su Flattr appena finisce la riproduzione + Cerca negli episodi + Trovato nelle note dell\'episodio Trovato nei capitoli + Trovato nell\'autore + Trovato nel feed Nessun risultato trovato Ricerca Trovato nel titolo + Nessun risultato trovato per \"%1$s\" I file OPML ti permettono di spostare i tuoi podcast da un programma ad un altro. + Opzione %1$d + Scegli un percorso specifico dal filesystem locale. + Usa un\'applicazione esterna come Dropbox, Google Drive o il tuo gestore file preferito per aprire un file OPML. + Molte applicazioni come Google Mail, Dropbox, Google Drive e i gestori di file possono aprire i file OPML con AntennaPod. Avvio importazione Importazione OPML ERRORE! Lettura OPML file in corso + E\' stato riscontrato un errore nell\'apertura del documento OPML Nessun file selezionato! Seleziona tutti Deseleziona tutti + Seleziona... Dal filesystem locale Utilizza un\'applicazione esterna Esportazione su OPML + Esportazione in HTML + Esportazione in corso... Errore di esportazione - Esportazione OPML avvenuta con successo. - Il file .opml è stato scritto su:\u0020 + Esportazione eseguita + Il file esportato è stato salvato in:\n\n%1$s + E\' necessario accedere alla memoria esterna per leggere il file OPML Imposta timer Disabilita il timer di spegnimento @@ -386,6 +463,8 @@ Timer di spegnimento Tempo residuo:\u0020 Input non valido, il campo deve essere un numero intero. + Quando il timer sta per scadere: + Scuoti per resettare il timer Vibra secondi minuti @@ -403,6 +482,8 @@ %d ore Abilita automaticamente + Timer spegnimento abilitato + Timer spegnimento disabilitato CATEGORIE TOP PODCAST @@ -422,6 +503,7 @@ Scegli un dispositivo esistente: L\'ID del dispositivo non può essere vuoto ID di dispositivo già in uso + La didascalia non può essere vuota Scegli Login effettuato! Congraturazioni! Il tuo account gpodder.net è stato collegato con il tuo dispositivo. Da ora AntennaPod sincronizzerà automaticamente le sottoscrizioni sul tuo dispositivo con il tuo account gpodder.net. @@ -431,10 +513,14 @@ Nome utente o password errati gpodder.net errore di sincronizzazione Rilevato un errore in fase di sincronizzazione:\u0020 + Eseguito + Fallito Seleziona la cartella: Crea una cartella Scegli la directory per i dati + Scegli la base della tua cartella dati. AntennaPod creerà le sottocartelle appropriate. + E\' necessario accedere alla memoria esterna per cambiare la cartella dei dati Crea una nuova directory con nome \"%1$s\"? Crea una nuova directory Impossibile scrivere in questa directory @@ -448,7 +534,9 @@ Scegli la cartella predefinita Sospendi la riproduzione invece di abbassare il volume quando un\'altra app emette un suono Pausa su interruzione + Riprendi la riproduzione al termine di una chiamata Riprendi dopo la chiamata + AntennaPod deve essere riavviato per applicare le modifiche. Abbonati Abbonato @@ -466,14 +554,20 @@ Autenticazione Cambia il tuo nome utente e la tua password per questo podcast e i suoi episodi. + Impostazioni download automatici + Filtro degli episodi + Elenco di termini per filtrare gli episodi da includere o escludere dai download automatici. Includi Escludi + Parole singole \n\"Parole multiple\" Mantieni Aggiornato + Aggiornamento del database Importazione di sottoscrizioni da applicazioni monouso in corso... Cerca su iTunes Filtro + Cerca su fyyd Tutto Seleziona tutti gli Episodi @@ -491,6 +585,7 @@ Seleziona gli episodi in coda Non in coda Seleziona gli episodi non in coda + Ha media Seleziona gli episodi con elementi multimediali Titolo (A \u2192 Z) @@ -501,7 +596,10 @@ Durata (Lunghi \u2192 Corti) Ti piace AntennaPod? + Ci farebbe molto piacere se potessi valutare AntennaPod. + Lasciatemi in pace Ricordamelo più tardi + Certo, facciamolo! Controlli audio Velocità di riproduzione @@ -509,6 +607,8 @@ Sx Dx Effetti Audio + Downmix: da Stereo a Mono + solo Sonic Tipo Host @@ -518,9 +618,31 @@ Controllo in corso... Test avvenuto con successo Test fallito + L\'host non può essere vuoto + L\'host non è un IP o un dominio valido Porta non valida + Importa/Esporta database + Questa funzione sperimentale può essere usata per trasferire le sottoscrizioni e gli episoti completati ad un altro dispositivo.\n\nIl database potrà essere importato solo se si usa la stessa versione di AntennaPod, altrimenti potrebbero generarsi comportamenti anomali.\n\nDopo l\'importazione, gli episodi potrebbero essere mostrati come scaricati anche se non lo sono. Basta premere Play per farli riconoscere ad AntennaPod. + Importa + Esporta + Scegli file da importare + Esportazione eseguita + Importazione eseguita.\n\nPremi OK per riavviare AntennaPod Riproduci su... + Disconnetti la sessione di cast + Il media selezionato non è compatibile con il dispositivo di ricezione + Avvio della riproduzione del media fallito + Arresto della riproduzione del media fallito + Pausa della riproduzione del media fallita + Impostazione del volume fallita + Nessuna connessione al dispositivo di ricezione + Connessione al dispositivo persa. L\'applicazione sta cercando di ristabilire la connessione, se possibile. Per favore attendi qualche secondo e riprova. + Esecuzione dell\'operazione fallita + Sincronizzazione con il dispositivo ricevente fallita + Ricerca della nuova posizione sul dispositivo ricevente fallita + Il dispositivo ricevente ha restituito un errore grave + Errore nella riproduzione. Salto... diff --git a/core/src/main/res/values-it/strings.xml b/core/src/main/res/values-it/strings.xml index 45cd8d334..f7988a463 100644 --- a/core/src/main/res/values-it/strings.xml +++ b/core/src/main/res/values-it/strings.xml @@ -121,6 +121,7 @@ Condividi l\'URL del File dell\'epsiodio con la Posizione Conferma che desideri cancellare il feed \"%1$s\" e TUTTI i suoi episodi scaricati. Rimozione del Feed in corso + Aggiorna il feed completo Nascondi gli episodi Applica le azioni Non riprodotti @@ -141,6 +142,7 @@ Stream Rimuovi Elimina + Impossibile eliminare il file. Il riavvio del dispositivo potrebbe aiutare. Rimuovi l\'episodio Segna come visto Segna come riprodotto @@ -165,6 +167,7 @@ fallito Download in attesa Download in corso + Dettagli Spazio di archiviazione non trovato Spazio Insufficiente Errore del file @@ -277,10 +280,15 @@ Coda Servizi Flattr + Pulizia dell\'episodio + Gli episodi che non sono in coda e non sono preferiti dovrebbero essere idonei alla rimozione se Auto Download richiede spazio per nuovi episodi + Sospendi la riproduzione quando le cuffie o il bluetooth sono disconnessi Riprendi la riproduzione quando le cuffie vengono ricollegate + Reprendi la riproduzione quando le cuffie o il bluetooth sono disconnessi Passa al prossimo episodio in coda al termine della riproduzione Elimina l\'episodio al termine della riproduzione Elimina Automaticamente + Contrassegna gli episodi come riprodotti anche se rimane meno di un certo numero di secondi di tempo di riproduzione Manteni gli Episodi Saltati Riproduzione Rete @@ -376,8 +384,6 @@ Usa un\'applicazione esterna Esportazione OPML Errore di esportazione - Esportazione OPML avvenuta con successo. - Il file .opml è stato scritto su:\u0020 Imposta timer di spegnimento Disabilita il timer di spegnimento @@ -499,7 +505,9 @@ Durata (Lunghi \u2192 Corti) Ti piace AntennaPod? + Lasciami solo Ricordamelo più tardi + Certo, facciamolo! Controlli audio Velocità di riproduzione @@ -516,8 +524,11 @@ Controllo in corso... Test avvenuto con successo Test fallito + Host non può essere vuoto Porta non valida + Seleziona il file da importare + Esportato con successo. Riproduci su... diff --git a/core/src/main/res/values-iw-rIL/strings.xml b/core/src/main/res/values-iw-rIL/strings.xml index 96475b40e..ffbd4f6e1 100644 --- a/core/src/main/res/values-iw-rIL/strings.xml +++ b/core/src/main/res/values-iw-rIL/strings.xml @@ -2,58 +2,71 @@ הזנות - סטטיסטיקות - הוסף פודקאסט + סטטיסטיקה + הוספת פודקאסט פרקים - הכל + הכול מועדפים חדש הגדרות הורדות - פועל - סיים + פעיל + הושלם יומן פודקאסטים רשימת פודקאסטים - בטל הורדה + ביטול\nהורדה היסטוריית ניגון gpodder.net - התחברות אל gpodder.net - %1$s חינם - זכרון -המטמון של פרקים מלא - זכרון-המטמון של פרקים הגיע לגבול שלו. אפשר להגדיל את גודל המטמון בהגדרות. + כניסה אל gpodder.net + %1$s פנויים + מטמון הפרקים מלא + מטמון הפרקים התמלא. ניתן להגדיל את גודל המטמון בהגדרות. - סה\"כ זמן ניגון של פודקאסטים: - חשב זמן שנוגן בפועל. פרק שנוגן פעמיים נספר פעמיים, לעומת פרק שרק סומן כנוגן - שלא נספר. + זמן ניגון הפודקאסטים הכולל: + %1$d מתוך %2$d פרקים החלו.\n\nנוגנו %3$s מתוך %4$s. + מצב סטטיסטיקה + חישוב זמן שנוגן בפועל. נגינה כפולה נספרת פעמיים, בעוד שסימון כנוגן לא נחשב. + סיכום כל הפודקאסטים שסומנו כנוגנו + לתשומת לבך: אין התייחסות למהירות הנגינה. - פתח תפריט - סגור תפריט - מיין בסדר אלפביתי - מיין לפי תאריך פרסום - מיין לפי מספר פרקים שהושמעו + פתיחת תפריט + סגירת תפריט + העדפות מגירה + מיון לפי מונה + מיון בסדר אלפביתי + מיון לפי תאריך פרסום + מיון לפי מספר פרקים שהושמעו + מספר פרקים חדשים וכאלו שעדיין לא התנגנו + מספר פרקים חדשים + מספר פרקים שעוד לא התנגנו + מספר פרקים שהתקבלו + ללא - פתח בדפדפן - העתק כתובת אתר - שתף כתובת אתר - כתובת אתרהועתקה ללוח. - עבור למיקום זה + פתיחה בדפדפן + העתקת כתובת + שיתוף כתובת + הכתובת הועתקה ללוח הגזירים + מעבר למיקום זה - נקה היסטוריה + ניקוי היסטוריה אישור - בטל + ביטול כן לא - מחבר + איפוס + יוצר שפה כתובת הגדרות תמונה שגיאה אירעה שגיאה: - רענן - אין אחסון חיצוני זמין. אנא ודא כי אחסון חיצוני הוא מותקן כך שהאפליקציה תוכל לעבוד כמו שצריך. + רענון + אין אחסון חיצוני זמין. נא לוודא שיש אחסון חיצוני מעוגן כדי שהיישומון יוכל לפעול כראוי. פרקים + משך: %1$s הערות פרק תיאור הפרק האחרון:\u0020 @@ -62,187 +75,285 @@ גודל:\u0020 מעבד טוען... - שמור שם משתמש וססמה - סגור - נסה שוב - כלול בהורדות אוטומטיות + שמירת שם משתמש וססמה + סגירה + לנסות שוב + לכלול בהורדות אוטומטיות + החלה על פרקים קודמים + הגדרות ההורדה האוטומטית החדשות יחולו אוטומטית על פרקים חדשים.\nלהחיל אותן גם על פרקים שפורסמו בעבר? + מחיקת פרק באופן אוטומטי \u0020הורדות במקביל + בררת מחדל גלובלי תמיד אף פעם - שלח... + שליחה… אף פעם + כאשר לא בתור אחרי סיום יום אחרי סיום + %d ימים לאחר סיום + %d ימים לאחר סיום %d ימים לאחר סיום כתובת הזנה - כתובת של הזנה או אתר אינטרנט - הוסף פודקאסט לפי כתובת אתר + www.example.com/feed + הוספת פודקאסט לפי כתובת חפש פודקאסט בספריה - עיין בgpodder.net + לאיתור פודקאסטים חדשים, ניתן לחפש ב־iTunes או ב־fyyd או לעיין ב־gpodder.net לפי שם, קטגוריה או פופולריות. + עיון ב־gpodder.net - סמן הכל כנקרא - סמן את כל הפרקים כנקרא - אנא אשר שאתה רוצה לסמן את כל פרקים כנקראים. - אנא אשר שאתה רוצה לסמן את כל פרקים בהזנה זו כנקראים. - סמן את כולם כנראו - סמן את כל הפרקים כנראו - אנא אשר שאתה רוצה לסמן את כל פרקים כנראו. - הצג מידע - שנה שם פודקאסט - הסר פודקאסט - שתף... - שתף קישור אתר - הסר הזנה - רענן את כל ההזנה - הסתר פרקים + סימון הכול כנוגנו + סימון את כל הפרקים כנוגנו + נא לאשר שברצונך לסמן את כל הפרקים כנוגנו. + נא לאשר שברצונך לסמן את כל הפרקים בהזנה הזאת כנוגנו. + סימון כולם כנצפו + סימון כל הפרקים כנצפו + נא לאשר שברצונך לסמן את כל הפרקים כנצפו. + הצגת מידע + שינוי שם פודקאסט + הסרת פודקאסט + שיתוף… + שיתוף קישור + שיתוף כתובת + שיתוף קישור עם מיקום + שיתוף כתובת הזנה + שיתוף הכתובת של קובץ הפרק + שיתוף הכתובת של כתובת הפרק עם מיקום + נא לאשר שברצונך למחוק את ההזנה „%1$s” ואת כל הפרקים שהורדת של ההזנה הזאת. + ההזנה נמחקת + רענון אלו שהסתיימו בהזנה + הסתרת פרקים + החלת פעולות + לא נוגן + מושהה + נוגן + בתור + לא בתור + הורד + לא הורד + יש מדיה + מסונן + {fa-exclamation-circle} הרענון האחרון נכשל + פתיחת פודקאסט - הורד - נגן - השהה - עצור - הזרם - הסר - הסר פרק - סמן כנקרא - סומן כנקרא - סמן כלא נקרא - הוסף לתור + הורדה + ניגון + השהיה + עצירה + הזרמה + הסרה + מחיקה + לא ניתן למחוק קובץ. הפעלת המכשיר מחדש עשויה לסייע. + הסרת פרק + סימון כנצפה + סימון כנצפה + סימון כנוגן + סימון כלא נוגן + הוספה לתור התווסף לתור - הסר מהתור + הסרה מהתור התווסף למועדפים - בקר באתר - תרום באמצעות Flattr - דלג על הפרק + התווסף למועדפים + הסרה מהמועדפים + הוסר מהמועדפים + ביקור באתר + תרומה עם Flattr + דילוג על פרק + הפעלת הורדה אוטומטית + השבתת הורדה אוטומטית + איפוס מיקום הנגינה + פריט הוסר הצלחה - כישלון - הורדה עתידית + כשל + הורדה ממתינה הורדה מתבצעת - התקן איחסון לא נמצא - אין די שטח איחסון + פרטים + %1$s \n\nכתובת הקובץ:\n%2$s + התקן האחסון לא נמצא + אין די שטח אחסון שגיאת קובץ - שגיאת מידע HTTP + שגיאת נתוני HTTP שגיאה לא ידועה - שגיאת תוכנית ניתוח + שגיאת מפענח סוג ההזנה אינו נתמך שגיאת חיבור שרת לא ידוע שגיאת אימות - בטל את כל ההורדות + שגיאת סוג קובץ + אסור + ביטול כל ההורדות הורדה בוטלה - הורדות הושלמו - כתובת אתר שגויה + ההורדה בוטלה\nההורדה האוטומטית הושבתה עבור פריט זה + הורדות הושלמו עם שגיאה אחת או יותר + דוח הורדה + כתובת שגויה שגיאת קלט פלט שגיאת בקשה שגיאת גישה למסד הנתונים - מעבד הורדות - מוריד פודקאסט - %1$d הורדות הצליחו, %2$d ניכשלו + + נותרה הורדה %d + נותרו %d הורדות + נותרו %d הורדות + נותרו %d הורדות + + ההורדות בהליכי עיבוד + נתוני הפודקאסט מתקבלים + %1$d הורדות הצליחו, %2$d נכשלו כותרת לא ידועה הזנה קובץ מדיה תמונה - שגיאה אירעה בעת הניסיון הורדת הקובץ:\u0020 - נידרש אימות - המשאב אותה ביקשת דורש שם משתמש וססמה + אירעה שגיאה בעת הניסיון הורדת הקובץ:\u0020 + נדרש אימות + המשאב שביקשת דורש שם משתמש וססמה + אישור הורדה דרך רשת סלולרית + הורדה דרך חיבור נתונים של רשת סלולרית מושבת דרך ההגדרות.\n\nניתן לבחור בין הוספת הפרק לתור או לאפשר להוריד אותו באופן זמני.\n\nהבחירה שלך תישמר למשך 10 דקות. + הורדה דרך חיבור נתונים של רשת סלולרית מושבת דרך ההגדרות.\n\nלאפשר את ההורדה באופן זמני?\n\nהבחירה שלך תישמר למשך 10 דקות. + הוספה לתור + לאפשר לבינתיים שגיאה! - מדיה לא מתנגנת - מתכונן - מוכן - מחפש - שרת מת + אין מדיה מתנגנת + בהכנה + בהמתנה + מתבצע איתור + השרת לא מגיב שגיאה לא ידועה - מדיה לא מתנגנת - ממלא חוצץ - מנגן פודקאסט - אנטנה-פוד - מפתח מדיה לא ידוע: %1$d + אין מדיה מתנגנת + החוצץ מתמלא + פודקאסט מתנגן + אנטנה־פּוֹד - מפתח מדיה לא ידוע: %1$d - נקה תור - בטל - הסר פריט - העבר למעלה - העבר למטה - מיין + נעילת תור + שחרור תור + התור ננעל + התור שוחרר מנעילה + ניקוי תור + ביטול + פריט הוסר + העברה למעלה + העברה למטה + מיון תאריך משך + כותרת הפרק + כותרת ההזנה בסדר עולה בסדר יורד - אנא אשר שאתה רוצה לנקות את התור מכל הפרקים שבו + נא לאשר את פינוי התור מכל הפרקים שבו - כניסה ל-Fattr - לחץ על הכפתור למטה כדי להתחיל את תהליך האימות. אתה תועבר למסך כניסת flattr בדפדפן שלך ותתבקש לתת לאנטנה-פוד רשות לתרום באמצעות flattr. לאחר שקבלת אישור, תוכל לחזור למסך זה באופן אוטומטי. + כניסה ל־Fattr + נא ללחוץ על הכפתור שלמטה כדי להתחיל את תהליך האימות. פעולה זו תעביר אותך למסך הכניסה של Flattr בדפדפן שלך ותופיע בקשה לאפשר לאנטנה־פּוֹד לבצע פעולות ב־Flattr. לאחר מתן ההרשאה, המערכת תחזיר אותך למסך זה אוטומטית. אימות - חזור למסך הבית - האימות הצליח! עכשיו אתה יכול לתרום באמצעות flattr מתוך האפליקציה. - אסימון flattr לא נמצא - חשבון ה-flattr שלך אינו מחובר לאנטנה-פוד. הקש כאן לאימות. - חשבון ה-flattr שלך אינו מחובר לאנטנה-פוד. אתה יכול לקשראת לחשבונך לאנטנה-פוד לתרום באמצעות flattr מתוך האפליקציה או שאתה יכול לבקר באתר האינטרנט של הדבר לו תרצה לתרום. - אמת + חזרה למסך הבית + האימות הצליח! כעת יש לך אפשרות לתרום עם Flattr מתוך היישומון. + לא נמצא אסימון Flattr + נראה כי חשבון ה־Flattr שלך אינו מחובר לאנטנה־פּוֹד. יש לגעת כאן לאימות. + נראה כי חשבון ה־Flattr שלך אינו מחובר לאנטנה־פּוֹד. יש לך אפשרות לחבר את חשבונך לאנטנה־פּוֹד כדי לתרום עם Flattr מתוך היישומון או לבקר באתר של מה שברצונך לתרום לו עם Flattr. + אימות הפעולה אסורה - לאנטנה-פוד אין הרשאה לפעולה זו. הסיבה לכך יכולה להיות שאסימון הגישה של אנטנה-פוד לחשבון שלך בוטל. אתה יכול לבצע אימות מחדש או לבקר באתר האינטרנט של הדבר במקום. + לאנטנה־פּוֹד אין הרשאה לבצע פעולה זו. הסיבה לכך עשויה להיות שאסימון הגישה של אנטנה־פּוֹד לחשבון שלך נשלל. ניתן לאמת מחדש או לבקר באתר המיועד במקום. גישה בוטלה - אסימון הגישה של אנטנה-פוד לחשבונך בוטל. על מנת להשלים את התהליך, אתה צריך להסיר יישום זה מהרשימת היישומים שאושרו בהגדרות החשבונך באתר flattr. + אסימון הגישה של אנטנה־פוד לחשבונך בוטל. על מנת להשלים את התהליך, אתה צריך להסיר יישום זה מהרשימת היישומים שאושרו בהגדרות החשבונך באתר flattr. - תרמת ב-Flattr! - תרמת ב-Flattr %d פעמים! + תרמת ב־Flattr! + תרמת ב־Flattr %d פעמים! תרומות Flattr: %s. - כישלון לתרום ב-Flattr %d! - לא נתרם ב-Flattr: %s. - תרומות ב-Flattr מאוחר יותר - תורם ב-Flattr %s - אנטנה-פוד תורם ב-Flattr - אנטנה-פוד תרם ב-Flattr - כישלון תרומת אנטנה-פוד ב-Flattr - איחזור תרומות Flattr + התרומה ב־Flattr %d נכשלה! + לא נתרם ב־Flattr: %s. + לתרום ב־Flattr מאוחר יותר + תרומה ב־Flattr %s + תרומה ב־Flattr עם אנטנה־פּוֹד + תרומה ב־Flattr עם אנטנה־פּוֹד + התרומה באנטנה־פּוֹד עם Flattr נכשלה + תרומות Flattr מתקבלות - הורד תוסף + הורדת תוסף תוסף לא מותקן + כדי שתכונת המהירות המשתנה תפעל, מומלץ להפעיל את נגן המדיה המובנה בשם Sonic [מ־Android 4.1 ואילך].\n\nלחלופין, ניתן להוריד תוסף צד שלישי בשם Prestissimo מהחנות Play.\nכל תקלה שמופיעה ב־Prestissimo אינה באחריות אנטנה־פּוֹד ויש לדווח עליה לבעלים על התוסף. מהירויות ניגון + הפעלת Sonic אין פריטים ברשימה זו. - לא נרשמת עדיין להזנות. + לא נרשמת להזנות עדיין. + לפרק זה אין פרקים. + לפרק זה אין הערות פרק. + אחסון + מיזם אחר - אודות + על אודות תור שירותים Flattr - המשך את הניגון כשהאוזניות מחוברות מחדש - עבור לפריט הבא בתור כאשר הניגון מסתיים - מחק פרק כהניגון מסתיים + ניקוי פרקים + פרקים שאינם בתור ואינם במועדפים אמורים לענות לתנאים של הסרה במקרה שההורדה האוטומטית זקוקה למקום לפרקים חדשים + השהיית הנגינה כאשר האוזניות או ה־Bluetooth מנותקים + להמשיך את הניגון כשהאוזניות מחוברות מחדש + להמשיך את הנגינה עם חיבור מחדש של ה־Bluetooth + כפתור קדימה מדלג + לחיצה על כפתור החומרה קדימה מדלג לפרק הבא במקום להאיץ קדימה + כפתור אחורה מתחיל מחדש + לחיצה על כפתור החומרה אחורה מדלג מתחיל מחדש את נגינת הפרק הנוכחי במקום לחזור אחורה בפרק + לעבור לפריט הבא בתור כאשר הניגון מסתיים + מחיקת פרק כשהניגון מסתיים מחיקה אוטומטית + סימון פרקים כנוגנו אפילו אם נשארו כמה שניות לנגינה + סימון חכם כנוגנו + להשאיר פרקים למרות שדילגת עליהם + להשאיר פרקים שדולגו + להשאיר פרקים שסומנו כמועדפים + להשאיר פרקים מועדפים ניגון רשת - הורד קבצי מדיה רק דרך חיבור אינטרנט אלחוטי + זמן בין עדכונים או מועד ביום + נא לציין הפרש זמן או מועד ביום לרענון ההזנות אוטומטית + ניתן להגדיר הפרש זמן כגון „כל שעתיים”, להגדיר מועד ביום כגון „7:00” או להשבית עדכונים אוטומטיים לאלתר.\n\nלתשומת לבך: מועדי העדכון אינם מדויקים. יתכן עיכוב קל בפעולות. + השבתה + הגדרת הפרש זמן + הגדרת הזמן ביום + כל %1$s + ב־%1$s + הורדת קובצי מדיה רק דרך רשת אלחוטית ניגון מתמשך - הורדת מדיה דרך אינטרנט אלחוטי + הורדת מדיה דרך רשת אלחוטית ניתוק אוזניות חיבור אוזניות מחדש - עידכון דרך רשת סלולרית - אפשר עידכונים דרך רשת סלולרית - מרענן + חיבור Bluetooth מחדש + עדכון דרך רשת סלולרית + לאפשר עדכונים דרך רשת סלולרית + מתבצע רענון הגדרות Flattr - כניסה ל-Fattr - היכנס לחשבון שלך לflattr לתרום ישירות מתוך האפליקציה. + כניסה ל־Fattr + ניתן להיכנס לחשבון שלך ב־Flattr כדי לתרום ישירות מתוך היישומון. תרום באמצעות Flattr לאפליקציה זו - תמוך בפיתוח אנטנה-פוד בתרומה עם Flattr. תודה! - בטל גישה - בטל הרשאת גישה לחשבון flattr ליישום זה. + ניתן לתמוך בפיתוח של אנטנה־פּוֹד על ידי תרומה ב־Flattr. תודה! + ביטול גישה גישה + שלילת הרשאות הגישה לחשבון ה־Flattr שלך מיישומון זה. תרומות Flattr אוטומטיות - הגדר תרומות flattr אוטומטיות - ממשק משתמש - בחר ערכת נושא - שנה את מראה אנטנה-פוד + הגדרת תרומות Flattr אוטומטיות + מנשק משתמש + בחירת ערכת עיצוב + התאמת מגירת הניווט + התאמת תצוגת מגירת הניווט. + הגדרת פריטי מגירת ניווט + החלפת הפריטים שמופיעים במגירת הניווט. + הגדרת סדר מינויים + שינוי סדר המינויים שלך + הגדרת מונה מינויים + החלפת הפרטים שמוצגים על ידי מונה המינויים + שינוי המראה של אנטנה־פּוֹד הורדה אוטומטית - הגדר הורדה אטומטית של פרקים. - אפשר סינון אינטרנט אלחוטי - אפשר הורדה אוטומטית דרך רשתות אלחוטייות נבחרות. - הורדה כשלא טוען - אפשר הורדה אוטומטית כשהסוללה אינה נטענת + הגדרת הורדה אטומטית של פרקים. + הפעלת סינון רשתות אלחוטיות + לאפשר הורדה אוטומטית רק דרך רשתות אלחוטיות נבחרות. + הורדה דרך רשת סלולרית + לאפשר הורדה אוטומטית דרך חיבור נתונים של רשת סלולרית. + להוריד שלא בזמן טעינה + לאפשר הורדה אוטומטית כאשר הסוללה אינה בטעינה הורדות במקביל מטמון פרקים בהיר @@ -252,128 +363,296 @@ שעה ידני כניסה - כנס עם חשבון gpodder.net שלך על מנת לסנכרן את ההרשמות שלך. - התנתקות - ההתנתקות הייתה מוצלחת - שינוי פרטי התחברות - שנה פרטי התחברות של חשבון gpodder.net. + ניתן להיכנס לחשבונך ב־gpodder.net כדי לסנכרן את המינויים שלך. + יציאה + הצלחת לצאת + שינוי פרטי הכניסה + שינוי פרטי הכניסה לחשבון ה־gpodder.net שלך. + סנכרון השינויים כעת + סנכרון שינויי מצב במינויים ובפרקים מול gpodder.net. + סנכרון מלא כעת + סנכרון כל המינויים ומצבי הפרקים עם gpodder.net. + ניסיון הסנכרון האחרון: %1$s (%2$s) + הסנכרון התחיל + החל סנכרון מלא + %1$s עם ההתקן %2$s]]> + הצגת התרעות שגיאות סנכרון + הגדרה זו אינה חלה על שגיאות אימות. מהירויות ניגון - התאמת המהיריות הזמינות לניגון במהירות משתנה - הגדר שם שרת - השתמש בשרת ברירת מידל - הרחב הודעה - תמיד הרחב את ההודעה כדי להראות את לחצני הפעלה. - פקדי הפעלה קבועים - שמר בקרי הודעה ומסך נעילה בעת השהיית השמעה. - גרסאות אנדרויד לפני 4.1 לא תומכות בהודעות מורחבות. - הוסף פרקים חדשים לראש התור. - הוסף לראש התור. + בחירת המהירויות הזמינות למהירות נגינה משתנה + זמן דילוג בהאצה קדימה + התאמת מספר השניות של הקפיצה קדימה בעת לחיצה על כפתור ההאצה + זמן בקפיצה אחורה + התאמת מספר השניות של הקפיצה אחורה בעת לחיצה על כפתור החזרה + הגדרת שם מארח + שימוש בשם מארח כבררת מחדל + הרחבת הודעה + תמיד להרחיב את ההודעה כדי להציג את לחצני הנגינה. + פקדי נגינה קבועים + להשאיר את פקדי ההתרעות ומסך הנעילה גם כשהנגינה מושהית. + הגדרת כפתורים במסך נעילה + החלפת כפתור הנגינה במסך הנעילה. הכפתורים נגינה/השהיה תמיד נכללים. + בחירה עד %1$d פריטים + ניתן לבחור עד %1$d פריטים. + הגדרת רקע מסך הנעילה + הגדרת רקע מסך הנעילה לתמונה של הפרק שמתנגן כעת. כתופעת לוואי, התמונה תופיע גם ביישומי צד שלישי. + הצגת דוח הורדה + אם ההורדה נכשלת, יש ליצר דוח שמציג את פרטי הכשל. + גרסאות Android שקדמו ל־4.1 אינן תומכות בהתרעות מתרחבות. + הוספת פרקים חדשים לראש התור. + הוספה לראש התור. + מושבת + גודל מטמון התמונות + הנפח בכונן שעשוי לשמש למטמון של תמונות. + דיווח על קריסה + שליחת דיווח הקריסה העדכני ביותר דרך דוא״ל + שליחת דוא״ל + ניסיוני + נגן המדיה Sonic + שימוש בנגן Sonic המובנה כחלופה לנגן המדיה המובנה של Android ו־Prestissimo + ערך נוכחי: %1$s + מתווך + הגדרת מתווך רשת + שו״ת + תקלות ידועות + לא נמצא דפדפן. + תמיכה ב־Chromecast + הפעלת תמיכה בנגינת מדיה על התקני שידור מרוחקים (כגון Chromecast, רמקולים דיגיטליים או Android TV) + לתמיכה ב־Chromecast נדרשות ספריות קנייניות מאת צד־שלישי שמושבתות בגרסה זו של אנטנה־פּוֹד + הוספת הורדות לתור + הוספת פרקים שהתקבלו לתור - הפעל תרומות flattr אוטומטיות - תרום באמצעות flattr כשנוגן %d אחוזים מהפרק - תרום באמצעות flattr כשניגון פרק מתחיל - תרום באמצעות flattr כשניגון פרק מסתיים + הפעלת תרומות Flattr אוטומטיות + לתרום לפרק כאשר התנגנו %d אחוזים + לתרום עם Flattr עם תחילת נגינת פרק + לתרום עם Flattr עם סיום נגינת פרק + חיפוש אחר פרקים + נמצא בהערות הפרק נמצא בפרקים - אין תוצאות + נמצא בין היוצרים + נמצא בערוץ התוכן + לא נמצאו תוצאות חיפוש נמצא בכותרת + לא נמצאו תוצאות עבור „%1$s” - קבצי OPML יאפשרו לכך לנייד פודקאסטים מלוכד פודקאסטים אחד למשנו. - בחר נתיב קובץ ספציפי במערכת הקבצים המקומית. - השתמש ביישומים חיצוניים כמו Dropbox, Google Drive או מנהל הקבצים האהוב עליך לפתוח קובץ OPML. - יישומים רבים כמו Google Mail, Dropbox, Google Drive ורוב מנהלי הקבצים יכולים לפתוח קבצי OPML עם אנטנה-פוד. - התחל יבוא - יבוא OPML + קובצי OPML מאפשרים לך להעביר את הפודקאסטים שלך ממכשיר אחד למשנהו. + אפשרות %1$d + נא לבחור נתיב קובץ מסוים ממערכת הקבצים המקומית. + ניתן להשתמש ביישומים חיצוניים כמו Dropbox,‏ Google Drive או מנהל הקבצים המועדף עליך כדי לפתוח קובץ OPML. + יישומים רבים כגון Google Mail,‏ Dropbox,‏ Google Drive ורוב מנהלי הקבצים יכולים לפתוח קובצי OPML עם אנטנה־פּוֹד. + התחלת ייבוא + ייבוא OPML שגיאה! - קורא קובץ OPML - בחר הכל - בטל בחירות + קריאת קובץ OPML + אירעה שגיאה בעת קריאת מסמך ה־OPML: + לא נבחר קובץ! + בחירת הכול + ביטול הבחירה + בחירה… ממערכת הקבצים המקומית - השתמש באפליקציה חיצונית - יצוא OPML - שגיאת יצוא - יצוא OPML הצליח. - קובץ OPML נכתב ל:\u0020 + שימוש ביישומון חיצוני + ייצוא OPML + ייצוא HTML + מתבצע ייצוא… + שגיאת ייצוא + הייצוא הצליח + הקובץ שייוצא נכתב אל:\n\n%1$s + נדרשת גישה לאחסון חיצוני כדי לקרוא את קובץ ה־OPML - קבע טיימר שינה - בטל טיימר שינה - קבע זמן - טיימר שינה - זמן נותר:\u0020 - קלט לא חוקי, זמן חייב להיות מספר שלם + הגדרת מתזמן שינה + השבתת מתזמן שינה + הגדרת שעה + מתזמן שינה + זמן שנותר:\u0020 + קלט שגוי, השעה חייב להיות מספר שלם וחיובי + כאשר ספירת המתזמן עומדת להסתיים: + לשקשק כדי לאפס את המתזמן + לרטוט + שניות + דקות + שעות + + שנייה אחת + %d שניות + %d שניות + %d שניות + + + דקה אחת + %d דקות + %d דקות + %d דקות + + + שעה + שעתיים + %d שעות + %d שעות + + הפעלה אוטומטית + מתזמן השינה פעיל + מתזמן השינה מושבת קטגוריות - פודקאסטים בכירים + פודקאסטים מובילים המלצות - חפש ב-gpodder.net - התחברות - ברוך הבא להתחברות ל-gpodder.net. ראשית, הקלד את פרטי הכניסה שלך: - התחברות - אם אין לך עדיין חשבון, תוכל לפתוח אחד דרך: \nhttps://gpodder.net/register/ - שם משתמש: - ססמה: + חיפוש ב־gpodder.net + כניסה + ברוך בואך לתהליך הכניסה ל־gpodder.net. ראשית, עליך להקליד את פרטי הכניסה שלך: + כניסה + אם עדיין אין לך חשבון, ניתן ליצור אחד כאן:‎\nhttps://gpodder.net/register/‎ + שם משתמש + ססמה בחירת מכשיר - צור מכשיר חדש לשימוש עבור חשבון gpodder.net או לבחר אחד קיים: + ניתן ליצור התקן חדש לשימוש עם החשבון שלך ב־gpodder.net או לבחור בהתקן חדש: מזהה מכשיר:\u0020 כותרת - צור מכשיר חדש - בחר מכשיר קיים: - מזהה המכשיר אינו יכול להיות ריק - מזהה המכשיר בשימוש - בחר - התחברות מוצלחת! - מזל טוב! חשבון gpodder.net שלך מקושר כעת עם המכשיר שלך. אנטנה-פוד מעתה יסנכרן באופן אוטומטי הרשמות במכשיר שלך עם חשבון gpodder.net שלך. - התחל סנכרון כעת - עבור למסך הראשי - שגיאת אימות של gpodder.net + יצירת מכשיר חדש + בחירת מכשיר קיים: + מזהה המכשיר לא יכול להישאר ריק + מזהה המכשיר כבר בשימוש + הכותרת לא יכולה להישאר ריקה + בחירה + נכנסת בהצלחה! + מזל טוב! חשבון ה־gpodder.net שלך מקושר כעת עם המכשיר שלך. מעתה כל המינויים שלך יסונכרנו אוטומטית על ידי אנטנה־פּוֹד מהמכשיר שלך לחשבון ה־gpodder.net שלך. + התחלת סנכרון כעת + מעבר למסך הראשי + שגיאת אימות מול gpodder.net שם משתמש או ססמה שגויים - שגיאת סנכרון של gpodder.net - שגיאה במהל סינכרון:\u0020 + שגיאת סנכרון מול gpodder.net + שגיאה במהלך סינכרון:\u0020 + מוצלח + נכשל - תיקיה נבחרת: - צור תיקיה + תיקייה נבחרת: + יצירת תיקייה בחר תיקיית מידע - צור תיקיה חדשה בשם \"%1$s\"? - תיקיה חדשה נוצרה - לא ניתן לכתוב לתיקה זו - תיקה כבר קיימת - לא ניתן ליצור תיקיה - התיקיה אינה ריקה - התיקייה שבחרת אינה ריקה. הורדות מדיה וקבצים אחרים יהיו ממוקמות ישירות בתיקייה זו. להמשיך בכל זאת? - בחר תיקיית ברירת מחדל - השהה ניגון במקום החלשת עוצמת שמע כשאפליקציה אחרת מנגנת - השהה בזמן הפרעה + נא לבחור את בסיס תיקיית הנתונים שלך. תת־התיקיות תיווצרנה על ידי אנטנה־פּוֹד בהתאם. + נדרשת גישה לאחסון חיצוני כדי לשנות את תיקיית הנתונים + ליצור תיקייה חדשה בשם „%1$s”? + נוצרה תיקייה חדשה + לא ניתן לכתוב לתיקייה זו + התיקייה כבר קיימת + לא ניתן ליצור תיקייה + „%1$s” לא קיים + „%1$s” אינו קריא + „%1$s” חסום לכתיבה + התיקייה אינה ריקה + התיקייה שבחרת אינה ריקה. הורדות מדיה וקבצים אחרים ימוקמו ישירות בתיקייה זו. להמשיך בכל זאת? + נא לבחור תיקיית בררת מחדל + השהיית הניגון במקום הנמכת עצמת השמע כאשר יישומון אחר מעוניין לנגן צלילים + להשהות במהלך הפרעות + להמשיך בנגינה לאחר השלמת שיחת הטלפון + להמשיך לאחר שיחה + יש להפעיל את אנטנה־פּוֹד מחדש כדי שהשינויים ייכנסו לתוקף. - הרשם - נרשם + הרשמה + נרשמת + מתבצעת הורדה… - דלג לאחור - הרץ קדימה + חזרה לאחור + הרצה קדימה שמע וידאו - נווט למעלה + ניווט כלפי מעלה הפרק יורד הפרק בתור גרור לשינוי מיקום פריט זה - טען את הדף הבא + טעינת הדף הבא אימות - שנה את שם המשתמש והסיסמה שלך לפודקאסט ופרקים שלו. + שינוי שם המשתמש והססמה שלך לפודקאסט הזה ולפרקים שלו. + הגדרות הורדה אוטומטית + מסנן פרקים + רשימת המונחים בהם יעשה שימוש כדי להחליט אם להכליל או להחריג פרק כלשהו במהלך הורדה אוטומטית + להכליל + להחריג + מילים בודדות \n\"אוסף מילים\" + לשמור על עדכניות + מסד הנתונים משתדרג - מייבא רישום מאפליקציות יעודיות... - חפש בiTunes + מתבצע ייבוא מינויים מיישומונים ממוקדי מטרה… + חיפוש ב־iTunes + מסנן + בחיפוש ב־fyyd + הכול + בחירת כל הפרקים + ללא + אף פרק לא נבחר + נוגנו + בחירת פרקים שנוגנו + לא נוגנו + בחירת פרקים שלא נוגנו + הורדו + בחירת פרקים שהורדו + לא הורדו + בחירת פרקים שלא הורדו + בתור + בחירת פרקים בתור + לא בתור + בחירת פרטים שאינם בתור + יש מדיה + בחירת פרקים עם מדיה + כותרת (א \u2192 ת) + כותרת (ת \u2192 א) + תאריך (חדש \u2192 ישן) + תאריך (ישן \u2192 חדש) + משך (קצר \u2192 ארוך) + משך (קצר \u2192 ארוך) - אוהבים את האפליקציה? + היישומון אנטנה־פּוֹד נושא חן בעיניך? + מאוד נשמח לקבל דירוג על אנטנה־פּוֹד אם יש לך זמן לכך. לא תודה פעם אחרת - בטח! + בטח, נלך על זה! + פקדי שמע + מהירות נגינה + עצמת שמע + L + R + אפקטים של שמע + איחוד: סטריאו למונו + Sonic בלבד + סוג + מארח + פתחה + (רשות) + בדיקה + מתבצעת בדיקה… + הבדיקה לא הצליחה + הבדיקה נכשלה + המארח לא יכול להישאר ריק + כתובת המארח אינה כתובת IP או שם מתחם תקניים + הפתחה אינה תקנית + ייבוא/ייצוא מסד נתונים + תכונה ניסיונית זו יכולה לשמש לטובת העברת המינויים והפרקים שניגנת להתקן אחר.\n\nניתן לייבא מסדי נתונים שיוצאו רק לאותה הגרסה של אנטנה־פּוֹד. אחרת, תכונה זו עשויה לגרור התנהגות בלתי צפויה.\n\nלאחר הייבוא, יתכן שחלק מהפרקים יופיעו כאילו כבר הורדת אותם למרות שבפועל לא עשית זאת. עליך פשוט ללחוץ על כפתור הנגינה של הפרקים כדי שאנטנה־פּוֹד יוכל לזהות זאת. + ייבוא + ייצוא + בחירת קובץ לייבוא + הייצוא הצליח. + הייבוא הצליח.\n\nנא ללחוץ על אישור כדי להפעיל את אנטנה־פּוֹד מחדש + ניגון דרך… + ניתוק השידור + המדיה הנבחרת אינה תואמת להתקן שידור + התחלת נגינת המדיה נכשלה + עצירת נגינת המדיה נכשלה + השהיית נגינת המדיה נכשלה + הגדרת עצמת השמע נכשלה + אין חיבור להתקן שידור + החיבור להתקן שידור אבד. היישומון מנסה להתחבר שוב, אם ניתן. נא להמתין מספר שניות ואז לנסות שוב. + ביצוע הפעולה נכשל + הסנכרון עם התקן השידור נכשל + ההקפצה למיקום נגינה אחר בהתקן השידור נכשלה + הנגן המקבל נתקל בשגיאה חמורה + שגיאה בנגינת המדיה. מתבצע דילוג… diff --git a/core/src/main/res/values-ja/strings.xml b/core/src/main/res/values-ja/strings.xml index c5ea6357f..123beb079 100644 --- a/core/src/main/res/values-ja/strings.xml +++ b/core/src/main/res/values-ja/strings.xml @@ -167,6 +167,8 @@ 失敗 ダウンロードは保留中 ダウンロード実行中 + 詳細 + %1$s \n\nファイル URL:\n%2$s ストレージ デバイスが見つかりません スペースが不足しています ファイルエラー @@ -449,8 +451,8 @@ HTML エクスポート エクスポート中… エクスポートエラー - OPMLをエクスポートしました。 - .opml ファイルを書き込みました:\u0020 + エクスポートしました + エクスポートしたファイルを書き込みました:\n\n%1$s OPML ファイルを読み込むために、外部ストレージへのアクセスが必要です スリープタイマーをセット @@ -620,7 +622,7 @@ インポート エクスポート インポートするファイルを選択してください - エクスポートが成功しました。データベースはSDカードに書き込まれました。 + エクスポートしました。 インポートが成功しました。\n\nOKを押してAntennaPodを再起動してください。 …で再生 diff --git a/core/src/main/res/values-ko/strings.xml b/core/src/main/res/values-ko/strings.xml index a3ec4de96..078c43fbb 100644 --- a/core/src/main/res/values-ko/strings.xml +++ b/core/src/main/res/values-ko/strings.xml @@ -167,6 +167,8 @@ 실패 다운로드 지연 중 다운로드 실행 중 + 자세히 + %1$s \n\n파일 URL:\n%2$s 저장 장치가 없습니다 저장 공간이 부족합니다 파일 오류 @@ -449,8 +451,8 @@ HTML 내보내기 내보내는 중… 내보내기 오류 - OPML 내보내기가 성공했습니다. - OPML 파일을 다음에 저장했습니다:\u0020 + 내보내기 성공 + 내보낸 파일을 다음에 저장했습니다:\n\n%1$s OPML 파일을 읽으려면 외부 저장소 접근이 필요합니다 취침 타이머 설정 @@ -615,6 +617,13 @@ 호스트가 올바른 IP 주소 또는 도메인이 아닙니다 포트가 올바르지 않습니다 + 데이터베이스 가져오기/내보내기 + 실험적인 기능으로 구독 정보와 재생한 에피소드 정보를 다른 장치로 옮기는데 사용합니다.\n\n내보낸 데이터베이스는 같은 버전의 안테나팟을 사용할 경우에만 가져올 수 있습니다. 같은 버전이 아니면 예상치 못하게 동작할 수 있습니다.\n\n가져온 후에 다운로드하지 않은 에피소드가 다운로드한 것으로 표시될 수 있습니다. 그 경우 해당 에피소드의 재생 버튼을 누르면 안테나팟에서 다운로드 여부를 확인해 줍니다. + 가져오기 + 내보내기 + 가져올 파일을 선택하십시오 + 내보내기 성공 + 내보내기 성공.\n\n안테나팟을 다시 시작하려면 확인을 누르십시오 다른 장치에서 재생... 캐스트 세션 연결 끊기 diff --git a/core/src/main/res/values-nl/strings.xml b/core/src/main/res/values-nl/strings.xml index 2756adc53..ae9f8ade9 100644 --- a/core/src/main/res/values-nl/strings.xml +++ b/core/src/main/res/values-nl/strings.xml @@ -168,6 +168,8 @@ mislukt Download in afwachting Aan het downloaden + Details + %1$s \n\nURL bestand:\n%2$s Opslagmedium niet gevonden Onvoldoende ruimte Bestandsfout @@ -451,8 +453,8 @@ HTML export Exporteren… Export fout - OPML bestand succesvol geëxporteerd. - Het OPML-bestand is in \u0020 geplaatst + Export succesvol + Het geëxporteerde bestand is hier opgeslagen:\n\n%1$s Toegang tot externe locaties is nodig om het OPML-bestand te kunnen lezen Slaap timer instellen @@ -625,7 +627,7 @@ Importeren Exporteren Selecteer bestand om te importeren - Succesvol geëxporteerd. De database is naar de SD-kaart geschreven. + Export succesvol. Succesvol geïmporteerd\n\nDruk op OK om AntennaPod te herstarten. Afspelen op… diff --git a/core/src/main/res/values-pl-rPL/strings.xml b/core/src/main/res/values-pl-rPL/strings.xml index 4839ef60c..abbcfe763 100644 --- a/core/src/main/res/values-pl-rPL/strings.xml +++ b/core/src/main/res/values-pl-rPL/strings.xml @@ -116,6 +116,7 @@ Usuń podcast Udostępnij... Udostępnij stronę + Udostępnij plik Udostępnij link z aktualną pozycją Udostępnij adres kanału Udostępnij plik URL odcinka @@ -144,6 +145,7 @@ Strumień Usuń Usuń + Nie można usunąć pliku. Restart urządzenia może w tym pomóc. Usuń odcinek Zaznaczono jako wyświetlone Oznacz jako odtworzone @@ -168,6 +170,9 @@ Operacja nie powiodła się Pobieranie w toku Pobieram + Szczegóły + %1$s \n\nAdres pliku:\n%2$s + Nie znaleziono urządzenia docelowego Niewystarczająca ilość pamięci Błąd pliku @@ -301,6 +306,8 @@ Inteligentnie oznacz jako odtworzone Zachowuje pominięte odcinki w kolejce Zachowaj pominięte odcinki + Zachowaj odcinki gdy są oznaczone jako Ulubione + Zachowaj Ulubione Odcinki Odtwarzanie Sieć Częstotliwość aktualizacji lub Czas dnia @@ -344,6 +351,8 @@ Skonfiguruj automatyczne pobieranie odcinków. Włącz filtr Wi-Fi Zezwól na automatyczne pobieranie tylko dla określonych sieci Wi-Fi. + Pobierz przy użyciu komórkowego transferu danych + Zezwól na automatyczne pobieranie przy użyciu komórkowego transferu danych Pobieraj, gdy nie ładuje Zezwól na automatyczne pobieranie, gdy bateria nie jest ładowana. Liczba równoległych pobierań @@ -411,6 +420,7 @@ Obsługa Chromecast Uruchom obsługę dla zdalnego odtwarzania mediów na innych urządzeniach (takich jak Chromecast, Audio Speakers albo Android TV) Chromecast wymagadodatkowych bibliotek, które są zablokowane w tej wersji AntennaPod + Rzeczy z kolejki pobrane Dodaj pobrane odcinki do kolejki Włącz automatyczne wspieranie na flattr. @@ -448,8 +458,8 @@ Eksport HTML Eksportowanie... Błąd eksportu - Eksport OPML udany. - Plik .opml został zapisany do:\u0020 + Export zakończony powodzeniem + Wyeksportowany plik został zapisany w:\n\n %1$s Dostęp do zewnętrznej pamięci jest potrzebny do odczytywania plików OPML Ustaw czas do wyłączenia @@ -624,6 +634,13 @@ https://gpodder.net/register/ Host nie jest prawidłowym adresem IP albo domeną Błędny port + Import/Export bazy danych + Ta eksperymentalna funkcja może zostać użyta do przeniesienia Twoich subskrypcji i już obejrzanych odcinków na inne urządzenie.\n\n Wyeksportowana baza może zostać zaimportowana jedynie taką samą wersją programu AntennaPod. W innym przypadku może to spowodować nieprzewidziane zachowanie programu.\n\n Po zaimportowaniu, odcinki mogą być pokazane jako pobrane pomimo tego iż nie zostały pobrane. Wystarczy kliknąć odtwórz odcinek aby AntennaPod wykrył poprawny stan pliku. + Import + Export + Wybierz plik do Importowania + Export zakończony powodzeniem + Import zakończony powodzeniem.\n\nNaciśnij OK aby zrestartować AntennaPod Odtwarzaj na... Rozłącz sesję diff --git a/core/src/main/res/values-pt/strings.xml b/core/src/main/res/values-pt/strings.xml index 8be0b8443..1eb03a194 100644 --- a/core/src/main/res/values-pt/strings.xml +++ b/core/src/main/res/values-pt/strings.xml @@ -168,6 +168,8 @@ falha Descarga pendente Descarga atual + Detalhes + %1$s \n\Ficheiro URL:\n%2$s Cartão SD não encontrado Espaço insuficiente Erro no ficheiro @@ -451,8 +453,8 @@ Exportação HTML A exportar... Erro de exportação - Exportação efetuada - O ficheiro .opml foi guardado em:\u0020 + Exportação com sucesso + O ficheiro exportado foi guardado em:\n\n%1$s Requer acesso ao armazenamento externo para ler o ficheiro OPML Definir temporizador @@ -619,6 +621,14 @@ Servidor não pode estar vazio O servidor não tem um endereço ou domínio válido Porta inválido + + Importação/exportação da base de dados + Esta função experimental pode ser usada para transferir as suas subscrições e episódios para outros dispositivos.\n\nAs bases de dados exportadas apenas podem ser importadas se usar a mesma versão do AntennaPod. Caso contrário, esta função poderá produzir efeitos inesperados.\n\nDepois da importação, os episódios poderão ser apresentados como tendo sido descarregados mesmo que não seja verdade. Prima o botão de reprodução dos episódios para que o AntennaPod detete a situação. + Importar + Exportar + Selecione o ficheiro a importar + Exportação com sucesso. + Importação bem sucedida.\n\nPor favor prima OK para reiniciar o AntennaPod Reproduzir em... Desligar da última sessão diff --git a/core/src/main/res/values-ro-rRO/strings.xml b/core/src/main/res/values-ro-rRO/strings.xml index d39e48bbc..3616d5644 100644 --- a/core/src/main/res/values-ro-rRO/strings.xml +++ b/core/src/main/res/values-ro-rRO/strings.xml @@ -2,25 +2,38 @@ Feeduri + Statistici + Adaugă podcast + Episoade + Toate + Favorite Nou Setări Descărcări + Active + Complete + Jurnal Anulează descărcare Istorie ascultare gpodder.net autentificare gpodder.net + Deschide meniul + Închide meniul Deschide în browser Copiază URL Împarte URL URL copiat în clipboard + Mergi la poziția Golește istoric Confirmă Anulează + Da + Nu Autor Limbă Setări @@ -29,6 +42,7 @@ Reîncarcă Nu exista stocare externă. Asigurați-vă că stocarea externă este conectată pentru ca aplicația să funcționeze corespunzător. Capitole + Durata: %1$s Notițe Descriere Cel mai recent episod:\u0020 @@ -39,6 +53,13 @@ Salvează numele de utilizator și parola închide Reîncearcă + Șterge epidosul automat + Întotdeauna + Niciodată + Trimite... + Niciodată + Când nu e în coadă + După terminare Adresă feed @@ -174,7 +195,6 @@ Deselectează toate Exportă OPML Eroare exportare - Fișierul .opml a fost scris în:\u0020 Setează cronometru somn Oprește cronometru somn diff --git a/core/src/main/res/values-ru/strings.xml b/core/src/main/res/values-ru/strings.xml index 5e7f8dd73..afe25cdf3 100644 --- a/core/src/main/res/values-ru/strings.xml +++ b/core/src/main/res/values-ru/strings.xml @@ -170,6 +170,11 @@ не удалось Загрузка в ожидании Загрузка в процессе + Подробнее + %1$s + +URL файла: +%2$s Устройство хранения не найдено Недостаточно места Ошибка файла @@ -455,8 +460,10 @@ Экспорт в HTML Экспортируется... Ошибка экспорта - OPML успешно экспортирован. - Файл OPML был записан в:\u0020 + Экспорт завершён успешно + Экспорт осуществлён в файл: + +%1$s Для чтения файла OPML необходим доступ к внешнему хранилищу Установить таймер сна @@ -635,7 +642,7 @@ Импорт Экспорт Выберите импортируемый файл - Успешно экспортировано. База данных была записана на карту памяти. + Успешно экспортировано. Успешно импортировано.\n\nПожалуйста, нажмите OK, чтобы перезапустить AntennaPod Воспроизвести на… diff --git a/core/src/main/res/values-sv-rSE/strings.xml b/core/src/main/res/values-sv-rSE/strings.xml index cb7474ed4..f2dc3c6f1 100644 --- a/core/src/main/res/values-sv-rSE/strings.xml +++ b/core/src/main/res/values-sv-rSE/strings.xml @@ -168,6 +168,8 @@ misslyckades Avvaktar nedladdning Nedladdning pågår + Detaljer + %1$s \n\nFil-URL:\n%2$s Hittade ingen lagringsenhet Otillräckligt Utrymme Filfel @@ -451,8 +453,8 @@ HTML export Exporterar… Exporteringsfel - OPML Exportering lyckades. - .opml filen skrevs till:\u0020 + Exporten lyckades + Den exporterade filen skrevs till:\n\n%1$s Tillgång till extern lagring krävs för att läsa OPML-filen Ställ in sömntimer @@ -619,6 +621,14 @@ Värd måste fyllas i Värd är inte en giltig IP adress eller domän Porten är inte giltig + + Databas-Import/Export + Denna experimentella funktion kan användas för att föra över dina prenumerationer och spelade episoder till en annan enhet.\n\nExporterade databaser kan bara importeras med samma version av AntennaPod. Annars kommer en import att leda till oförutsägbara konsekvenser.\n\nEfter en import kan episoder visas som nedladdade även om de inte är det. Tryck bara på uppspelningsknappen på episoden för att AntennaPod ska kolla det igen. + Import + Export + Välj fil att importera + Exporten lyckades. + Importen lyckades.\n\nTryck OK för att starta om AntennaPod Spela på... Koppla loss castningen diff --git a/core/src/main/res/values-te/strings.xml b/core/src/main/res/values-te/strings.xml index 93db7b76f..07091c14d 100644 --- a/core/src/main/res/values-te/strings.xml +++ b/core/src/main/res/values-te/strings.xml @@ -3,6 +3,7 @@ ఫీడులు గణాంకాలు + ఎపిసోడులు అన్నీ ఇష్టాలు కొత్తది @@ -13,33 +14,63 @@ చిట్టా చందాలు చందాల జాబితా + దింపుకోలును\nరద్దుచేయి + ఆడింపు చరిత్ర + gpodder.net + gpodder.net ప్రవేశం %1$s ఖాళీ + గణాంకాల రీతి + మెనూని తెరువు + మెనూని మూసివేయి ఏమీలేవు + చరిత్రను తుడిచివేయి + నిర్ధారించు రద్దుచేయి అవును కాదు భాష అమరికలు + బొమ్మ + పొరపాటు + పొరపాటు జరిగింది: + చాప్టర్లు + నిడివి: %1$s వివరణ + అత్యంత ఇటీవలి ఎపిసోడు:\u0020 + \u0020ఎపిసోడులు నిడివి:\u0020 + పరిమాణం:\u0020 వస్తోంది… + వాడుకరి పేరునీ సంకేతపదాన్నీ భద్రపరచు మూసివేయి + మళ్ళీ ప్రయత్నించు ఎల్లప్పుడూ పంపించు… + + ముగించిన 1 రోజు తర్వాత + ముగించిన %d రోజుల తర్వాత + + ఫీడు చిరునామా + www.example.com/feed + సమాచారం చూపించు పంచుకోండి… + దింపుకో ఆడించు నిలుపు ఆపివేయి + తొలగించు తొలగించు + వివరాలు + ఫీడు తేదీ @@ -51,15 +82,23 @@ + ఇతర గురించి సేవలు నెట్‌వర్క్ + అచేతనించు + ప్రతీ %1$s + లేత + నల్లని + అపరిమితం గంటలు గంట ప్రయోగాత్మకం ప్రాక్సీ + తెలిసిన సమస్యలు + వెతుకు అన్నీ ఎంచుకోండి @@ -80,9 +119,14 @@ వర్గాలు + మేటి పాడ్‌కాస్టులు + సలహాలు వాడుకరి పేరు సంకేతపదం + విజయవంతం + విఫలమైంది + సంచయం ఖాళీగా లేదు @@ -99,6 +143,9 @@ రకం (ఐచ్చికం) + దిగుమతి + దిగుమతి + ఎగుమతి విజయవంతం. diff --git a/core/src/main/res/values-uk-rUA/strings.xml b/core/src/main/res/values-uk-rUA/strings.xml index 18ca0713b..03cbe20d8 100644 --- a/core/src/main/res/values-uk-rUA/strings.xml +++ b/core/src/main/res/values-uk-rUA/strings.xml @@ -93,6 +93,7 @@ 1 день після закінчення %d дні після закінчення + %d днів після закінчення %d днів після закінчення @@ -169,6 +170,8 @@ з помилками Потрібно завантажити Завантаження + Докладно + %1$s \n\nПосилання на файл:\n%2$s Немає куди зберігати Мало місця Помилка файлу @@ -193,6 +196,7 @@ %d завантаження залишилось %d завантаження залишилось + %d завантажень залишилось %d завантажень залишилось Обробка завантаженого @@ -453,8 +457,8 @@ Експорт до HTML Експортується… Помилка експорту - OPML експорт успішний - OPML файл записаний в:\u0020 + Успішний експорт + Файл було записано в:\n\n%1$s Щоб прочитати файл OPML потрібен доступ до зовнішньої пам’яти Таймер сну @@ -472,16 +476,19 @@ 1 секунда %d секунди + %d секунд %d секунд 1 хвилина %d хвилини + %d хвилин %d хвилин 1 година %d години + %d годин %d годин Увімкнути автоматично @@ -624,6 +631,14 @@ Хост не може бути пустим Хост не є правильною IP-адресою або доменним ім’ям Неправильний порт + + Імпортувати/Експортувати базу данних + Ця експериментальна функція може бути використана щоб перенести ваші підпискаи то вже прослухані епізоди до іншого пристрою.\n\nЕкспортована база данних може тільки бути імпортована використоваючи ту саму версію AntennaPod. В противному випадку результат може бути непердбаченним.\n\nПисля импортування, епізоди можут бути відображенним як завантажені, коли на справді воне такими не є. Просто натисніть кнопку грати на цих епізодах щоб видалати іх. + Імпортувати + Експортувати + Обрати файл для імпорту + Успішний експорт + Імпорт пройшов успішно.\n\nБудь ласка натисніть ОК щоб перезапустити AntennaPod Грати на… Від’єднатись від пристроя програвання -- cgit v1.2.3 From a691ab2614edd5ddd9215a2abd24a73faa8e1e47 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 25 Jul 2018 23:14:41 +0200 Subject: Prevent NPE --- .../de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java index 3df017e58..cc9d2ce2d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/ExoPlayerWrapper.java @@ -78,7 +78,9 @@ public class ExoPlayerWrapper implements IPlayer { @Override public void onPlayerError(ExoPlaybackException error) { - audioErrorListener.onError(null, 0, 0); + if (audioErrorListener != null) { + audioErrorListener.onError(null, 0, 0); + } } @Override -- cgit v1.2.3 From c7d876c8ae41867263b2d83c10d6866b19a7e110 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 25 Jul 2018 23:56:35 +0200 Subject: Requesting audio focus on Android O --- .../core/service/playback/LocalPSMP.java | 43 +++++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'core/src/main') diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index 91c4a0fd7..c7948b157 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -1,7 +1,10 @@ package de.danoeh.antennapod.core.service.playback; import android.content.Context; +import android.media.AudioAttributes; +import android.media.AudioFocusRequest; import android.media.AudioManager; +import android.os.Build; import android.os.PowerManager; import android.support.annotation.NonNull; import android.telephony.TelephonyManager; @@ -202,9 +205,26 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { private void resumeSync() { if (playerStatus == PlayerStatus.PAUSED || playerStatus == PlayerStatus.PREPARED) { - int focusGained = audioManager.requestAudioFocus( - audioFocusChangeListener, AudioManager.STREAM_MUSIC, - AudioManager.AUDIOFOCUS_GAIN); + int focusGained; + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + AudioAttributes audioAttributes = new AudioAttributes.Builder() + .setUsage(AudioAttributes.USAGE_MEDIA) + .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH) + .build(); + AudioFocusRequest audioFocusRequest = new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN) + .setAudioAttributes(audioAttributes) + .setOnAudioFocusChangeListener(audioFocusChangeListener) + .setAcceptsDelayedFocusGain(true) + .setWillPauseWhenDucked(true) + .build(); + focusGained = audioManager.requestAudioFocus(audioFocusRequest); + } else { + focusGained = audioManager.requestAudioFocus( + audioFocusChangeListener, AudioManager.STREAM_MUSIC, + AudioManager.AUDIOFOCUS_GAIN); + } + if (focusGained == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) { Log.d(TAG, "Audiofocus successfully requested"); Log.d(TAG, "Resuming/Starting playback"); @@ -259,7 +279,13 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { setPlayerStatus(PlayerStatus.PAUSED, media, getPosition()); if (abandonFocus) { - audioManager.abandonAudioFocus(audioFocusChangeListener); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + AudioFocusRequest.Builder builder = new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN) + .setOnAudioFocusChangeListener(audioFocusChangeListener); + audioManager.abandonAudioFocusRequest(builder.build()); + } else { + audioManager.abandonAudioFocus(audioFocusChangeListener); + } pausedBecauseOfTransientAudiofocusLoss = false; } if (stream && reinit) { @@ -815,7 +841,14 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { if (mediaPlayer != null) { mediaPlayer.reset(); } - audioManager.abandonAudioFocus(audioFocusChangeListener); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + AudioFocusRequest.Builder builder = new AudioFocusRequest.Builder(AudioManager.AUDIOFOCUS_GAIN) + .setOnAudioFocusChangeListener(audioFocusChangeListener); + audioManager.abandonAudioFocusRequest(builder.build()); + } else { + audioManager.abandonAudioFocus(audioFocusChangeListener); + } final Playable currentMedia = media; Playable nextMedia = null; -- cgit v1.2.3 From 7e05ff2a4eaf82e20e58575610da63502250f8d5 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Thu, 26 Jul 2018 10:26:00 +0200 Subject: Theming support for about screen --- core/src/main/res/values/attrs.xml | 5 +++++ core/src/main/res/values/styles.xml | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'core/src/main') diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index f3c2b9b7e..9d168a1b9 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -63,4 +63,9 @@ + + + + + diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 0314ca431..cbd1dc88e 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -69,6 +69,11 @@ @color/master_switch_background_light @color/highlight_light @style/PreferenceThemeOverlay.v14.Material + + #e5e5e5 + #ffffff + #d2d2d2 + #000000 + + + diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index f172b0f6d..eec4f76ce 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -28,6 +28,7 @@ #FFFFFF + #212121 #DDDDDD #414141 diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 60296c64f..8a2d318f0 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -88,6 +88,8 @@