diff --git a/lib/src/main/java/com/aurora/gplayapi/helpers/ContentRatingHelper.kt b/lib/src/main/java/com/aurora/gplayapi/helpers/ContentRatingHelper.kt index 135f1f5501e52384e1bbf52fbf954f861e611079..b1d73c4da1c13f856c108f93262e49a139e0b1de 100644 --- a/lib/src/main/java/com/aurora/gplayapi/helpers/ContentRatingHelper.kt +++ b/lib/src/main/java/com/aurora/gplayapi/helpers/ContentRatingHelper.kt @@ -50,7 +50,7 @@ class ContentRatingHelper(authData: AuthData) : BaseHelper(authData) { } return try { - val englishLocaleContentRating = fetchContentRating(appPackage, Locale.US) + val englishLocaleContentRating = getEnglishContentRating(appPackage) // For rating in other languages, we set the English title as its ID currentContentRating.copy(id = englishLocaleContentRating.title.lowercase()) @@ -59,11 +59,10 @@ class ContentRatingHelper(authData: AuthData) : BaseHelper(authData) { } } - private fun fetchContentRating( - appPackage: String, locale: Locale = Locale.getDefault() - ): ContentRating { - val response = getAppDetails(packageName = appPackage, locale = locale) - return AppBuilder.build(response).contentRating + fun getEnglishContentRating(appPackage: String): ContentRating { + val response = getAppDetails(appPackage, Locale.US) + val contentRating = AppBuilder.build(response).contentRating + return contentRating.copy(id = contentRating.title.lowercase()) } private fun getAppDetails(