Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1163d683 authored by Hasib Prince's avatar Hasib Prince
Browse files

updated logic of age restriction

parent def7bb10
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ data class Application(
    var isGplayReplaced: Boolean = false,
    @SerializedName(value = "on_fdroid")
    val isFDroidApp: Boolean = false,
    val contentRating: ContentRating = ContentRating()
    var contentRating: ContentRating = ContentRating()
) {
    fun updateType() {
        this.type = if (this.is_pwa) PWA else NATIVE
+1 −1
Original line number Diff line number Diff line
@@ -25,5 +25,5 @@ data class ContentRatingGroup(
    val id: String,
    @SerializedName("age_group")
    val ageGroup: String,
    val ratings: List<String>
    var ratings: List<String>
)
+5 −1
Original line number Diff line number Diff line
@@ -69,7 +69,11 @@ class ContentRatingsRepository @Inject constructor(
            Timber.d("ContentRatings file contents: $contentRatingJson")

            val contentRatingsListTypeGroup = object : TypeToken<List<ContentRatingGroup>>() {}.type
            gson.fromJson(contentRatingJson, contentRatingsListTypeGroup)
            val contentRatingGroups: List<ContentRatingGroup> = gson.fromJson(contentRatingJson, contentRatingsListTypeGroup)
            contentRatingGroups.map { 
                it.ratings = it.ratings.map { rating -> rating.lowercase()}
                it
            }
        } catch (exception: JsonSyntaxException) {
            handleException(exception)
        }
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ data class AppInstall(
    )

    @Ignore
    var contentRating: ContentRating? = null
    var contentRating: ContentRating = ContentRating()

    fun isAppInstalling() = installingStatusList.contains(status)

+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ interface PlayStoreRepository : StoreRepository {
        offerType: Int
    ): List<File>

    suspend fun updateContentRatingWithId(
    suspend fun getContentRatingWithId(
        appPackage: String,
        contentRating: ContentRating
    ): ContentRating
Loading