From f36d72cb588325f8bbd84c39737bb788acc1c43c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 21 Jan 2019 19:19:29 +0000 Subject: =?UTF-8?q?as-content-rating:=20Add=20missing=20OARS=20=E2=86=92?= =?UTF-8?q?=20CSM=20mappings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These mappings were missing from the table, which could result in as_content_rating_id_value_to_csm_age() returning 0 for some #AsContentRatingValues even though it would return >0 for a less-intense #AsContentRatingValue for the same ID. Fix that by adding additional mappings. There’s no child psychology knowledge behind the choices: they’re simply copies of the next age for the same ID, chosen to avoid exposing young children to content which the mappings didn’t already explicitly expose them to. Signed-off-by: Philip Withnall https://github.com/hughsie/appstream-glib/issues/280 --- libappstream-glib/as-content-rating.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libappstream-glib/as-content-rating.c b/libappstream-glib/as-content-rating.c index 09d94d8..44969aa 100644 --- a/libappstream-glib/as-content-rating.c +++ b/libappstream-glib/as-content-rating.c @@ -242,6 +242,8 @@ as_content_rating_id_value_to_csm_age (const gchar *id, AsContentRatingValue val { "violence-bloodshed", AS_CONTENT_RATING_VALUE_MODERATE, 11 }, { "violence-bloodshed", AS_CONTENT_RATING_VALUE_INTENSE, 18 }, { "violence-sexual", AS_CONTENT_RATING_VALUE_NONE, 0 }, + { "violence-sexual", AS_CONTENT_RATING_VALUE_MILD, 18 }, + { "violence-sexual", AS_CONTENT_RATING_VALUE_MODERATE, 18 }, { "violence-sexual", AS_CONTENT_RATING_VALUE_INTENSE, 18 }, { "drugs-alcohol", AS_CONTENT_RATING_VALUE_NONE, 0 }, { "drugs-alcohol", AS_CONTENT_RATING_VALUE_MILD, 11 }, @@ -254,9 +256,11 @@ as_content_rating_id_value_to_csm_age (const gchar *id, AsContentRatingValue val { "drugs-tobacco", AS_CONTENT_RATING_VALUE_NONE, 0 }, { "drugs-tobacco", AS_CONTENT_RATING_VALUE_MILD, 10 }, { "drugs-tobacco", AS_CONTENT_RATING_VALUE_MODERATE, 13 }, + { "drugs-tobacco", AS_CONTENT_RATING_VALUE_INTENSE, 13 }, { "sex-nudity", AS_CONTENT_RATING_VALUE_NONE, 0 }, { "sex-nudity", AS_CONTENT_RATING_VALUE_MILD, 12 }, { "sex-nudity", AS_CONTENT_RATING_VALUE_MODERATE, 14 }, + { "sex-nudity", AS_CONTENT_RATING_VALUE_INTENSE, 14 }, { "sex-themes", AS_CONTENT_RATING_VALUE_NONE, 0 }, { "sex-themes", AS_CONTENT_RATING_VALUE_MILD, 13 }, { "sex-themes", AS_CONTENT_RATING_VALUE_MODERATE, 14 }, @@ -288,12 +292,18 @@ as_content_rating_id_value_to_csm_age (const gchar *id, AsContentRatingValue val { "social-chat", AS_CONTENT_RATING_VALUE_MODERATE, 10 }, { "social-chat", AS_CONTENT_RATING_VALUE_INTENSE, 13 }, { "social-audio", AS_CONTENT_RATING_VALUE_NONE, 0 }, + { "social-audio", AS_CONTENT_RATING_VALUE_MILD, 15 }, + { "social-audio", AS_CONTENT_RATING_VALUE_MODERATE, 15 }, { "social-audio", AS_CONTENT_RATING_VALUE_INTENSE, 15 }, { "social-contacts", AS_CONTENT_RATING_VALUE_NONE, 0 }, + { "social-contacts", AS_CONTENT_RATING_VALUE_MILD, 12 }, + { "social-contacts", AS_CONTENT_RATING_VALUE_MODERATE, 12 }, { "social-contacts", AS_CONTENT_RATING_VALUE_INTENSE, 12 }, { "social-info", AS_CONTENT_RATING_VALUE_NONE, 0 }, { "social-info", AS_CONTENT_RATING_VALUE_INTENSE, 13 }, { "social-location", AS_CONTENT_RATING_VALUE_NONE, 0 }, + { "social-location", AS_CONTENT_RATING_VALUE_MILD, 13 }, + { "social-location", AS_CONTENT_RATING_VALUE_MODERATE, 13 }, { "social-location", AS_CONTENT_RATING_VALUE_INTENSE, 13 }, /* v1.1 additions */ { "social-info", AS_CONTENT_RATING_VALUE_MILD, 0 }, @@ -313,6 +323,7 @@ as_content_rating_id_value_to_csm_age (const gchar *id, AsContentRatingValue val { "sex-adultery", AS_CONTENT_RATING_VALUE_MODERATE, 10 }, { "sex-adultery", AS_CONTENT_RATING_VALUE_INTENSE, 18 }, { "sex-appearance", AS_CONTENT_RATING_VALUE_NONE, 0 }, + { "sex-appearance", AS_CONTENT_RATING_VALUE_MILD, 10 }, { "sex-appearance", AS_CONTENT_RATING_VALUE_MODERATE, 10 }, { "sex-appearance", AS_CONTENT_RATING_VALUE_INTENSE, 15 }, { "violence-worship", AS_CONTENT_RATING_VALUE_NONE, 0 }, -- cgit v1.2.1