1 diff --git a/RecordTimer.py b/RecordTimer.py
2 index 58ef5b3..6e0862e 100755
5 @@ -410,6 +410,15 @@ class RecordTimerEntry(timer.TimerEntry, object):
7 record_service = property(lambda self: self.__record_service, setRecordService)
9 + def checkRecordingPath(self):
10 + old_Filename = self.Filename
11 + self.calculateFilename()
12 + filename = self.Filename
13 + self.Filename = old_Filename
15 + from Components import Harddisk
16 + return not Harddisk.isUsbStorage(filename)
19 begin = int(xml.get("begin"))
20 end = int(xml.get("end"))
21 @@ -466,6 +475,16 @@ class RecordTimer(timer.Timer):
22 print "unable to load timers from file!"
24 def doActivate(self, w):
25 + if w.state == RecordTimerEntry.StateWaiting and w.checkRecordingPath() is False:
26 + service_name = w.service_ref.getServiceName()
27 + self.timer_list.remove(w)
28 + if w.dontSave is False:
31 + self.addTimerEntry(w)
32 + Notifications.AddNotification(MessageBox, _("Can not recording on a USB storage.\nService name : %s"% service_name), MessageBox.TYPE_ERROR)
35 # when activating a timer which has already passed,
36 # simply abort the timer. don't run trough all the stages.
38 diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py
39 index fe99426..e40f1b5 100755
40 --- a/lib/python/Components/Harddisk.py
41 +++ b/lib/python/Components/Harddisk.py
42 @@ -58,6 +58,30 @@ def enableUdevEvent(enable = True):
46 +def getDeviceFile(dev_path):
47 + for parts in getProcMounts():
48 + if os.path.realpath(parts[1]).startswith(dev_path):
51 +def isUsbStorage(filename):
52 + _dirname = os.path.dirname(filename)
53 + _dirname = os.path.realpath(_dirname)
54 + while not os.path.ismount(_dirname):
55 + _dirname = os.path.dirname(_dirname)
60 + dev = getDeviceFile(_dirname)
62 + dev = os.path.basename(dev)
63 + phyPath = os.path.realpath('/sys/block/' + dev[:3])
64 + for x in glob.glob("/sys/bus/usb/devices/usb*"):
65 + if phyPath.find(os.path.realpath(x)) != -1:
73 diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
74 index baeaacb..cb28ffc 100755
75 --- a/lib/python/Screens/InfoBarGenerics.py
76 +++ b/lib/python/Screens/InfoBarGenerics.py
77 @@ -1239,6 +1239,11 @@ class InfoBarTimeshift:
78 if self.timeshift_enabled:
79 print "hu, timeshift already enabled?"
81 + from Components import Harddisk
82 + if Harddisk.isUsbStorage(config.usage.timeshift_path.value):
83 + self.session.open(MessageBox, _("Timeshift not possible on a USB storage."), MessageBox.TYPE_ERROR)
86 if not ts.startTimeshift():
87 self.timeshift_enabled = 1
89 diff --git a/timer.py b/timer.py
90 index aaae0b2..d58a83e 100644
93 @@ -232,6 +232,10 @@ class Timer:
94 self.setNextActivation(min)
96 def timeChanged(self, timer):
97 + if timer not in (self.processed_timers + self.timer_list):
98 + print "timer not found"
103 if timer.state == TimerEntry.StateEnded: