Skip to content

Commit

Permalink
traverse by directory modified date instead of by name
Browse files Browse the repository at this point in the history
Sorting alphabetically only works nicely if changes are made to the
lexically latest folder, but not if changes happen in an old folder.
  • Loading branch information
breunigs committed Aug 13, 2024
1 parent 99130c9 commit b555a6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/detection/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def recurse(folder, queue, bar):

# walk newer folders first to hide slow remote file system enumeration
# while already processing the first videos
subdirs.sort(reverse=True)
subdirs.sort(key=lambda sdir: os.path.getmtime(os.path.join(parent, sdir)), reverse=True)

for name in files:
(_, ext) = os.path.splitext(name)
Expand Down

0 comments on commit b555a6f

Please sign in to comment.