Skip to content

Commit

Permalink
2024-05-06 Fix Confidence sorting (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
NebularNerd authored May 8, 2024
1 parent 88bc58f commit 351fdfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion puremagic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _confidence(matches, ext=None) -> List[PureMagicWithConfidence]:
if not results:
raise PureError("Could not identify file")

return sorted(results, key=lambda x: x.confidence, reverse=True)
return sorted(results, key=lambda x: (x.confidence, x.byte_match), reverse=True)


def _identify_all(header: bytes, footer: bytes, ext=None) -> List[PureMagicWithConfidence]:
Expand Down

0 comments on commit 351fdfd

Please sign in to comment.