Skip to content

Commit 3ccc17a

Browse files
refactor: video job status refresh logic
1 parent 30d6bf5 commit 3ccc17a

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

packages/client/src/video/video.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,18 @@ class JobStatus {
7272
* Update status details for a video processing job.
7373
*/
7474
async refresh(options?: RPCOptions) {
75-
const res = await this.client.get('app.bsky.video.getJobStatus', {
76-
params: { jobId: this.jobId },
77-
...options,
78-
});
75+
const res = await this.client
76+
.get('app.bsky.video.getJobStatus', {
77+
params: { jobId: this.jobId },
78+
...options,
79+
})
80+
.then((res) => res.data.jobStatus);
7981

80-
this.state = res.data.jobStatus.state;
82+
this.state = res.state;
8183

82-
this.progress = res.data.jobStatus.progress;
83-
this.blob = res.data.jobStatus.blob;
84-
this.error = res.data.jobStatus.error;
85-
this.message = res.data.jobStatus.message;
84+
this.progress = res.progress;
85+
this.blob = res.blob;
86+
this.error = res.error;
87+
this.message = res.message;
8688
}
8789
}

0 commit comments

Comments
 (0)