diff --git a/owrx/controllers/services.py b/owrx/controllers/services.py index 1001d6e5..f7fc2ad6 100644 --- a/owrx/controllers/services.py +++ b/owrx/controllers/services.py @@ -37,12 +37,8 @@ class ServiceController(AuthorizationMixin, WebpageController): @staticmethod def renderService(c): # Choose units based on frequency - mode = c["mode"] freq = c["freq"] - if freq is None: - freq = "" - unit = "" - elif freq >= 1000000000: + if freq >= 1000000000: freq = freq / 1000000000 unit = "GHz" elif freq >= 30000000: @@ -55,8 +51,7 @@ class ServiceController(AuthorizationMixin, WebpageController): unit = "Hz" # Removing trailing zeros, converting mode to upper case freq = re.sub(r"\.?0+$", "", "{0}".format(freq)) - mode = "???" if mode is None else mode.upper() # Format row return "{0}{1} {2}{3}{4}".format( - mode, c["sdr"], c["band"], freq, unit + c["mode"].upper(), c["sdr"], c["band"], freq, unit ) diff --git a/owrx/service/__init__.py b/owrx/service/__init__.py index 3d756db5..db514ad2 100644 --- a/owrx/service/__init__.py +++ b/owrx/service/__init__.py @@ -403,10 +403,13 @@ class Services(object): band = handler.source.getProfileName() for service in handler.services: if isinstance(service, ServiceDemodulatorChain): - result.append({ - "sdr" : sdr, - "band" : band, - "freq" : service.getFrequency(), - "mode" : service.getMode() - }) + freq = service.getFrequency() + mode = service.getMode() + if freq and mode: + result.append({ + "sdr" : sdr, + "band" : band, + "freq" : freq, + "mode" : mode + }) return result