mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-01-03 15:20:27 +01:00
simplify
This commit is contained in:
parent
859868fd65
commit
24c4741215
|
|
@ -39,9 +39,6 @@ class SdrService(object):
|
|||
|
||||
@staticmethod
|
||||
def getAllSources():
|
||||
def isDeviceValid(device):
|
||||
return sdrTypeAvailable(device) and hasProfiles(device)
|
||||
|
||||
def hasProfiles(device):
|
||||
return "profiles" in device and device["profiles"] and len(device["profiles"]) > 0
|
||||
|
||||
|
|
@ -70,7 +67,10 @@ class SdrService(object):
|
|||
return cls(props)
|
||||
|
||||
if SdrService.sources is None:
|
||||
SdrService.sources = Config.get()["sdrs"].filter(isDeviceValid).map(buildNewSource)
|
||||
SdrService.sources = Config.get()["sdrs"] \
|
||||
.filter(sdrTypeAvailable) \
|
||||
.filter(hasProfiles) \
|
||||
.map(buildNewSource)
|
||||
return SdrService.sources
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Reference in a new issue