fix 2nd item

fix for add the second item as double entry if the first one was canceled
This commit is contained in:
hama3254 2019-11-22 18:36:51 +01:00
parent 76361b266b
commit 38e0180dc3
10 changed files with 63 additions and 44 deletions

Binary file not shown.

View File

@ -205,6 +205,18 @@ Public Class Main
End Sub
Public Sub ListAdd(ByVal NameKomplett As String, ByVal NameP1 As String, ByVal NameP2 As String, ByVal Reso As String, ByVal HardSub As String, ByVal SoftSubs As String, ByVal ThumbnialURL As String, ByVal VideoURL As String)
Dim ReDl As Boolean = False
Dim index As Integer = 0
For i As Integer = 0 To PB_list.Count - 1
If PB_list.Item(i).Name = NameKomplett Then
ReDl = True
index = i
End If
Next
If ReDl = True Then
Dim PB As PictureBox = bt_dl.Item(index)
PB.Enabled = True
Else
Dim b As New Bitmap(838, 142, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
Dim g As Graphics = Graphics.FromImage(b)
Dim ZeroPoint As Point = New Point(0, 0)
@ -248,6 +260,7 @@ Public Class Main
LVPictureBox(ListView1, gIndexH, b, "Softsubs: " + SoftSubs, NameKomplett)
bt_del(ListView1, gIndexH, NameKomplett)
End With
End If
End Sub
Public Function bt_del(ByVal pListView As ListView, ByVal ItemIndex As Integer, ByVal NameKomplett As String) As PictureBox
@ -673,7 +686,7 @@ Public Class Main
CR_Anime_Folge = CR_Name_Staffel0_Folge1(1).Trim()
CR_Anime_Folge = System.Text.RegularExpressions.Regex.Replace(CR_Anime_Folge, "[^\w\\-]", " ")
Else
CR_Anime_Staffel = ""
CR_Anime_Staffel = Nothing
CR_Anime_Folge = CR_Name_2(0).Trim()
CR_Anime_Folge = System.Text.RegularExpressions.Regex.Replace(CR_Anime_Folge, "[^\w\\-]", " ")
End If
@ -941,8 +954,13 @@ Public Class Main
ResoHTMLDisplay = ResoHTML(0) + "p"
End If
End If
Dim L2Name As String = CR_Anime_Staffel + " " + CR_Anime_Folge
If CR_Anime_Staffel = Nothing Then
L2Name = CR_Anime_Folge
End If
Me.Invoke(New Action(Function()
ListAdd(CR_FilenName, CR_Anime_Titel, CR_Anime_Staffel + " " + CR_Anime_Folge, ResoHTMLDisplay, Subsprache3, SubValuesToDisplay(), thumbnail3, URL_DL)
ListAdd(CR_FilenName, CR_Anime_Titel, L2Name, ResoHTMLDisplay, Subsprache3, SubValuesToDisplay(), thumbnail3, URL_DL)
Return Nothing
End Function))
' liList.Add(My.Resources.htmlvorThumbnail + thumbnail3 + My.Resources.htmlnachTumbnail + CR_Anime_Titel + " <br> " + CR_Anime_Staffel + " " + CR_Anime_Folge + My.Resources.htmlvorAufloesung + ResoHTMLDisplay + My.Resources.htmlvorSoftSubs + vbNewLine + SubValuesToDisplay() + My.Resources.htmlvorHardSubs + Subsprache3 + My.Resources.htmlnachHardSubs + "<!-- " + CR_FilenName + "-->")
@ -1126,6 +1144,7 @@ Public Class Main
Dim brGradient As Brush = New SolidBrush(Color.FromArgb(125, 0, 0))
g.FillRectangle(brGradient, ProgressbarPoint.X + 1, ProgressbarPoint.Y + 1, 600, 19)
g.Dispose()
AbourtList.Remove(sender)
Else
Dim p As PictureBox = PB_list(i)
Dim c As Integer = CInt(ListView1.Items.Item(i).Text)