element.
+ * Expects integer representing minimal age of watcher.
+ * Other rating types (non-integer, for example MPAA or VCHIP) are ignored.
+ *
+ * Attribute system is ignored.
+ *
+ * Working example:
+ * 16
+ *
+ * Currently non-working example:
+ *
+ * PG
+ *
+ *
+ *
+ * TODO - support for other rating systems:
+ * [rating system=VCHIP] values TV-PG, TV-G, etc
+ * [rating system=MPAA] values R, PG, G, PG-13 etc
+ * [rating system=advisory] values "strong sexual content","Language", etc
+ */
+static int _xmltv_parse_age_rating
+ ( epggrab_module_t *mod, epg_episode_t *ee, htsmsg_t *body )
+{
+ uint8_t age;
+ htsmsg_t *rating, *tags;
+ const char *s1;
+
+ if (!mod || !ee || !body) return 0;
+ if (!(rating = htsmsg_get_map(body, "rating"))) return 0;
+ if (!(tags = htsmsg_get_map(rating, "tags"))) return 0;
+ if (!(s1 = htsmsg_xml_get_cdata_str(tags, "value"))) return 0;
+
+ age = atoi(s1);
+
+ return epg_episode_set_age_rating(ee, age, mod);
+}
+
/*
* Parse category list
*/
@@ -509,8 +552,7 @@ static int _xmltv_parse_programme_tags
save3 |= _xmltv_parse_star_rating(mod, ee, tags);
-
- // TODO: parental rating
+ save3 |= _xmltv_parse_age_rating(mod, ee, tags);
}
/* Stats */
diff --git a/src/webui/extjs.c b/src/webui/extjs.c
old mode 100644
new mode 100755
index 96b6520f..6b6b9ade
--- a/src/webui/extjs.c
+++ b/src/webui/extjs.c
@@ -762,6 +762,10 @@ extjs_epg(http_connection_t *hc, const char *remain, void *opaque)
htsmsg_add_u32(m, "start", e->start);
htsmsg_add_u32(m, "end", e->stop);
htsmsg_add_u32(m, "duration", e->stop - e->start);
+ if(ee->star_rating)
+ htsmsg_add_u32(m, "starrating", ee->star_rating);
+ if(ee->age_rating)
+ htsmsg_add_u32(m, "agerating", ee->age_rating);
if(e->serieslink)
htsmsg_add_str(m, "serieslink", e->serieslink->uri);
diff --git a/src/webui/static/app/epg.js b/src/webui/static/app/epg.js
old mode 100644
new mode 100755
index 6c290805..9b4a65c4
--- a/src/webui/static/app/epg.js
+++ b/src/webui/static/app/epg.js
@@ -40,6 +40,8 @@ tvheadend.epgDetails = function(event) {
content += '';
content += '' + event.episode + '
';
content += '' + event.description + '
';
+ content += '' + event.starrating + '
';
+ content += '' + event.agerating + '
';
content += '' + tvheadend.contentGroupLookupName(event.contenttype) + '
';
if (event.ext_desc != null)
@@ -228,6 +230,10 @@ tvheadend.epg = function() {
dateFormat : 'U' /* unix time */
}, {
name : 'duration'
+ }, {
+ name : 'starrating'
+ }, {
+ name : 'agerating'
}, {
name : 'contenttype'
}, {
@@ -272,11 +278,17 @@ tvheadend.epg = function() {
}
}
- function renderText(value, meta, record, rowIndex, colIndex, store) {
- setMetaAttr(meta, record);
+ function renderText(value, meta, record, rowIndex, colIndex, store) {
+ setMetaAttr(meta, record);
- return value;
- }
+ return value;
+ }
+
+ function renderInt(value, meta, record, rowIndex, colIndex, store) {
+ setMetaAttr(meta, record);
+
+ return '' + value;
+ }
var epgCm = new Ext.grid.ColumnModel([ actions, {
width : 250,
@@ -321,6 +333,18 @@ tvheadend.epg = function() {
header : "Channel",
dataIndex : 'channel',
renderer : renderText
+ }, {
+ width : 50,
+ id : 'starrating',
+ header : "Stars",
+ dataIndex : 'starrating',
+ renderer : renderInt
+ }, {
+ width : 50,
+ id : 'agerating',
+ header : "Age",
+ dataIndex : 'agerating',
+ renderer : renderInt
}, {
width : 250,
id : 'contenttype',