Skip to content

Commit

Permalink
v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rhenwinch committed Dec 10, 2023
1 parent 92bf832 commit a90215b
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 71 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
// Version
def versionMajor = 1
def versionMinor = 3
def versionPatch = 1
def versionPatch = 2
def versionBuild = 0
def applicationName = "Flixclusive"

Expand Down
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
-keep class com.flixclusive.providers.models.extractors.vidcloud.** { *; }
-keep class com.flixclusive.providers.models.providers.flixhq.** { *; }
-keep class com.flixclusive.providers.models.providers.superstream.** { *; }
-keep class com.flixclusive.providers.models.providers.lookmovie.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 13100,
"versionName": "1.3.1",
"versionCode": 13200,
"versionName": "1.3.2",
"outputFile": "app-release.apk"
}
],
Expand Down
9 changes: 5 additions & 4 deletions providers/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.flixclusive.providers.models.common.** { *; }
-keep class com.flixclusive.providers.models.extractors.vidcloud.** { *; }
-keep class com.flixclusive.providers.models.providers.flixhq.** { *; }
-keep class com.flixclusive.providers.models.providers.superstream.** { *; }
#-keep class com.flixclusive.providers.models.common.** { *; }
#-keep class com.flixclusive.providers.models.extractors.vidcloud.** { *; }
#-keep class com.flixclusive.providers.models.providers.flixhq.** { *; }
#-keep class com.flixclusive.providers.models.providers.superstream.** { *; }
#-keep class com.flixclusive.providers.models.providers.lookmovie.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,9 @@ data class LookMovieMediaDetail(
@SerializedName("first_air_date", alternate = ["release_date"]) val releaseDate: String? = null
) {
data class Episode(
val description: String,
val episode: Int,
val id: Int,
val id_show: Int,
val imdb_rating: Any,
val is_active: Int,
val poster: String,
val rel_title: String,
val season: Int,
val shard: String,
val show_title: Any,
val still_path: String,
val title: String
val id: Int,
val episode: Int,
val season: Int,
)

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package com.flixclusive.providers

import android.util.Base64
import com.flixclusive.providers.interfaces.SourceProvider
import com.flixclusive.providers.models.common.MediaInfo
import com.flixclusive.providers.models.common.MediaType
import com.flixclusive.providers.models.common.VideoData
import io.mockk.every
import io.mockk.mockkStatic
import kotlinx.coroutines.test.runTest
Expand Down Expand Up @@ -33,6 +35,58 @@ abstract class BaseSourceProviderTest {
}
}

private suspend fun getSourceData(
title: String,
releaseDate: String,
type: MediaType,
season: Int? = null,
episode: Int? = null,
): VideoData {
val response = sourceProvider.search(
query = title,
page = 1,
mediaType = type
)

val mediaId = response.results.find {
val releaseDateToUse = if(it.releaseDate == null) {
sourceProvider.getMediaInfo(it.id!!, it.mediaType!!).releaseDate
} else it.releaseDate

releaseDateToUse == releaseDate
}?.id
Assert.assertNotNull(mediaId)

return sourceProvider.getSourceLinks(
mediaId = mediaId!!,
season = season,
episode = episode
)
}

private suspend fun getMediaInfo(
title: String,
releaseDate: String,
type: MediaType,
): MediaInfo {
val response = sourceProvider.search(
query = title,
page = 1,
mediaType = type
)

val mediaId = response.results.find {
val releaseDateToUse = if(it.releaseDate == null) {
sourceProvider.getMediaInfo(it.id!!, it.mediaType!!).releaseDate
} else it.releaseDate

releaseDateToUse == releaseDate
}?.id
Assert.assertNotNull(mediaId)

return sourceProvider.getMediaInfo(mediaId = mediaId!!, mediaType = type)
}

@Test
open fun `Search for The Dark Knight (2008)`() = runTest {
val title = "The Dark Knight"
Expand All @@ -51,64 +105,60 @@ abstract class BaseSourceProviderTest {
open fun `Get The Dark Knight (2008) source`() = runTest {
val title = "The Dark Knight"
val releaseDate = "2008"
val response = sourceProvider.search(
query = title,
page = 1,
mediaType = MediaType.Movie
)

val theDarkKnight = response.results.find { it.releaseDate == releaseDate }
Assert.assertNotNull(theDarkKnight?.id)

val data = sourceProvider.getSourceLinks(theDarkKnight!!.id!!)
val data = getSourceData(
title = title,
releaseDate = releaseDate,
type = MediaType.Movie
)

assert(data.source.isNotBlank())
assert(data.subtitles.isNotEmpty())
assert(data.source.isNotBlank())
assert(data.servers?.isNotEmpty() == true)
assert(data.subtitles.isNotEmpty())
}

@Test
open fun `Get World War Z (2013) source`() = runTest {
val title = "World War Z"
val releaseDate = "2013"
val response = sourceProvider.search(
query = title,
page = 1,
mediaType = MediaType.Movie

val data = getSourceData(
title = title,
releaseDate = releaseDate,
type = MediaType.Movie
)

val fnaf = response.results.find { it.releaseDate == releaseDate }
Assert.assertNotNull(fnaf?.id)
assert(data.subtitles.isNotEmpty())
assert(data.source.isNotBlank())
assert(data.servers?.isNotEmpty() == true)
}

val data = sourceProvider.getSourceLinks(fnaf!!.id!!)
@Test
open fun `Get When Evil Lurks (2023) source`() = runTest {
val title = "When Evil Lurks"
val releaseDate = "2023"

val data = getSourceData(
title = title,
releaseDate = releaseDate,
type = MediaType.Movie
)

assert(data.source.isNotBlank())
assert(data.subtitles.isNotEmpty())
assert(data.source.isNotBlank())
assert(data.servers?.isNotEmpty() == true)
assert(data.subtitles.isNotEmpty())
}

@Test
open fun `Get Silo (TV-2023) Details`() = runTest {
val title = "Silo"
val releaseDate = "2023"
val response = sourceProvider.search(
query = title,
page = 1,
mediaType = MediaType.TvShow
)

val silo = response.results.find {
val releaseDateToUse = if(it.releaseDate == null) {
sourceProvider.getMediaInfo(it.id!!, it.mediaType!!).releaseDate
} else it.releaseDate

releaseDateToUse == releaseDate
}
Assert.assertNotNull(silo?.id)

val data = sourceProvider.getMediaInfo(silo!!.id!!, MediaType.TvShow)
val data = getMediaInfo(
title = title,
releaseDate = releaseDate,
type = MediaType.TvShow
)

Assert.assertEquals(data.title, title)
assert(data.releaseDate.isNotBlank())
Expand All @@ -122,25 +172,16 @@ abstract class BaseSourceProviderTest {
val season = 1
val episode = 3

val response = sourceProvider.search(
query = title,
page = 1,
mediaType = MediaType.TvShow
val data = getSourceData(
title = title,
releaseDate = releaseDate,
type = MediaType.TvShow,
season = season,
episode = episode
)

val aOt = response.results.find {
val releaseDateToUse = if(it.releaseDate == null) {
sourceProvider.getMediaInfo(it.id!!, it.mediaType!!).releaseDate
} else it.releaseDate

releaseDateToUse == releaseDate
}
Assert.assertNotNull(aOt?.id)

val data = sourceProvider.getSourceLinks(aOt!!.id!!, season = season, episode = episode)

assert(data.subtitles.isNotEmpty())
assert(data.source.isNotEmpty())
assert(data.servers?.isNotEmpty() == true)
assert(data.mediaId.isNotEmpty())
}
}

0 comments on commit a90215b

Please sign in to comment.