fix windows path

This commit is contained in:
LE Quoc Dat 2025-04-18 17:02:22 +01:00
parent 17e3e0e68c
commit 5bb5300afe
1 changed files with 3 additions and 1 deletions

View File

@ -151,9 +151,11 @@ async def list_files(
for file in files: for file in files:
# Convert file information to our model # Convert file information to our model
# Ensure forward slashes are used for paths, regardless of OS
full_path = f"{path.rstrip('/')}/{file.name}" if path != '/' else f"/{file.name}"
file_info = FileInfo( file_info = FileInfo(
name=file.name, name=file.name,
path=os.path.join(path, file.name), path=full_path, # Use the constructed path
is_dir=file.is_dir, is_dir=file.is_dir,
size=file.size, size=file.size,
mod_time=str(file.mod_time), mod_time=str(file.mod_time),