Skip to content

Commit 1b23256

Browse files
committed
chore: housekeeping
1 parent d90465e commit 1b23256

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/utils/UgoiraPlayer.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ export class UgoiraPlayer {
4343
public options: UgoiraPlayerOptions = {}
4444
) {
4545
this.reset(illust)
46-
if (options) {
47-
this.options = options
48-
}
4946
}
5047
reset(illust: Artwork) {
5148
this.destroy()
@@ -184,7 +181,7 @@ export class UgoiraPlayer {
184181
})
185182

186183
// 2. 根据 UgoiraMeta 的 frame 信息,依次下载文件
187-
const frames = this._meta!.frames
184+
const { frames } = this._meta!
188185
const totalFrames = frames.length
189186

190187
for (let i = 0; i < totalFrames; i++) {
@@ -220,7 +217,9 @@ export class UgoiraPlayer {
220217
await this.handleFrameRender(i, frame, frameDownloadTime)
221218
} catch (error) {
222219
console.error(`[UgoiraPlayer] 帧 ${i + 1} 下载失败:`, error)
223-
throw new Error(`Failed to download frame ${i + 1}: ${frame.file}`)
220+
throw new Error(`Failed to download frame ${i + 1}: ${frame.file}`, {
221+
cause: error,
222+
})
224223
}
225224
}
226225

0 commit comments

Comments
 (0)