From dc848a7006273ab4c9abd05c9aa4c5c6659dbda2 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 8 May 2021 00:59:57 +0200 Subject: [PATCH] fix bandwidth calculation for single-service groups --- owrx/service/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/owrx/service/__init__.py b/owrx/service/__init__.py index 00afe18..2206924 100644 --- a/owrx/service/__init__.py +++ b/owrx/service/__init__.py @@ -254,7 +254,10 @@ class ServiceHandler(SdrSourceEventClient): groups.append([f for f in freqs if previous < f["frequency"]]) def get_total_bandwidth(group): - return bandwidth + len(group) * self.get_bandwidth(group) + if len(group) > 1: + return bandwidth + len(group) * self.get_bandwidth(group) + else: + return bandwidth total_bandwidth = sum([get_total_bandwidth(group) for group in groups]) return {