fix(db): Fix type check in BTreeDB.getSetting
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m30s
Check code formatting / Check-C-Format (push) Successful in 7s
Check code formatting / Check-Python-Flake8 (push) Successful in 10s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 9s
Run pytests / Check-Pytest (push) Successful in 11s

Fix missing type() call in type check.
Also remove leftover debug print().

Signed-off-by: Matthias Blankertz <matthias@blankertz.org>
This commit is contained in:
2025-11-09 16:33:33 +01:00
parent 0820ec1fc8
commit 595f3bd37f

View File

@@ -209,7 +209,6 @@ class BTreeDB(IPlaylistDB):
if len(elements) >= 2 and elements[1] == b'playlist':
last = k
break
print(last)
elements = last.split(b'/')
if len(elements) != 3:
raise RuntimeError("Malformed playlist key")
@@ -273,7 +272,7 @@ class BTreeDB(IPlaylistDB):
return self.getPlaylistForTag(tag)
def getSetting(self, key: bytes | str) -> str:
if key is str:
if type(key) is str:
key = key.encode()
return self.db.get(b'settings/' + key, self.DEFAULT_SETTINGS[key]).decode()