Set AFTEREVENT.AUTO for timers added by eventid.
authorStephan Reichholf <sreichholf@users.schwerkraft.elitedvb.net>
Fri, 4 Jun 2010 14:47:41 +0000 (14:47 +0000)
committerStephan Reichholf <sreichholf@users.schwerkraft.elitedvb.net>
Fri, 4 Jun 2010 14:47:41 +0000 (14:47 +0000)
More robust handling of "config.movielist.last_videodir". It may not exist, if it doesn't use '/hdd/movie/' if that doesn't exist, too, return "__ERROR__" so it's becoming obvious something is wrong/missing.

Untested changes - please report!

webinterface/src/WebComponents/Sources/LocationsAndTags.py
webinterface/src/WebComponents/Sources/Timer.py

index 3d486ec..ed7890b 100644 (file)
@@ -30,7 +30,11 @@ class LocationsAndTags(Source):
                        self.result = False
 
        def getCurrentLocation(self):
-               return config.movielist.last_videodir.value
+               path = config.movielist.last_videodir.value or "/hdd/movie"
+               if not os.path.exists(path):
+                       path = "__ERROR__"
+               
+               return path
 
        def getLocations(self):
                return config.movielist.videodirs.value
index 64bcc07..f2161a1 100644 (file)
@@ -382,7 +382,7 @@ class Timer(Source):
 
                (begin, end, name, description, eit) = parseEvent(event)
 
-               timer = RecordTimerEntry(ServiceReference(param['sRef']), begin , end, name, description, eit, False, justplay, AFTEREVENT.NONE, dirname=location, tags=tags)
+               timer = RecordTimerEntry(ServiceReference(param['sRef']), begin , end, name, description, eit, False, justplay, AFTEREVENT.AUTO, dirname=location, tags=tags)
                
                conflicts = self.recordtimer.record(timer)
                if conflicts is None: