eServiceReference, iRecordableService, quitMainloop
from Components.config import config
+from Components.UsageConfig import defaultMoviePath
from Components.TimerSanityCheck import TimerSanityCheck
from Screens.MessageBox import MessageBox
import NavigationInstance
from ServiceReference import ServiceReference
-from time import localtime, strftime, localtime, ctime, time
+from time import localtime, strftime, ctime, time
from bisect import insort
# ok, for descriptions etc we have:
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
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 += " - " + self.name + " - " + self.description
+ else:
+ filename += " - " + self.name # standard
+ else:
+ filename += " - " + self.name
if config.recording.ascii_filenames.value:
filename = ASCIItranslit.legacyEncode(filename)
- if self.dirname and not Directories.fileExists(self.dirname, 'w'):
- self.dirnameHadToFallback = True
- self.Filename = Directories.getRecordingFilename(filename, None)
+ if not self.dirname or not Directories.fileExists(self.dirname, 'w'):
+ if self.dirname:
+ self.dirnameHadToFallback = True
+ dirname = defaultMoviePath()
else:
- self.Filename = Directories.getRecordingFilename(filename, self.dirname)
+ dirname = self.dirname
+ self.Filename = Directories.getRecordingFilename(filename, dirname)
self.log(0, "Filename calculated as: '%s'" % self.Filename)
#begin_date + " - " + service_name + description)
# because another recording at the same time on another service can try to record the same event
# i.e. cable / sat.. then the second recording needs an own extension... when we create the file
# here than calculateFilename is happy
- open(self.Filename + ".ts", "w").close()
+ if not self.justplay:
+ open(self.Filename + ".ts", "w").close()
# fine. it worked, resources are allocated.
self.next_activation = self.begin
self.backoff = 0
chktimecmp_end = chktimecmp + (duration / 60)
time = localtime(x.begin)
for y in (0, 1, 2, 3, 4, 5, 6):
- if x.repeated & (2 ** y) and (x.begin <= begin or begin <= x.begin <= end):
+ if x.repeated & (1 << y) and (x.begin <= begin or begin <= x.begin <= end):
timecmp = y * 1440 + time.tm_hour * 60 + time.tm_min
if timecmp <= chktimecmp < (timecmp + ((x.end - x.begin) / 60)):
time_match = ((timecmp + ((x.end - x.begin) / 60)) - chktimecmp) * 60