[totem-pl-parser] plparser: Add support for content rating



commit 676dddf0af73c6a5c06ff39dce3b20ee5c793880
Author: crvi <crvisqr gmail com>
Date:   Thu Oct 1 01:29:35 2020 +0530

    plparser: Add support for content rating
    
    This is necessary as GNOME 3.38 now supports parental controls.

 plparse/totem-pl-parser.c |  4 ++++
 plparse/totem-pl-parser.h | 14 ++++++++++++++
 2 files changed, 18 insertions(+)
---
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index c1b0600..e4db129 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -573,6 +573,10 @@ totem_pl_parser_class_init (TotemPlParserClass *klass)
                                     "The default audio-track to play", NULL,
                                     G_PARAM_READABLE & G_PARAM_WRITABLE);
        g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
+       pspec = g_param_spec_string ("content-rating", "content-rating",
+                                    "String representing the content rating for an entry", 
TOTEM_PL_PARSER_CONTENT_RATING_UNRATED,
+                                    G_PARAM_READABLE & G_PARAM_WRITABLE);
+       g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
 }
 
 static void
diff --git a/plparse/totem-pl-parser.h b/plparse/totem-pl-parser.h
index 6205aa6..1b10d4f 100644
--- a/plparse/totem-pl-parser.h
+++ b/plparse/totem-pl-parser.h
@@ -274,6 +274,20 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(TotemPlParser, g_object_unref)
  * track is defined as NULL. Note that the value is sent as a string.
  **/
 #define TOTEM_PL_PARSER_FIELD_AUDIO_TRACK       "audio-track"
+/**
+ * TOTEM_PL_PARSER_FIELD_CONTENT_RATING:
+ *
+ * Metadata field for an entry's content rating. It is
+ * %TOTEM_PL_PARSER_CONTENT_RATING_CLEAN for clean content,
+ * %TOTEM_PL_PARSER_CONTENT_RATING_EXPLICIT for explicit content and
+ * %TOTEM_PL_PARSER_CONTENT_RATING_UNRATED for content which is not
+ * rated.
+ **/
+#define TOTEM_PL_PARSER_FIELD_CONTENT_RATING       "content-rating"
+
+#define TOTEM_PL_PARSER_CONTENT_RATING_CLEAN       "clean"
+#define TOTEM_PL_PARSER_CONTENT_RATING_EXPLICIT    "explicit"
+#define TOTEM_PL_PARSER_CONTENT_RATING_UNRATED     "unrated"
 
 /**
  * TotemPlParserClass:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]