fix old route sorting (#31787)

* fix old route sorting

* cleanup

* Update system/loggerd/uploader.py

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 158e36976b
chrysler-long2
Adeeb Shihadeh 1 year ago committed by GitHub
parent 52eb1aee05
commit b73a5fba4c
  1. 4
      system/loggerd/uploader.py

@ -44,7 +44,9 @@ class FakeResponse:
def get_directory_sort(d: str) -> list[str]: def get_directory_sort(d: str) -> list[str]:
return [s.rjust(10, '0') for s in d.rsplit('--', 1)] # ensure old format is sorted sooner
o = ["0", ] if d.startswith("2024-") else ["1", ]
return o + [s.rjust(10, '0') for s in d.rsplit('--', 1)]
def listdir_by_creation(d: str) -> list[str]: def listdir_by_creation(d: str) -> list[str]:
if not os.path.isdir(d): if not os.path.isdir(d):

Loading…
Cancel
Save