From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Tue, 25 Sep 2018 23:25:39 +0000 (+0100) Subject: dvr: Add new format specifier %U for uuid in postproc. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e8c4691993e09d43a7e894f2a023bc390512022;p=thirdparty%2Ftvheadend.git dvr: Add new format specifier %U for uuid in postproc. --- diff --git a/docs/property/postprocessor.md b/docs/property/postprocessor.md index a1b2b98d6..91fafd96d 100644 --- a/docs/property/postprocessor.md +++ b/docs/property/postprocessor.md @@ -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* diff --git a/docs/property/preprocessor.md b/docs/property/preprocessor.md index aea2a582e..3f8371dc9 100644 --- a/docs/property/preprocessor.md +++ b/docs/property/preprocessor.md @@ -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* diff --git a/src/dvr/dvr_rec.c b/src/dvr/dvr_rec.c index 1190fc1c0..43880a426 100644 --- a/src/dvr/dvr_rec.c +++ b/src/dvr/dvr_rec.c @@ -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 },