+ def hotplugCB(self, dev, media_state):
+ print "[hotplugCB]", dev, media_state
+ if dev == harddiskmanager.getCD():
+ if media_state == "1":
+ self.scanHotplug()
+ else:
+ self.physicalDVD = False
+
+ def scanHotplug(self):
+ devicepath = harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())
+ if pathExists(devicepath):
+ from Components.Scanner import scanDevice
+ res = scanDevice(devicepath)
+ list = [ (r.description, r, res[r], self.session) for r in res ]
+ if list:
+ (desc, scanner, files, session) = list[0]
+ for file in files:
+ print file
+ if file.mimetype == "video/x-dvd":
+ print "physical dvd found:", devicepath
+ self.physicalDVD = True
+ return
+ self.physicalDVD = False
+