Sort folder lists in a case-insensitive manner across download manager, file monitor, and cache services

This commit is contained in:
Will Miao
2025-02-16 06:57:32 +08:00
parent c12d2ad59a
commit 1d91251e24
3 changed files with 4 additions and 5 deletions

View File

@@ -28,9 +28,8 @@ class LoraCache:
reverse=True
)
# Update folder list
self.folders = sorted(list(set(
l['folder'] for l in self.raw_data
)))
all_folders = set(l['folder'] for l in self.raw_data)
self.folders = sorted(list(all_folders), key=lambda x: x.lower())
async def update_preview_url(self, file_path: str, preview_url: str) -> bool:
"""Update preview_url for a specific lora in all cached data