Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mdhelp: try to complete dvr config, fixes #3731
  • Loading branch information
perexg committed Apr 18, 2016
1 parent dc76d7d commit b41af43
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 1 deletion.
26 changes: 26 additions & 0 deletions 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.
1 change: 1 addition & 0 deletions docs/property/postprocessor.md
Expand Up @@ -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*

Expand Down
32 changes: 32 additions & 0 deletions 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"```
26 changes: 26 additions & 0 deletions 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"```
8 changes: 7 additions & 1 deletion src/dvr/dvr_config.c
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b41af43

Please sign in to comment.