]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
xmltv: Use format "X" instead of "X/" for season/episode export.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Sat, 29 Sep 2018 13:03:44 +0000 (14:03 +0100)
committerperexg <perex@perex.cz>
Tue, 2 Oct 2018 14:04:34 +0000 (16:04 +0200)
Previously we'd output "4/ . 3/. /", but some clients can not handle
the omitted "total" number. So we now output the simpler "4 . 3 ."
instead.

src/webui/xmltv.c

index cf62f061fa64488e223cf82ccbe50ccfaacdb311..a739189882b0b1ce7617cd728ca94ce14305a499 100644 (file)
@@ -105,8 +105,13 @@ _http_xmltv_add_episode_num(htsbuf_queue_t *hq, uint16_t num, uint16_t cnt)
    * counts are one-based.
    */
   if (num) htsbuf_qprintf(hq, "%d", num - 1);
-  htsbuf_append_str(hq, "/");
-  if (cnt) htsbuf_qprintf(hq, "%d", cnt);
+  /* Some clients can not handle "X", only "X/Y" or "/Y",
+   * so only output "/" if needed.
+   */
+  if (cnt) {
+    htsbuf_append_str(hq, "/");
+    htsbuf_qprintf(hq, "%d", cnt);
+  }
 }
 
 /*