fix clean up after canceling

fix clean up after canceling #532
This commit is contained in:
hama3254 2022-10-01 12:47:02 +02:00
parent 4ca14961ba
commit 7e3eecb3ca
6 changed files with 47 additions and 5 deletions

Binary file not shown.

View File

@ -345,7 +345,7 @@ Public Class Anime_Add
Main.SubsOnly = True
End If
If groupBox1.Visible = True Then
' Main.LoadedUrls.Clear()
Try
If CBool(InStr(textBox1.Text, "crunchyroll.com")) Or CBool(InStr(textBox1.Text, "funimation.com")) Or CBool(InStr(textBox1.Text, "vrv.co/series/")) Or CBool(InStr(textBox1.Text, "vrv.co/watch/")) Then

View File

@ -34,6 +34,8 @@ Public Class CefSharp_Browser
Me.Invoke(New Action(Function() As Object
Main.LoadedUrls.Clear()
Debug.WriteLine("FrameLoadEnd" + Date.Now.ToString)
Main.WebbrowserURL = WebBrowser1.Address
TextBox1.Text = Main.WebbrowserURL
@ -166,7 +168,19 @@ Public Class CefSharp_Browser
End Sub
Private Sub WebBrowser1_DocumentTitleChanged(sender As Object, e As TitleChangedEventArgs) Handles WebBrowser1.TitleChanged
DocumentTitle = e.Title
If (Me.InvokeRequired) Then
Me.Invoke(Sub()
DocumentTitle = e.Title
Me.Text = "Browser - " + e.Title
End Sub)
Else
DocumentTitle = e.Title
Me.Text = "Browser - " + e.Title
End If
Try
TextBox1.Text = WebBrowser1.Address
Catch ex As Exception

View File

@ -50,6 +50,7 @@ Partial Class Main
Me.AddonHTMLToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.Timer3OffToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ThreadCount = New System.Windows.Forms.ToolStripMenuItem()
Me.MsgBoxToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox6, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.MetroStyleManager1, System.ComponentModel.ISupportInitialize).BeginInit()
@ -183,7 +184,7 @@ Partial Class Main
'
'ContextMenuStrip1
'
Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.TestDownloadToolStripMenuItem, Me.CheckCRBetaTokenToolStripMenuItem, Me.AddonHTMLToolStripMenuItem, Me.Timer3OffToolStripMenuItem, Me.ThreadCount})
Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToggleDebugModeToolStripMenuItem, Me.OpenSettingsToolStripMenuItem, Me.TestDownloadToolStripMenuItem, Me.CheckCRBetaTokenToolStripMenuItem, Me.AddonHTMLToolStripMenuItem, Me.Timer3OffToolStripMenuItem, Me.ThreadCount, Me.MsgBoxToolStripMenuItem})
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
resources.ApplyResources(Me.ContextMenuStrip1, "ContextMenuStrip1")
'
@ -222,6 +223,11 @@ Partial Class Main
Me.ThreadCount.Name = "ThreadCount"
resources.ApplyResources(Me.ThreadCount, "ThreadCount")
'
'MsgBoxToolStripMenuItem
'
Me.MsgBoxToolStripMenuItem.Name = "MsgBoxToolStripMenuItem"
resources.ApplyResources(Me.MsgBoxToolStripMenuItem, "MsgBoxToolStripMenuItem")
'
'Main
'
Me.ApplyImageInvert = True
@ -277,4 +283,5 @@ Partial Class Main
Friend WithEvents AddonHTMLToolStripMenuItem As ToolStripMenuItem
Friend WithEvents Timer3OffToolStripMenuItem As ToolStripMenuItem
Friend WithEvents ThreadCount As ToolStripMenuItem
Friend WithEvents MsgBoxToolStripMenuItem As ToolStripMenuItem
End Class

View File

@ -528,6 +528,12 @@
<data name="&gt;&gt;ThreadCount.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;MsgBoxToolStripMenuItem.Name" xml:space="preserve">
<value>MsgBoxToolStripMenuItem</value>
</data>
<data name="&gt;&gt;MsgBoxToolStripMenuItem.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>Main</value>
</data>
@ -585,8 +591,14 @@
<data name="ThreadCount.Text" xml:space="preserve">
<value>set hybrid-mode thread count</value>
</data>
<data name="MsgBoxToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>233, 22</value>
</data>
<data name="MsgBoxToolStripMenuItem.Text" xml:space="preserve">
<value>MsgBox(LoadedUrls)</value>
</data>
<data name="ContextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>234, 180</value>
<value>234, 202</value>
</data>
<data name="&gt;&gt;ContextMenuStrip1.Name" xml:space="preserve">
<value>ContextMenuStrip1</value>

View File

@ -4582,7 +4582,9 @@ Public Class Main
Anime_Add.StatusLabel.Text = "Status: idle"
End If
Me.Text = "Crunchyroll Downloader"
Grapp_RDY = True
Exit Sub
LoadedUrls.Clear()
End If
If Application.OpenForms().OfType(Of CefSharp_Browser).Any = True Then
@ -4757,7 +4759,7 @@ Public Class Main
#End Region
Public Sub ProcessUrls()
Debug.WriteLine(LoadedUrls.Count.ToString)
Debug.WriteLine("Thread Name: " + Thread.CurrentThread.Name)
Debug.WriteLine(Date.Now.ToString + " Thread Name: " + Thread.CurrentThread.Name)
Dim VRVSeason As String = Nothing
For i As Integer = 0 To LoadedUrls.Count - 1
Dim requesturl As String = LoadedUrls.Item(i)
@ -5527,6 +5529,13 @@ Public Class Main
Trackbar.ShowDialog()
End Sub
Private Sub MsgBoxToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MsgBoxToolStripMenuItem.Click
MsgBox(LoadedUrls.Count.ToString)
For i As Integer = 0 To LoadedUrls.Count - 1
MsgBox(LoadedUrls(i))
Next
End Sub