From b41af43b570571fb0d130a809e3d20ec2dabc636 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 18 Apr 2016 15:07:57 +0200 Subject: [PATCH] mdhelp: try to complete dvr config, fixes #3731 --- docs/property/pathname.md | 26 ++++++++++++++++++++++++++ docs/property/postprocessor.md | 1 + docs/property/postremove.md | 32 ++++++++++++++++++++++++++++++++ docs/property/preprocessor.md | 26 ++++++++++++++++++++++++++ src/dvr/dvr_config.c | 8 +++++++- 5 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 docs/property/pathname.md create mode 100644 docs/property/postremove.md create mode 100644 docs/property/preprocessor.md diff --git a/docs/property/pathname.md b/docs/property/pathname.md new file mode 100644 index 000000000..40ef4187e --- /dev/null +++ b/docs/property/pathname.md @@ -0,0 +1,26 @@ +: The string allow to manually specify the full path generation using + the predefined modifiers for strftime (see `man strftime`, except + `%n` and `%t`) and Tvheadend specific. Note that you may modify some of + this format string setting using the GUI fields below. + +Format | Description | Example +:--------:|--------------------------------------------------|-------- +`$t$n.$x` | Default format (title, unique number, extension) | Tennis - Wimbledon-1.mkv +`$s` | Event subtitle name | Sport +`$t` | Event title name | Tennis - Wimbledon +`$e` | Event episode name | S02-E06 +`$c` | Channel name | SkySport +`$g` | Content type | Movie : Science fiction +`$n` | Unique number added when the file already exists | -1 +`$x` | Filename extension (from the active stream muxer | mkv +`%F` | ISO 8601 date format | 2011-03-19 +`%R` | The time in 24-hour notation | 14:12 + +The format strings `$t`,`$s`,`%e`,`$c` also have delimiter variants such as +`$ t` (space after the dollar character), `$-t`, `$_t`, +`$.t`, `$,t`, `$;t`. In these cases, the delimiter is applied +only when the substituted string is not empty. + +For $t and $s format strings, you may also limit the number of output +characters using $99-t format string where 99 means the limit. As you can +see, the delimiter can be also applied. diff --git a/docs/property/postprocessor.md b/docs/property/postprocessor.md index 12f65a54b..9f21c8380 100644 --- a/docs/property/postprocessor.md +++ b/docs/property/postprocessor.md @@ -22,6 +22,7 @@ Format | Description | Example value `%E` | Stop time stamp of recording, UNIX epoch | 1224426600 `%r` | Number of errors during recording | 0 `%R` | Number of data errors during recording | 6 +`%i` | Streams (comma separated) | H264,AC3,TELETEXT *Example usage* diff --git a/docs/property/postremove.md b/docs/property/postremove.md new file mode 100644 index 000000000..9ff0565a1 --- /dev/null +++ b/docs/property/postremove.md @@ -0,0 +1,32 @@ +: Command to run after finishing a recording. The command will be run in + background and is executed even if a recording is aborted or an error + occurred. Use the %e error formatting string to check for errors, the + error string is “OK” if recording finished successfully. + + Supported format strings: + + +Format | Description | Example value +:-----:| ----------------------------------------- | ------------- +`%f` | Full path to recording | /home/user/Videos/News.mkv +`%b` | Basename of recording | News.mkv +`%c` | Channel name | BBC world +`%O` | Owner of this recording | user +`%C` | Who created this recording | user +`%t` | Program title | News +`%s` | Program subtitle | Afternoon +`%p` | Program episode | S02.E07 +`%d` | Program description | News and stories… +`%e` | Error message | Aborted by user +`%S` | Start time stamp of recording, UNIX epoch | 1224421200 +`%E` | Stop time stamp of recording, UNIX epoch | 1224426600 +`%r` | Number of errors during recording | 0 +`%R` | Number of data errors during recording | 6 +`%i` | Streams (comma separated) | H264,AC3,TELETEXT + +*Example usage* + +To use special characters (e.g. spaces), either put the string in quotes or +escape the individual characters. + +```/usr/bin/tvh_file_removed "%f"``` diff --git a/docs/property/preprocessor.md b/docs/property/preprocessor.md new file mode 100644 index 000000000..f2da6bc60 --- /dev/null +++ b/docs/property/preprocessor.md @@ -0,0 +1,26 @@ +: Command to run when a recording starts. The command will be run in + background. + + Supported format strings: + + +Format | Description | Example value +:-----:| ----------------------------------------- | ------------- +`%f` | Full path to recording | /home/user/Videos/News.mkv +`%b` | Basename of recording | News.mkv +`%c` | Channel name | BBC world +`%O` | Owner of this recording | user +`%C` | Who created this recording | user +`%t` | Program title | News +`%s` | Program subtitle | Afternoon +`%p` | Program episode | S02.E07 +`%d` | Program description | News and stories… +`%S` | Start time stamp of recording, UNIX epoch | 1224421200 +`%E` | Stop time stamp of recording, UNIX epoch | 1224426600 + +*Example usage* + +To use special characters (e.g. spaces), either put the string in quotes or +escape the individual characters. + +```/usr/bin/lcd_show "%f"``` diff --git a/src/dvr/dvr_config.c b/src/dvr/dvr_config.c index ed8c73845..6ac78d22c 100644 --- a/src/dvr/dvr_config.c +++ b/src/dvr/dvr_config.c @@ -792,7 +792,10 @@ dvr_config_class_pathname_set(void *o, const void *v) } CLASS_DOC(dvrconfig) +PROP_DOC(preprocessor) PROP_DOC(postprocessor) +PROP_DOC(postremove) +PROP_DOC(pathname) const idclass_t dvr_config_class = { .ic_class = "dvrconfig", @@ -1023,6 +1026,7 @@ const idclass_t dvr_config_class = { .name = N_("Pre-processor command"), .desc = N_("Script/program to be run when a recording starts " "(service is subscribed but no filename available)."), + .doc = prop_doc_preprocessor, .off = offsetof(dvr_config_t, dvr_preproc), .opts = PO_EXPERT, .group = 1, @@ -1032,6 +1036,7 @@ const idclass_t dvr_config_class = { .id = "postproc", .name = N_("Post-processor command"), .desc = N_("Script/program to be run when a recording completes."), + .doc = prop_doc_postprocessor, .off = offsetof(dvr_config_t, dvr_postproc), .opts = PO_ADVANCED, .group = 1, @@ -1041,6 +1046,7 @@ const idclass_t dvr_config_class = { .id = "postremove", .name = N_("Post-remove command"), .desc = N_("Script/program to be run when a recording gets removed."), + .doc = prop_doc_postremove, .off = offsetof(dvr_config_t, dvr_postremove), .opts = PO_EXPERT, .group = 1, @@ -1127,7 +1133,7 @@ const idclass_t dvr_config_class = { .desc = N_("The string allows you to manually specify the " "full path generation using predefined " "modifiers. See Help for full details."), - .doc = prop_doc_postprocessor, + .doc = prop_doc_pathname, .set = dvr_config_class_pathname_set, .off = offsetof(dvr_config_t, dvr_pathname), .opts = PO_EXPERT, -- 2.47.3