Skip to content

Commit 07b00e5

Browse files
committed
get assets list
1 parent d2b3ec7 commit 07b00e5

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

backend/app/api/frames.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,14 @@ async def api_frame_get_assets(id: int, db: Session = Depends(get_db), redis: Re
207207

208208
assets = []
209209
for line in output:
210-
parts = line.split(' ', 2)
211-
size, mtime, path = parts
212-
assets.append({
213-
'path': path.strip(),
214-
'size': int(size.strip()),
215-
'mtime': int(mtime.strip()),
216-
})
210+
if line.strip():
211+
parts = line.split(' ', 2)
212+
size, mtime, path = parts
213+
assets.append({
214+
'path': path.strip(),
215+
'size': int(size.strip()),
216+
'mtime': int(mtime.strip()),
217+
})
217218

218219
assets.sort(key=lambda x: x['path'])
219220
return {"assets": assets}

backend/app/utils/ssh_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async def exec_command(db, redis, frame, ssh, command: str,
120120
# (We only store stdout in `output`, but you can also append stderr if desired.)
121121
if output is not None:
122122
stdout_data = "".join(stdout_buffer)
123-
output.append(stdout_data)
123+
output.extend(stdout_data.split("\n"))
124124

125125
# Handle non-zero exit
126126
if exit_status != 0:

0 commit comments

Comments
 (0)