Hi

Finnish channels add parental rating to the end of title in EPG separated by parentheses, for example "Program title (12)", which in both annoying and also makes alphabetical sorting not function properly as different episodes may have different parental rating. The attached patch will remove the parental rating from the title and place it into correct EPG field.


If this is to be integrated into vdr-core it should be decided to which bugfix level it belongs. I added it to bugfix level 1 as it basically is misuse of EPG fields.

P.S. I have only tested this patch with 1.7.22 because my kernel is not supported anymore in most recent developer versions but it should not cause problems.

--
Matti
--- vdr-1.7.26/epg.c	2012-03-10 15:14:27.000000000 +0200
+++ vdr-1.7.26-epg/epg.c	2012-03-15 21:41:40.000000000 +0200
@@ -712,6 +712,22 @@
         }
      }
 
+  // Some channels put parental rating to the end of title in parentheses.
+  // In that case we move it to parental rating field:
+  if (title) {
+     int l = strlen(title);
+     if (l > 5 && (title[l - 1] == ')' && (title[l - 3] == '(' || title[l - 4] == '('))) {
+        int pos = 3;
+        if (title[l - 4] == '(')
+           pos = 4;
+        SetParentalRating(atoi(&title[l - pos + 1]));
+        if (title[l - pos - 1] == ' ')
+           pos++;
+        title[l - pos] = '\0';
+        EpgBugFixStat(5, ChannelID());
+        }
+     }
+
   if (Setup.EPGBugfixLevel <= 1)
      goto Final;
 
_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to