wapd patch for vdr 1.3.25

Message ID 1117477778.4633.84.camel@bobcat.mine.nu
State New
Headers

Commit Message

Ville Skyttä May 30, 2005, 6:29 p.m. UTC
  Attached is a patch for wapd 0.7a, fixes build with VDR versions up to
1.3.25 + contains one WML escaping fix.
  

Patch

diff -ru wapd-0.7a.orig/server.c wapd-0.7a/server.c
--- wapd-0.7a.orig/server.c	2005-01-25 22:32:24.000000000 +0200
+++ wapd-0.7a/server.c	2005-05-30 21:22:38.000000000 +0300
@@ -229,7 +229,11 @@ 
   if (Option("settings")) {
      unurilize(getopt);
      cChannel ch;
+#if VDRVERSNUM > 10323
+     if (ch.Parse(getopt)) {
+#else
      if (ch.Parse(getopt, true)) {
+#endif
         if (nr) {
            cChannel *channel = Channels.GetByNumber(nr);
            if (Channels.HasUniqueChannelID(&ch, channel)) {
@@ -481,7 +485,11 @@ 
            flags = timer->Active() ? 1 : 0;
 #endif
            channel_nr = timer->Channel()->Number();
+#if VDRVERSNUM > 10322
+           day = strdup(timer->PrintDay(timer->Day(), 0));
+#else
            day = strdup(timer->PrintDay(timer->Day()));
+#endif
            start = timer->Start();
            stop = timer->Stop();
            priority = timer->Priority();
@@ -505,7 +513,7 @@ 
      wmltr("Stop"), base, stop / 100, stop %100,
      wmltr("Priority"), base, priority,
      wmltr("Lifetime"), base, lifetime,
-     wmltr("File"), base, file);
+     wmltr("File"), base, wmlescape(file));
   if (timer)
      ReplyBuffer(WML_END(WML_DO("%s", URI_MAIN) WML_ENDDO()
         WML_DO("%s", URI_TIMERS) WML_ENDDO()
@@ -545,8 +553,13 @@ 
            int level = recording->HierarchyLevels();
            char *title = wmlescape(strdup(recording->Title(' ', false, level)));
            ReplyBuffer("%s" WML_BR(), title);
+#if VDRVERSNUM > 10324
+           if (recording->Info()->Description()) {
+              char *sum = wmlescape(strdup(recording->Info()->Description()));
+#else
            if (recording->Summary()) {
               char *sum = wmlescape(strdup(recording->Summary()));
+#endif
               char *tok;
               char *subtitle = strtok_r(sum, "\n", &tok);
               subtitle = strtok_r(NULL, "\n", &tok);
@@ -957,7 +970,11 @@ 
                  timer->Stop() % 100,
                  timer->Channel()->Number(),
 #if VDRVERSNUM >= 10318
+#if VDRVERSNUM > 10322
+                 *timer->PrintDay(timer->Day(), 0),
+#else
                  *timer->PrintDay(timer->Day()),
+#endif
 #else
                  timer->PrintDay(timer->Day()),
 #endif