Skip to content

Commit

Permalink
Merge pull request #2775 from InfinityPacer/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp authored Sep 25, 2024
2 parents 5b1d111 + 3512e7d commit eff3fad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/api/endpoints/storage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from datetime import datetime
from pathlib import Path
from typing import Any, List

Expand Down Expand Up @@ -68,9 +69,9 @@ def list(fileitem: schemas.FileItem,
file_list = StorageChain().list_files(fileitem)
if file_list:
if sort == "name":
file_list.sort(key=lambda x: x.name)
file_list.sort(key=lambda x: x.name or "")
else:
file_list.sort(key=lambda x: x.modify_time, reverse=True)
file_list.sort(key=lambda x: x.modify_time or datetime.min, reverse=True)
return file_list


Expand Down

0 comments on commit eff3fad

Please sign in to comment.