Refactor and optimize code for improved readability and maintainability

This commit is contained in:
Will Miao
2025-01-31 16:32:37 +08:00
parent 86b9715ef4
commit 0e708e6583
8 changed files with 428 additions and 383 deletions

View File

@@ -28,7 +28,7 @@ def _find_preview_file(base_name: str, dir_path: str) -> str:
for pattern in preview_patterns:
full_pattern = os.path.join(dir_path, pattern)
if os.path.exists(full_pattern):
return full_pattern.replace("\\", "/")
return full_pattern.replace(os.sep, "/")
return ""
async def get_file_info(file_path: str) -> LoraMetadata: