Project

General

Profile

Feature #303

[patch] Multiple named DVR configurations

Added by sbi - about 14 years ago. Updated about 14 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
Category:
General
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

I see a common requirement to use different recording options for different types of TV programmes. For instance, I want to have movies recorded to one directory, while I want series recorded to another directory with the channel name in the file name.

Therefore I experimented a bit and finally created the attached patch to let tvheadend handle multiple DVR configurations.

At the user interface level, the patch makes the following changes:

  • add an editable combobox with the configuration name in the toolbar of the DVR configuration; the existing "save" button saves the configuration under the optional name typed into the combobox; a new "Delete configuration" button deletes the selected configuration;
  • add a combobox to select the DVR configuration in the the Record Program dialog box;
  • add a DVR Configuration column to the Recorder Schedule grid;
  • add an editable DVR Configuration column to the Automatic Recorder grid;
  • the UI changes are limited and can be ignored by users not interested in the feature, in which case the default configuration is used and the system works as before.

Screenshots are attached to illustrate this.

Under the hood, it does the following:

  • create a dvr_config_t data structure, store the configuration options in a list and add the necessary methods to manipulate it:
  /* find config by name or return null if named config not found */
  dvr_config_t *dvr_config_find_by_name(const char *name);
  /* find config by name and return defaut config if named config not found */
  dvr_config_t *dvr_config_find_by_name_default(const char *name);
  /* create new named config with default options */
  dvr_config_t *dvr_config_create(const char *name);
  /* delete named config */
  void dvr_config_delete(const char *name);

  • dvr_init and dvr_save initialize, load and save the corresponding configurations as dvr/config* files.
  • add a config_name field in dvr_autorec_entry_t and dvr_entry_t
  • pass the configuration name or dvr_config_t data structure around wherever dvr configuration options are required

Whenever a configuration is not found (for instance when it has been deleted while still being used by sheduled recordings), the system falls back to the default configuration which must always exist. A warning is logged is such cases.

I've been running tvheadend with this patch since a few days and it seems to work well.

Let me know what you think and, if you believe it's useful, how I can improve it to get it applied.


Files

dvrconfig1.png (29.1 KB) dvrconfig1.png screenshot dvr configuration 1 sbi -, 2010-10-10 21:51
dvrconfig1.2.png (29.2 KB) dvrconfig1.2.png screenshot dvr configuration 2 sbi -, 2010-10-10 21:54
recordprogram.png (19.5 KB) recordprogram.png Screenshot: Record Program sbi -, 2010-10-10 21:55
recorderschedule.png (50.3 KB) recorderschedule.png Screenshot: recorder schedule sbi -, 2010-10-10 21:55
automaticrecorder.png (19.9 KB) automaticrecorder.png Screenshot: automatic recorder sbi -, 2010-10-10 21:55
addsinglerecording.png (11.5 KB) addsinglerecording.png Screenshot: add manual recording event sbi -, 2010-10-10 21:56
dvrconfig.patch (49 KB) dvrconfig.patch The patch sbi -, 2010-10-10 21:56

History

#1

Updated by Andreas Smas about 14 years ago

Looks good. Extra good karma for staying with the source code style :-)

#2

Updated by Andreas Smas about 14 years ago

  • Found in version set to fixed

Applied in #5486

Also available in: Atom PDF