From bea4946ae09bcab368696c50031e29c635017585 Mon Sep 17 00:00:00 2001 From: acid-burn Date: Wed, 12 May 2010 16:03:30 +0200 Subject: [PATCH] RecordTimer.py,RecordingConfig.py,setup.xml: *add possibility to change the default recording filename composition in expert mode. This allows now to have shorter recording filenames (Date-Name) or longer (DateTime-Channel-Name-Shortdescription) beside the default. This fixes #345 --- RecordTimer.py | 8 ++++++++ data/setup.xml | 1 + lib/python/Components/RecordingConfig.py | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) mode change 100644 => 100755 RecordTimer.py mode change 100644 => 100755 data/setup.xml mode change 100644 => 100755 lib/python/Components/RecordingConfig.py diff --git a/RecordTimer.py b/RecordTimer.py old mode 100644 new mode 100755 index f670417a..04c3ff12 --- a/RecordTimer.py +++ b/RecordTimer.py @@ -129,6 +129,7 @@ class RecordTimerEntry(timer.TimerEntry, object): def calculateFilename(self): service_name = self.service_ref.getServiceName() begin_date = strftime("%Y%m%d %H%M", localtime(self.begin)) + begin_shortdate = strftime("%Y%m%d", localtime(self.begin)) print "begin_date: ", begin_date print "service_name: ", service_name @@ -138,6 +139,13 @@ class RecordTimerEntry(timer.TimerEntry, object): filename = begin_date + " - " + service_name if self.name: filename += " - " + self.name + if config.usage.setup_level.index >= 2: # expert+ + if config.recording.filename_composition.value == "short": + filename = begin_shortdate + " - " + self.name + elif config.recording.filename_composition.value == "long": + filename = begin_date + " - " + service_name + " - " + self.name + " - " + self.description + else: + filename += " - " + self.name # standard if config.recording.ascii_filenames.value: filename = ASCIItranslit.legacyEncode(filename) diff --git a/data/setup.xml b/data/setup.xml old mode 100644 new mode 100755 index 705eaf33..f5dea734 --- a/data/setup.xml +++ b/data/setup.xml @@ -72,6 +72,7 @@ config.usage.pip_zero_button config.usage.alternatives_priority config.recording.ascii_filenames + config.recording.filename_composition config.usage.hdd_standby diff --git a/lib/python/Components/RecordingConfig.py b/lib/python/Components/RecordingConfig.py old mode 100644 new mode 100755 index fe9284d9..40dfb2ca --- a/lib/python/Components/RecordingConfig.py +++ b/lib/python/Components/RecordingConfig.py @@ -1,4 +1,4 @@ -from config import ConfigNumber, ConfigYesNo, ConfigSubsection, config +from config import ConfigNumber, ConfigYesNo, ConfigSubsection, ConfigSelection, config def InitRecordingConfig(): config.recording = ConfigSubsection(); @@ -8,3 +8,7 @@ def InitRecordingConfig(): config.recording.margin_after = ConfigNumber(default=0) config.recording.debug = ConfigYesNo(default = False) config.recording.ascii_filenames = ConfigYesNo(default = False) + config.recording.filename_composition = ConfigSelection(default = "standard", choices = [ + ("standard", _("standard")), + ("short", _("Short filenames")), + ("long", _("Long filenames")) ] ) \ No newline at end of file -- 2.30.2