diff --git a/libpurple_to_markdown/synctech_sms.py b/libpurple_to_markdown/synctech_sms.py index 55f1748..7e4009e 100644 --- a/libpurple_to_markdown/synctech_sms.py +++ b/libpurple_to_markdown/synctech_sms.py @@ -67,7 +67,7 @@ def sms_soup_to_message(soup: bs4.BeautifulSoup) -> Message: def select_newest_file_in_dir(path: Path) -> Path: - return min( + return max( (p for p in path.iterdir() if p.suffix == '.xml' and 'sms' in p.name), key=lambda p: p.stat().st_atime_ns, )