Skip to content

Commit

Permalink
fetchVideoList to getVideoList
Browse files Browse the repository at this point in the history
  • Loading branch information
Dark25 committed Mar 26, 2024
1 parent cc29263 commit 164e317
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
import rx.Observable
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy
Expand Down Expand Up @@ -254,9 +253,11 @@ class StreamingCommunity : ConfigurableAnimeSource, AnimeHttpSource() {

// ============================ Video Links =============================

interface VideoProvider {
fun getVideoList(): List<Video>
}

@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("fetchVideoList"))
override fun fetchVideoList(episode: SEpisode): Observable<List<Video>> {
override suspend fun getVideoList(episode: SEpisode): List<Video> {
val videoList = mutableListOf<Video>()
val doc =
client
Expand Down Expand Up @@ -304,7 +305,7 @@ class StreamingCommunity : ConfigurableAnimeSource, AnimeHttpSource() {
.map {
Track(it.groupValues[2], it.groupValues[1])
}.toList()
TOKEN_QUALITY_REGEX.findAll(script).forEach { match ->
TOKEN_QUALITY_REGEX.findAll(script).forEach { match ->
val quality = match.groupValues[1]

val videoUrl =
Expand All @@ -322,10 +323,9 @@ class StreamingCommunity : ConfigurableAnimeSource, AnimeHttpSource() {

require(videoList.isNotEmpty()) { "Failed to fetch videos" }

return Observable.just(videoList.sort())
return videoList
}


override fun videoListRequest(episode: SEpisode): Request = throw Exception("Not used")

override fun videoListParse(response: Response): List<Video> = throw Exception("Not used")
Expand Down

0 comments on commit 164e317

Please sign in to comment.