@@ -13,8 +13,8 @@ Public Class ItemPanel
1313 Public Selected As Boolean = False
1414 Public DownBegan As Boolean = False '다운로드를 한번이라도 시작을 했는지
1515 Public DownFinished As Boolean = False '다운로드를 완료한 상태인지
16+ Public progMode As String = "" '현재 프로그램의 모드 (downloading, pause, finished, error)
1617 Dim captionDownFinished As Boolean = False '자막 다운로드를 완료한 상태인지
17- Dim progMode As String = ""
1818
1919 Dim prevCBSelect() As Integer = {- 1 , - 1 } '비디오 info 리셋할때 콤보박스 선택을 보존하기 위해서
2020
@@ -168,6 +168,7 @@ Public Class ItemPanel
168168 ProgPanelOver.BackColor = MainPanel.BackColor
169169 ProgLabel1.Text = ""
170170 ProgLabel2.Text = ""
171+ PauseResumeBT.Visible = False
171172 End If
172173 End Sub
173174
@@ -320,14 +321,21 @@ Public Class ItemPanel
320321# Region "다운로드 작업"
321322
322323 Private Sub DownloadProgressChanged( ByVal sender As Object , ByVal e As FileDownloadProgressChangedEventArgs) Handles WC.DownloadProgressChanged
323- progMode = "downloading"
324- SetProgBar(e.ProgressPercentage.ToString _
325- + "% (" + FormatBytes(e.DownloadSpeedBytesPerSec) + "/s, " _
326- + FormatBytes(e.BytesReceived) + "/" + FormatBytes(e.TotalBytesToReceive) _
327- + ", " + DaysCalc(e.RemainingTimeSeconds) + " 남음)" )
328- progPercent = e.ProgressPercentage
329-
330- ProgPanelOver.Width = (e.ProgressPercentage / 100 ) * ProgPanel.Width
324+ If e.ProgressPercentage >= 0 Then
325+ progMode = "downloading"
326+ SetProgBar(e.ProgressPercentage.ToString _
327+ + "% (" + FormatBytes(e.DownloadSpeedBytesPerSec) + "/s, " _
328+ + FormatBytes(e.BytesReceived) + "/" + FormatBytes(e.TotalBytesToReceive) _
329+ + ", " + DaysCalc(e.RemainingTimeSeconds) + " 남음)" )
330+ progPercent = e.ProgressPercentage
331+
332+ ProgPanelOver.Width = (e.ProgressPercentage / 100 ) * ProgPanel.Width
333+ Else '다운로드 퍼센트값이 음수면 -> 비정상적인 다운로드
334+ WC.CancelAsync()
335+ progMode = "downloading"
336+ forceReset( True )
337+ SetProgBar( "다운로드를 재시작하는 중..." )
338+ End If
331339 End Sub
332340
333341 Public Sub StartDownload()
@@ -479,11 +487,13 @@ Public Class ItemPanel
479487 End Sub
480488
481489 Public Sub PauseDown()
490+ LogForm.addLog( "다운로드 일시정지 (" + Name + ")" )
482491 Paused = True
483492 WC.CancelAsync()
484493 End Sub
485494
486495 Public Sub ResumeDown()
496+ LogForm.addLog( "다운로드 재개 (" + Name + ")" )
487497 Try
488498 If Not WC.IsBusy Then '이미 바쁠때 (사용중일때) 가 아닐 때에만
489499 WC.ResumeAsync()
@@ -651,7 +661,6 @@ Public Class ItemPanel
651661 Catch ex As Exception
652662
653663 'MsgBox("오류 발생:" + vbCr + ex.Message, vbCritical)
654-
655664 LogForm.addLog( "비디오인포 수집 중 오류 발생. (" + Me .Name + ")" )
656665 End Try
657666
0 commit comments