]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: Add new format specifier %U for uuid in postproc.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Tue, 25 Sep 2018 23:25:39 +0000 (00:25 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 26 Sep 2018 15:35:57 +0000 (17:35 +0200)
docs/property/postprocessor.md
docs/property/preprocessor.md
src/dvr/dvr_rec.c

index a1b2b98d63556b15f29d7c7ca32f441fe0d8a74b..91fafd96db8827631c58158feb6dd4fc1322c83e 100644 (file)
@@ -26,6 +26,7 @@ Format | Description                               | Example value
 `%r`   | Number of errors during recording         |  0
 `%R`   | Number of data errors during recording    |  6
 `%i`   | Streams (comma separated)                 |  H264,AC3,TELETEXT
+`%U`   | Unique ID of recording                    |  3cf44328eda87a428ba9a8b14876ab80
 `%Z`   | Comment                                   |  A string
 
 *Example usage*
index aea2a582e3a41654bd2e4b55dcf8cde8809cc143..3f8371dc96c304278fc0d0d8c535bf7fe13b4873 100644 (file)
@@ -19,6 +19,7 @@ Format | Description                               | Example value
 `%d`   | Program description                       |  News and stories…
 `%S`   | Start time stamp of recording, UNIX epoch |  1224421200
 `%E`   | Stop time stamp of recording, UNIX epoch  |  1224426600
+`%U`   | Unique ID of recording                    |  3cf44328eda87a428ba9a8b14876ab80
 `%Z`   | Comment                                   |  A string
 
 *Example usage*
index 1190fc1c0722bed357cf3d7b6fcd9fd41cb91b4e..43880a4265a9c07b4d0a8305d7bf5960c2871f69 100644 (file)
@@ -362,6 +362,16 @@ dvr_sub_description(const char *id, const char *fmt, const void *aux, char *tmp,
   return dvr_do_prefix(id, fmt, lang_str_get(((dvr_entry_t *)aux)->de_desc, NULL), tmp, tmplen);
 }
 
+static const char *
+dvr_sub_uuid(const char *id, const char *fmt, const void *aux, char *tmp, size_t tmplen)
+{
+  const dvr_entry_t *de = aux;
+  char ubuf[UUID_HEX_SIZE];
+  idnode_uuid_as_str(&de->de_id, ubuf);
+  strlcpy(tmp, ubuf, tmplen);
+  return tmp;
+}
+
 static const char *
 dvr_sub_episode(const char *id, const char *fmt, const void *aux, char *tmp, size_t tmplen)
 {
@@ -831,6 +841,7 @@ static htsstr_substitute_t dvr_subs_postproc_entry[] = {
   { .id = "t",  .getval = dvr_sub_title },
   { .id = "s",  .getval = dvr_sub_subtitle_or_summary },
   { .id = "u",  .getval = dvr_sub_subtitle },
+  { .id = "U",  .getval = dvr_sub_uuid },
   { .id = "m",  .getval = dvr_sub_summary },
   { .id = "p",  .getval = dvr_sub_episode },
   { .id = "d",  .getval = dvr_sub_description },