diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2022-04-26 19:21:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 19:21:30 +0200 |
commit | 7e9bf1c0a73a7bf61dffa083f777d460cea1bd2e (patch) | |
tree | 11bf844e04e5150a14b514b3b60bd3dfe679b536 | |
parent | ed5d9212ead125499f95bb175274e4451c029400 (diff) | |
parent | 30be4628ae1cd07fe9d9ed584eb865f874869085 (diff) | |
download | AntennaPod-7e9bf1c0a73a7bf61dffa083f777d460cea1bd2e.zip |
Merge pull request #5858 from ByteHamster/decouple-discovery
Move feed discovery backends to their own module
22 files changed, 71 insertions, 39 deletions
diff --git a/app/build.gradle b/app/build.gradle index 6a19bebb2..f740850b4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,14 +26,6 @@ android { } buildConfigField "String", "COMMIT_HASH", ('"' + (commit.isEmpty() ? "Unknown commit" : commit) + '"') - if (project.hasProperty("podcastindexApiKey")) { - buildConfigField "String", "PODCASTINDEX_API_KEY", '"' + podcastindexApiKey + '"' - buildConfigField "String", "PODCASTINDEX_API_SECRET", '"' + podcastindexApiSecret + '"' - } else { - buildConfigField "String", "PODCASTINDEX_API_KEY", '"XTMMQGA2YZ4WJUBYY4HK"' - buildConfigField "String", "PODCASTINDEX_API_SECRET", '"XAaAhk4^2YBsTE33vdbwbZNj82ZRLABDDqFdKe7x"' - } - javaCompileOptions { annotationProcessorOptions { arguments = [eventBusIndex: 'de.danoeh.antennapod.ApEventBusIndex'] @@ -113,6 +105,7 @@ dependencies { implementation project(":core") implementation project(":event") implementation project(':model') + implementation project(':net:discovery') implementation project(':net:sync:gpoddernet') implementation project(':net:sync:model') implementation project(':parser:feed') @@ -157,7 +150,6 @@ dependencies { implementation 'com.github.shts:TriangleLabelView:1.1.2' implementation 'com.leinardi.android:speed-dial:3.2.0' implementation "com.github.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion" - implementation 'com.github.mfietz:fyydlin:v0.5.0' implementation 'com.github.ByteHamster:SearchPreference:v2.0.0' implementation 'com.github.skydoves:balloon:1.4.0' implementation 'com.github.xabaras:RecyclerViewSwipeDecorator:1.3' diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index 7a26759cc..9e71ac1db 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -36,8 +36,6 @@ import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.core.service.download.DownloadRequestCreator; import de.danoeh.antennapod.core.feed.FeedUrlNotFoundException; import de.danoeh.antennapod.core.util.DownloadErrorLabel; -import de.danoeh.antennapod.discovery.CombinedSearcher; -import de.danoeh.antennapod.discovery.PodcastSearchResult; import de.danoeh.antennapod.event.FeedListUpdateEvent; import de.danoeh.antennapod.event.PlayerStatusEvent; import de.danoeh.antennapod.core.glide.ApGlideSettings; @@ -51,6 +49,9 @@ import de.danoeh.antennapod.core.service.download.HttpDownloader; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; +import de.danoeh.antennapod.net.discovery.CombinedSearcher; +import de.danoeh.antennapod.net.discovery.PodcastSearchResult; +import de.danoeh.antennapod.net.discovery.PodcastSearcherRegistry; import de.danoeh.antennapod.parser.feed.FeedHandler; import de.danoeh.antennapod.parser.feed.FeedHandlerResult; import de.danoeh.antennapod.model.download.DownloadError; @@ -61,7 +62,6 @@ import de.danoeh.antennapod.core.util.syndication.FeedDiscoverer; import de.danoeh.antennapod.core.util.syndication.HtmlToPlainText; import de.danoeh.antennapod.databinding.OnlinefeedviewActivityBinding; import de.danoeh.antennapod.dialog.AuthenticationDialog; -import de.danoeh.antennapod.discovery.PodcastSearcherRegistry; import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.model.feed.FeedPreferences; import de.danoeh.antennapod.model.playback.RemoteMedia; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java index 66fa79a4e..3628b4bee 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java @@ -8,7 +8,7 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.discovery.PodcastSearchResult; +import de.danoeh.antennapod.net.discovery.PodcastSearchResult; import java.lang.ref.WeakReference; import java.util.ArrayList; diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java index 1968c0b62..40c2029d6 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java @@ -1,10 +1,10 @@ package de.danoeh.antennapod.adapter.itunes; import android.content.Context; +import android.widget.ArrayAdapter; import androidx.annotation.NonNull; import android.view.View; import android.view.ViewGroup; -import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; @@ -14,12 +14,12 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.load.resource.bitmap.FitCenter; import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.request.RequestOptions; -import de.danoeh.antennapod.discovery.PodcastSearchResult; import java.util.List; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; +import de.danoeh.antennapod.net.discovery.PodcastSearchResult; public class ItunesAdapter extends ArrayAdapter<PodcastSearchResult> { /** diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java index ee56bb9f9..d2a2e6de8 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java @@ -35,11 +35,11 @@ import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.model.feed.SortOrder; import de.danoeh.antennapod.databinding.AddfeedBinding; import de.danoeh.antennapod.databinding.EditTextDialogBinding; -import de.danoeh.antennapod.discovery.CombinedSearcher; -import de.danoeh.antennapod.discovery.FyydPodcastSearcher; -import de.danoeh.antennapod.discovery.ItunesPodcastSearcher; -import de.danoeh.antennapod.discovery.PodcastIndexPodcastSearcher; import de.danoeh.antennapod.fragment.gpodnet.GpodnetMainFragment; +import de.danoeh.antennapod.net.discovery.CombinedSearcher; +import de.danoeh.antennapod.net.discovery.FyydPodcastSearcher; +import de.danoeh.antennapod.net.discovery.ItunesPodcastSearcher; +import de.danoeh.antennapod.net.discovery.PodcastIndexPodcastSearcher; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DiscoveryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DiscoveryFragment.java index 230a0ce0d..274fc5878 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/DiscoveryFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/DiscoveryFragment.java @@ -18,14 +18,14 @@ import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; +import de.danoeh.antennapod.net.discovery.ItunesTopListLoader; +import de.danoeh.antennapod.net.discovery.PodcastSearchResult; import org.greenrobot.eventbus.EventBus; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.OnlineFeedViewActivity; import de.danoeh.antennapod.adapter.itunes.ItunesAdapter; import de.danoeh.antennapod.event.DiscoveryDefaultUpdateEvent; -import de.danoeh.antennapod.discovery.ItunesTopListLoader; -import de.danoeh.antennapod.discovery.PodcastSearchResult; import io.reactivex.disposables.Disposable; import java.util.ArrayList; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/OnlineSearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/OnlineSearchFragment.java index f3080f655..2fda74296 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/OnlineSearchFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/OnlineSearchFragment.java @@ -23,9 +23,9 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.OnlineFeedViewActivity; import de.danoeh.antennapod.adapter.itunes.ItunesAdapter; -import de.danoeh.antennapod.discovery.PodcastSearchResult; -import de.danoeh.antennapod.discovery.PodcastSearcher; -import de.danoeh.antennapod.discovery.PodcastSearcherRegistry; +import de.danoeh.antennapod.net.discovery.PodcastSearchResult; +import de.danoeh.antennapod.net.discovery.PodcastSearcher; +import de.danoeh.antennapod.net.discovery.PodcastSearcherRegistry; import io.reactivex.disposables.Disposable; import java.util.ArrayList; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java index f76b902cd..439f8a2cc 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java @@ -17,6 +17,8 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; +import de.danoeh.antennapod.net.discovery.ItunesTopListLoader; +import de.danoeh.antennapod.net.discovery.PodcastSearchResult; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -26,8 +28,6 @@ import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.OnlineFeedViewActivity; import de.danoeh.antennapod.adapter.FeedDiscoverAdapter; import de.danoeh.antennapod.event.DiscoveryDefaultUpdateEvent; -import de.danoeh.antennapod.discovery.ItunesTopListLoader; -import de.danoeh.antennapod.discovery.PodcastSearchResult; import io.reactivex.disposables.Disposable; import java.util.ArrayList; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java index 2ec30b8c3..fc2f1fa47 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java @@ -19,8 +19,8 @@ import com.google.android.material.tabs.TabLayoutMediator; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.discovery.GpodnetPodcastSearcher; import de.danoeh.antennapod.fragment.OnlineSearchFragment; +import de.danoeh.antennapod.net.discovery.GpodnetPodcastSearcher; /** * Main navigation hub for gpodder.net podcast directory diff --git a/net/discovery/README.md b/net/discovery/README.md new file mode 100644 index 000000000..53bc7e87c --- /dev/null +++ b/net/discovery/README.md @@ -0,0 +1,3 @@ +# :net:discovery + +This module contains the podcast search/discovery APIs. diff --git a/net/discovery/build.gradle b/net/discovery/build.gradle new file mode 100644 index 000000000..4bebbd04d --- /dev/null +++ b/net/discovery/build.gradle @@ -0,0 +1,37 @@ +plugins { + id("com.android.library") +} +apply from: "../../common.gradle" +apply from: "../../playFlavor.gradle" + +android { + defaultConfig { + if (project.hasProperty("podcastindexApiKey")) { + buildConfigField "String", "PODCASTINDEX_API_KEY", '"' + podcastindexApiKey + '"' + buildConfigField "String", "PODCASTINDEX_API_SECRET", '"' + podcastindexApiSecret + '"' + } else { + buildConfigField "String", "PODCASTINDEX_API_KEY", '"XTMMQGA2YZ4WJUBYY4HK"' + buildConfigField "String", "PODCASTINDEX_API_SECRET", '"XAaAhk4^2YBsTE33vdbwbZNj82ZRLABDDqFdKe7x"' + } + } + + lintOptions { + disable 'InvalidPeriodicWorkRequestInterval', 'MissingPermission', + 'GradleCompatible', 'AppCompatResource', 'QueryPermissionsNeeded' + } +} + +dependencies { + implementation project(':core') + implementation project(':model') + implementation project(':net:sync:gpoddernet') + implementation project(':net:sync:model') + + annotationProcessor "androidx.annotation:annotation:$annotationVersion" + + implementation 'com.github.mfietz:fyydlin:v0.5.0' + + implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion" + implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion" + implementation "com.squareup.okhttp3:okhttp:$okhttpVersion" +} diff --git a/net/discovery/src/main/AndroidManifest.xml b/net/discovery/src/main/AndroidManifest.xml new file mode 100644 index 000000000..3e42a802a --- /dev/null +++ b/net/discovery/src/main/AndroidManifest.xml @@ -0,0 +1 @@ +<manifest package="de.danoeh.antennapod.net.discovery" /> diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/CombinedSearcher.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/CombinedSearcher.java index 6c2a87c12..6cbf8eb2e 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/CombinedSearcher.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/CombinedSearcher.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import android.text.TextUtils; import android.util.Log; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/FyydPodcastSearcher.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/FyydPodcastSearcher.java index 5a93e6530..d4674c79d 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/FyydPodcastSearcher.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/FyydPodcastSearcher.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; import de.mfietz.fyydlin.FyydClient; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/GpodnetPodcastSearcher.java index 340783208..222c415ab 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/GpodnetPodcastSearcher.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import de.danoeh.antennapod.core.sync.SynchronizationCredentials; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/ItunesPodcastSearcher.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/ItunesPodcastSearcher.java index 81ce77ef8..b2ac1766c 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/ItunesPodcastSearcher.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/ItunesPodcastSearcher.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import de.danoeh.antennapod.core.feed.FeedUrlNotFoundException; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/ItunesTopListLoader.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/ItunesTopListLoader.java index e4135fcaa..827a3202f 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/ItunesTopListLoader.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/ItunesTopListLoader.java @@ -1,9 +1,8 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import android.content.Context; import android.util.Log; -import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; import io.reactivex.Single; import io.reactivex.SingleOnSubscribe; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastIndexPodcastSearcher.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastIndexPodcastSearcher.java index c8e5dc4ef..4645aaf62 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastIndexPodcastSearcher.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastIndexPodcastSearcher.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import org.json.JSONArray; import org.json.JSONException; @@ -15,7 +15,7 @@ import java.util.List; import java.util.Locale; import java.util.TimeZone; -import de.danoeh.antennapod.BuildConfig; +import de.danoeh.antennapod.net.discovery.BuildConfig; import de.danoeh.antennapod.core.ClientConfig; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; import io.reactivex.Single; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearchResult.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearchResult.java index c8096e9c5..b3f352334 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearchResult.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearchResult.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import androidx.annotation.Nullable; import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetPodcast; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcher.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcher.java index 8fbc8c76b..76edbf843 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcher.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcher.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.discovery; +package de.danoeh.antennapod.net.discovery; import io.reactivex.Single; import java.util.List; diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcherRegistry.java b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcherRegistry.java index dfea627df..c7892bd09 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcherRegistry.java +++ b/net/discovery/src/main/java/de/danoeh/antennapod/net/discovery/PodcastSearcherRegistry.java @@ -1,5 +1,4 @@ -package de.danoeh.antennapod.discovery; - +package de.danoeh.antennapod.net.discovery; import io.reactivex.Single; diff --git a/settings.gradle b/settings.gradle index 5abffe27c..0cf0366fe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,6 +3,7 @@ include ':core' include ':event' include ':model' +include ':net:discovery' include ':net:ssl' include ':net:sync:gpoddernet' include ':net:sync:model' |