Fix Mediaplayer crash for WAV playback and add basic Audio CD support (needs kernel...
[enigma2.git] / ServiceReference.py
index 238e7f6..11e2878 100644 (file)
@@ -1,12 +1,9 @@
-
-from enigma import *
-
-import NavigationInstance
+from enigma import eServiceReference, eServiceCenter
 
 class ServiceReference(eServiceReference):
        def __init__(self, ref):
-               if isinstance(ref, str):
-                       self.ref = eServiceReference(ref)
+               if not isinstance(ref, eServiceReference):
+                       self.ref = eServiceReference(ref or "")
                else:
                        self.ref = ref
                self.serviceHandler = eServiceCenter.getInstance()
@@ -16,22 +13,10 @@ class ServiceReference(eServiceReference):
        
        def getServiceName(self):
                info = self.info()
-               if info is None:
-                       return None
-               
-               return info.getName(self.ref)
+               return info and info.getName(self.ref) or ""
 
-       def play(self):
-               return self.serviceHandler.info(self.ref)
-       
-       def record(self):
-               return self.serviceHandler.record(self.ref)
-       
-       def list(self):
-               return self.serviceHandler.list(self.ref)
-       
        def info(self):
                return self.serviceHandler.info(self.ref)
 
-       def offlineOperations(self):
-               return self.serviceHandler.offlineOperations(self.ref)
+       def list(self):
+               return self.serviceHandler.list(self.ref)