mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
fix(airband): parse composite device value and send sdr_type to backend
The airband start function was calling parseInt() directly on composite device selector values like "rtlsdr:0", which always returned NaN and fell back to device 0. This also meant sdr_type was never sent to the backend, and could result in int(None) TypeError on the server. Now properly splits the composite value (matching ADS-B/ACARS/VDL2 pattern) and sends both device index and sdr_type. Also hardened backend int() parsing to use explicit None checks. Fixes: "Airband Error: Invalid parameter: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1311,9 +1311,9 @@ def start_audio() -> Response:
|
||||
try:
|
||||
frequency = float(data.get('frequency', 0))
|
||||
modulation = normalize_modulation(data.get('modulation', 'wfm'))
|
||||
squelch = int(data.get('squelch') or 0)
|
||||
gain = int(data.get('gain') or 40)
|
||||
device = int(data.get('device') or 0)
|
||||
squelch = int(data['squelch']) if data.get('squelch') is not None else 0
|
||||
gain = int(data['gain']) if data.get('gain') is not None else 40
|
||||
device = int(data['device']) if data.get('device') is not None else 0
|
||||
sdr_type = str(data.get('sdr_type', 'rtlsdr')).lower()
|
||||
request_token_raw = data.get('request_token')
|
||||
request_token = int(request_token_raw) if request_token_raw is not None else None
|
||||
|
||||
Reference in New Issue
Block a user