Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
修复:在抄写字幕界面选择字幕,可能会出现 IO 异常。
Browse files Browse the repository at this point in the history
  • Loading branch information
tangshimin committed Jan 20, 2023
1 parent 61bdb4a commit a204c9e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/main/kotlin/ui/TypingSubtitles.kt
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ fun TypingSubtitles(
}

} else {
JOptionPane.showMessageDialog(window, "视频地址错误")
JOptionPane.showMessageDialog(null,"视频地址错误:${file.absolutePath}\n" +
"可能原视频被移动、删除或者重命名了。")
}

}
Expand Down Expand Up @@ -384,16 +385,17 @@ fun TypingSubtitles(

/** 选择字幕轨道 */
val selectTypingSubTitles:() -> Unit = {
if (trackList.isEmpty()) {
val videoFile = File(subtitlesState.mediaPath)
if (trackList.isEmpty() && videoFile.exists()) {
loading = true
scope.launch {
showSelectTrack = true
Thread(Runnable{
parseTrackList(
mediaPlayerComponent,
window,
playerWindow,
subtitlesState.mediaPath,
mediaPlayerComponent = mediaPlayerComponent,
parentComponent = window,
playerWindow = playerWindow,
videoPath = subtitlesState.mediaPath,
setTrackList = {
setTrackList(it)
},
Expand All @@ -403,7 +405,9 @@ fun TypingSubtitles(
}).start()

}

}else if(!videoFile.exists()){
JOptionPane.showMessageDialog(null,"视频地址错误:${videoFile.absolutePath}\n" +
"可能原视频被移动、删除或者重命名了。")
}
}

Expand Down

0 comments on commit a204c9e

Please sign in to comment.