Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Merge from upstream + expose more functions + build files refactoration #9

Merged
merged 30 commits into from
Dec 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
762e3a1
Add Preference#setVisible stub
arkon Jul 10, 2023
76351ec
Increase compile/target SDK
arkon Aug 26, 2023
ad582d4
chore: Suppress unused warnings
Claudemirovsky Nov 27, 2023
6f4e156
feat: Add replacement suspend functions in AnimeSource interface
arkon Sep 3, 2023
e1d4fbd
Add support to kotlin.time APIs in the rate limit interceptor (#10)
alessandrojean Aug 4, 2023
bb6443d
feat: Expose more suspend functions
Claudemirovsky Nov 28, 2023
858521d
chore: Rename UpdateStrategy to AnimeUpdateStrategy
Claudemirovsky Nov 28, 2023
353bdf8
Make source ID generation function reusable to extensions (#11)
alessandrojean Aug 12, 2023
bad6dcf
Share HttpException from the app with the extensions-lib. (#12)
alessandrojean Aug 19, 2023
1587f70
chore: Bump Jsoup version
Claudemirovsky Nov 28, 2023
2eea64e
chore!: Update gradle wrapper
Claudemirovsky Dec 16, 2023
8d772d6
refactor: Convert groovy files to kotlin
Claudemirovsky Dec 16, 2023
37403e9
chore: Bump AGP
Claudemirovsky Dec 16, 2023
1e4b18d
refactor: Use version catalog
Claudemirovsky Dec 16, 2023
338d092
chore: Bump kotlin version
Claudemirovsky Dec 16, 2023
17db557
fix: Fix jvmTarget incompatibility
Claudemirovsky Dec 16, 2023
bbc5868
chore: Bump Dokka
Claudemirovsky Dec 16, 2023
73e86ae
feat: Add ResolvableAnimeSource interface
Claudemirovsky Dec 16, 2023
8642b9c
chore: Add deprecated annotation to NetworkHelper.cloudflareClient val
Claudemirovsky Dec 16, 2023
30df299
feat: Expose NetworkHelper.defaultUserAgentProvider function
Claudemirovsky Dec 16, 2023
52c58be
feat: Add parallelCatchingFlatMap util & remove rarely-used coroutine…
Claudemirovsky Dec 16, 2023
74b5921
docs: Document utility methods
Claudemirovsky Dec 16, 2023
ba3f637
feat: Make coroutine extensions non-blocking
Claudemirovsky Dec 16, 2023
ebfa4e8
feat: Expose Call.awaitSuccess extension function
Claudemirovsky Dec 16, 2023
8a18b32
chore(CI): Bump actions versions
Claudemirovsky Dec 16, 2023
0bd994b
refactor: Reorder function modifiers in CoroutinesExtensions
Claudemirovsky Dec 16, 2023
b8ef44f
fix: Fix maven publishing
Claudemirovsky Dec 16, 2023
828f03b
feat(coroutines): Add thread-blocking counterparts to parallel functions
Claudemirovsky Dec 17, 2023
8ca37c5
feat: Expose ConfigurableAnimeSource.getSourcePreferences
Claudemirovsky Dec 17, 2023
2a0cef3
docs: Minor fixes
Claudemirovsky Dec 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Expose more suspend functions
Claudemirovsky committed Dec 16, 2023
commit bb6443d81fb6a358fc0f15ae48e5bd5e58dd7ba2
Original file line number Diff line number Diff line change
@@ -17,30 +17,57 @@ interface AnimeCatalogueSource : AnimeSource {
val supportsLatest: Boolean

/**
* Returns an observable containing a page with a list of anime.
* Get a page with a list of anime.
*
* @since extensions-lib 14
* @param page the page number to retrieve.
*/
fun fetchPopularAnime(page: Int): Observable<AnimesPage>
suspend fun getPopularAnime(page: Int): AnimesPage {
throw Exception("Stub!")
}

/**
* Returns an observable containing a page with a list of anime.
* Get a page with a list of anime.
*
* @since extensions-lib 14
* @param page the page number to retrieve.
* @param query the search query.
* @param filters the list of filters to apply.
*/
fun fetchSearchAnime(page: Int, query: String, filters: AnimeFilterList): Observable<AnimesPage>
suspend fun getSearchAnime(page: Int, query: String, filters: AnimeFilterList): AnimesPage {
throw Exception("Stub!")
}

/**
* Returns an observable containing a page with a list of latest anime updates.
* Get a page with a list of latest anime updates.
*
* @since extensions-lib 14
* @param page the page number to retrieve.
*/
fun fetchLatestUpdates(page: Int): Observable<AnimesPage>
suspend fun getLatestUpdates(page: Int): AnimesPage {
throw Exception("Stub!")
}

/**
* Returns the list of filters for the source.
*/
fun getFilterList(): AnimeFilterList
}

@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getPopularAnime"),
)
fun fetchPopularAnime(page: Int): Observable<AnimesPage>

@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getSearchAnime"),
)
fun fetchSearchAnime(page: Int, query: String, filters: AnimeFilterList): Observable<AnimesPage>

@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getLatestUpdates"),
)
fun fetchLatestUpdates(page: Int): Observable<AnimesPage>
}
Original file line number Diff line number Diff line change
@@ -95,6 +95,10 @@ abstract class AnimeHttpSource : AnimeCatalogueSource {
*
* @param page the page number to retrieve.
*/
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getPopularAnime"),
)
override fun fetchPopularAnime(page: Int): Observable<AnimesPage> {
throw Exception("Stub!")
}
@@ -122,6 +126,10 @@ abstract class AnimeHttpSource : AnimeCatalogueSource {
* @param query the search query.
* @param filters the list of filters to apply.
*/
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getSearchAnime"),
)
override fun fetchSearchAnime(page: Int, query: String, filters: AnimeFilterList): Observable<AnimesPage> {
throw Exception("Stub!")
}
@@ -147,6 +155,10 @@ abstract class AnimeHttpSource : AnimeCatalogueSource {
*
* @param page the page number to retrieve.
*/
@Deprecated(
"Use the non-RxJava API instead",
ReplaceWith("getLatestUpdates"),
)
override fun fetchLatestUpdates(page: Int): Observable<AnimesPage> {
throw Exception("Stub!")
}
@@ -166,11 +178,17 @@ abstract class AnimeHttpSource : AnimeCatalogueSource {
protected abstract fun latestUpdatesParse(response: Response): AnimesPage

/**
* Returns an observable with the updated details for a anime. Normally it's not needed to
* override this method.
* Get the updated details for a anime.
* Normally it's not needed to override this method.
*
* @param anime the anime to be updated.
* @return the updated anime.
*/
override suspend fun getAnimeDetails(anime: SAnime): SAnime {
throw Exception("Stub!")
}

@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getAnimeDetails"))
override fun fetchAnimeDetails(anime: SAnime): Observable<SAnime> {
throw Exception("Stub!")
}
@@ -193,21 +211,34 @@ abstract class AnimeHttpSource : AnimeCatalogueSource {
protected abstract fun animeDetailsParse(response: Response): SAnime

/**
* Returns an observable with the updated episode list for a anime. Normally it's not needed to
* override this method.
* Get all the available episodes for an anime.
* Normally it's not needed to override this method.
*
* @param anime the anime to look for episodes.
* @param anime the anime to update.
* @return the chapters for the manga.
* @throws LicensedEntryItemsException if a anime is licensed and therefore no episodes are available.
*/
override suspend fun getEpisodeList(anime: SAnime): List<SEpisode> {
throw Exception("Stub!")
}

@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getEpisodeList"))
override fun fetchEpisodeList(anime: SAnime): Observable<List<SEpisode>> {
throw Exception("Stub!")
}

/**
* Returns an observable with the video list for an episode. Normally it's not needed to
* override this method.
* Get the list of videos a episode has. Videos should be returned
* in the expected order; the index is ignored.
*
* @param episode the episode to look for videos.
* @param episode the episode.
* @return the videos for the episode.
*/
override suspend fun getVideoList(episode: SEpisode): List<Video> {
throw Exception("Stub!")
}

@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getVideoList"))
override fun fetchVideoList(episode: SEpisode): Observable<List<Video>> {
throw Exception("Stub!")
}
@@ -330,7 +361,7 @@ abstract class AnimeHttpSource : AnimeCatalogueSource {

/**
* Returns the url of the provided anime. Useful to fix "open in webview"
* without overriding [fetchAnimeDetails].
* without overriding [getAnimeDetails].
*
* @since extensions-lib 14
* @param anime the anime
@@ -341,7 +372,7 @@ abstract class AnimeHttpSource : AnimeCatalogueSource {
}

/**
* Returns the url of the provided episode
* Returns the url of the provided episode.
*
* @since extensions-lib 14
* @param episode the episode