playlistdb: micropython does not have bytes.removeprefix()
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 3m22s
Check code formatting / Check-C-Format (push) Successful in 7s
Check code formatting / Check-Python-Flake8 (push) Successful in 9s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 5s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s
Run pytests / Check-Pytest (push) Successful in 10s

This commit is contained in:
2025-08-28 18:05:25 +02:00
parent bb18717ec2
commit 6645c4443b

View File

@@ -92,7 +92,8 @@ class BTreeDB(IPlaylistDB):
return self.db[pos]
def _setPlaylistPos(self, tag, pos, flush=True):
self.db[self._keyPlaylistPos(tag)] = pos.removeprefix(self._keyPlaylistStart(tag))
assert pos.startswith(self._keyPlaylistStart(tag))
self.db[self._keyPlaylistPos(tag)] = pos[len(self._keyPlaylistStart(tag)):]
if flush:
self._flush()