mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 15:38:19 +08:00
Merge pull request #5405 from cddjr/fix_modify_time_comparison
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from datetime import datetime
|
import math
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, List, Optional
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ def list_files(fileitem: schemas.FileItem,
|
|||||||
if sort == "name":
|
if sort == "name":
|
||||||
file_list.sort(key=lambda x: StringUtils.natural_sort_key(x.name or ""))
|
file_list.sort(key=lambda x: StringUtils.natural_sort_key(x.name or ""))
|
||||||
else:
|
else:
|
||||||
file_list.sort(key=lambda x: x.modify_time or datetime.min, reverse=True)
|
file_list.sort(key=lambda x: x.modify_time or -math.inf, reverse=True)
|
||||||
return file_list
|
return file_list
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user