Skip to content

Commit

Permalink
[Updated] Add setter to serviceref
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarCC authored and Huevos committed Jan 15, 2025
1 parent 33d7e2e commit 8002af0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/python/Components/Sources/CurrentService.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self, navcore):
self.navcore = navcore
self.srv = None
self.info = None
self.ref = None
self.onManualNewService = []

def serviceEvent(self, event):
Expand All @@ -50,11 +51,16 @@ def getCurrentServiceWithFallback(self):

@cached
def getCurrentServiceRef(self):
if self.ref:
return self.ref
if NavigationInstance.instance is not None:
return NavigationInstance.instance.getCurrentlyPlayingServiceOrGroup()
return None

def setCurrentServiceRef(self, ref):
self.ref = ref

serviceref = property(getCurrentServiceRef)
serviceref = property(getCurrentServiceRef, setCurrentServiceRef)

def newService(self, ref):
if ref and isinstance(ref, bool):
Expand Down

0 comments on commit 8002af0

Please sign in to comment.