Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
added hidden queue
Browse files Browse the repository at this point in the history
added hidden queue #948
  • Loading branch information
hama3254 committed May 11, 2024
1 parent 536c0b3 commit c9e85c5
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 35 deletions.
Binary file modified .vs/Crunchyroll Downloader/v17/.suo
Binary file not shown.
13 changes: 12 additions & 1 deletion Crunchyroll Downloader/Anime_Add.vb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ Public Class Anime_Add

Private Sub Anime_Add_Load(sender As Object, e As EventArgs) Handles MyBase.Load

If My.Settings.HiddenQueue = True Then
Queue.Show()
End If

If Main.Mail = Nothing And My.Settings.Mail = "na" Then
'Dim Login As Form = LoginForm
'Login.StartPosition = 0
Expand Down Expand Up @@ -224,12 +228,19 @@ Public Class Anime_Add
' ' pictureBox4.Enabled = True
'Else
If Main.RunningQueue = True Then
If CBool(InStr(textBox1.Text, "series/")) Then
If CBool(InStr(textBox1.Text, "series/")) And My.Settings.HiddenQueue = False Then
Debug.WriteLine("Queue_Block_series")
'textBox1.Text = "URL"
StatusLabel.Text = "Status: Series add blocked, queue is running!"
Pause(5)
StatusLabel.Text = "Status: Idle"
ElseIf CBool(InStr(textBox1.Text, "series/")) And My.Settings.HiddenQueue = True Then
Debug.WriteLine("Queue_adding_series")
'textBox1.Text = "URL"
StatusLabel.Text = "Status: Series added to queue."
'Pause(5)
'StatusLabel.Text = "Status: Idle"
Main.LoadBrowser(textBox1.Text)
Else
Debug.WriteLine("Queue_Block")
Main.ListBoxList.Add(textBox1.Text)
Expand Down
3 changes: 3 additions & 0 deletions Crunchyroll Downloader/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@
<setting name="PW" serializeAs="String">
<value>na</value>
</setting>
<setting name="HiddenQueue" serializeAs="String">
<value>False</value>
</setting>
</Crunchyroll_Downloader.My.MySettings>
</userSettings>
</configuration>
2 changes: 1 addition & 1 deletion Crunchyroll Downloader/Browser.vb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Public Class Browser

If Main.UserBowser = False Then
Me.Location = New Point(-10000, 10000)
Timer1.Enabled = True
'Timer1.Enabled = True
End If
WebView2.Source = New Uri(Main.Startseite)
End Sub
Expand Down
36 changes: 24 additions & 12 deletions Crunchyroll Downloader/Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ Public Class Main
Public MergeSubsFormat As String = "mov_text"
Public DlSoftSubsRDY As Boolean = True
Public DialogTaskString As String
Dim NewAPIString1 As String
Dim NewAPIString2 As String
'Dim NewAPIString1 As String
'Dim NewAPIString2 As String


Dim TTL As Integer = 0
'Public ErrorBrowserBackString As String
Public RunningQueue As Boolean = False
Expand Down Expand Up @@ -128,7 +130,9 @@ Public Class Main
Public WebbrowserText As String = Nothing
Public WebbrowserTitle As String = Nothing
Public WebbrowserCookie As String = Nothing
Public UserQueue As Boolean = False
Public UserBowser As Boolean = False

Public BowserWasOpen As Boolean = False
Public HybridMode As Boolean = False

Expand Down Expand Up @@ -735,7 +739,7 @@ Public Class Main
Catch ex As Exception
RunningDownloads = Panel1.Controls.Count
End Try
If RunningDownloads < MaxDL Then
If RunningDownloads < MaxDL Or My.Settings.HiddenQueue = True Then
Exit For
Else
'MsgBox(e)
Expand Down Expand Up @@ -2874,20 +2878,28 @@ Public Class Main
End Sub

Private Sub Btn_Queue_Click(sender As Object, e As EventArgs) Handles Btn_Queue.Click
If File.Exists("cookies.txt") = False Then
If Application.OpenForms().OfType(Of Browser).Any = True Then
Else
UserBowser = False
Browser.Show()
End If
End If

If Queue.WindowState = System.Windows.Forms.FormWindowState.Minimized Then
Queue.WindowState = System.Windows.Forms.FormWindowState.Normal
UserQueue = True
If Application.OpenForms().OfType(Of Queue).Any = True Then
Queue.Location = New Point(CInt(Me.Location.X + Me.Width / 2 - Queue.Width / 2), CInt(Me.Location.Y + Me.Height / 2 - Queue.Height / 2))
If Queue.WindowState = System.Windows.Forms.FormWindowState.Minimized Then
Queue.WindowState = System.Windows.Forms.FormWindowState.Normal
Queue.ShowInTaskbar = True
End If
Else
Queue.Location = New Point(CInt(Me.Location.X + Me.Width / 2 - Queue.Width / 2), CInt(Me.Location.Y + Me.Height / 2 - Queue.Height / 2))
Queue.Show()
End If

Try
Dim hwnd As IntPtr = FindWindow(Nothing, Queue.Text)
SetForegroundWindow(hwnd)
Catch ex As Exception
Debug.WriteLine("Queue foreground failure")
End Try



End Sub


Expand Down
4 changes: 2 additions & 2 deletions Crunchyroll Downloader/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("3.23.3")>
<Assembly: AssemblyFileVersion("3.23.3")>
<Assembly: AssemblyVersion("3.23.2")>
<Assembly: AssemblyFileVersion("3.23.2")>
<Assembly: NeutralResourcesLanguage("en")>
12 changes: 12 additions & 0 deletions Crunchyroll Downloader/My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Crunchyroll Downloader/My Project/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,8 @@
<Setting Name="PW" Type="System.String" Scope="User">
<Value Profile="(Default)">na</Value>
</Setting>
<Setting Name="HiddenQueue" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
34 changes: 24 additions & 10 deletions Crunchyroll Downloader/einstellungen.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 18 additions & 7 deletions Crunchyroll Downloader/einstellungen.vb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Public Class Einstellungen
Public CR_SoftSubsTemp As New List(Of String)
Dim TempCheckSubMod1 As Boolean = False
Dim TempVTTStyle As Boolean = False
Dim TempMultiDL As Boolean = False

Private Sub Einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Expand All @@ -34,6 +35,8 @@ Public Class Einstellungen
Manager.Owner = Me
Me.StyleManager = Manager

CB_HideQueue.Checked = My.Settings.HiddenQueue

CB_OverrideDub.Checked = My.Settings.OverrideDub
CB_Cap.Checked = My.Settings.Captions

Expand Down Expand Up @@ -545,14 +548,10 @@ Public Class Einstellungen
Main.ErrorTolerance = CInt(NumericUpDown2.Value)
My.Settings.ErrorTolerance = Main.ErrorTolerance

If ListViewAdd_True.Checked = True Then
Main.UseQueue = True
My.Settings.QueueMode = Main.UseQueue
ElseIf ListViewAdd_True.Checked = False Then
Main.UseQueue = False
My.Settings.QueueMode = Main.UseQueue
End If
Main.UseQueue = ListViewAdd_True.Checked
My.Settings.QueueMode = Main.UseQueue

My.Settings.HiddenQueue = CB_HideQueue.Checked

Main.SoftSubs.Clear()
Main.SoftSubs.AddRange(CR_SoftSubsTemp)
Expand Down Expand Up @@ -967,6 +966,18 @@ Public Class Einstellungen
End If
End Sub

Private Sub CB_HideQueue_CheckedChanged(sender As Object, e As EventArgs) Handles CB_HideQueue.CheckedChanged
If CB_HideQueue.Checked = True Then
TempMultiDL = ListViewAdd_True.Checked
ListViewAdd_True.Checked = True
ListViewAdd_True.Enabled = False

Else
ListViewAdd_True.Checked = TempMultiDL
ListViewAdd_True.Enabled = True
End If
End Sub




Expand Down
11 changes: 9 additions & 2 deletions Crunchyroll Downloader/queue.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ Public Class Queue
ListBox1.ForeColor = Main.ForeColorValue
bs.DataSource = Main.ListBoxList
ListBox1.DataSource = bs

Me.Icon = My.Resources.icon
Btn_min.Image = Main.MinImg
Btn_Close.Image = Main.CloseImg

Me.StartPosition = 0
If Main.UserQueue = False Then
Me.Location = New Point(-10000, -10000)
'Me.ShowInTaskbar = False
'Me.WindowState = System.Windows.Forms.FormWindowState.Minimized
RunQueue.Checked = True
End If
End Sub


Private Sub Btn_Close_Click(sender As Object, e As EventArgs) Handles Btn_Close.Click
Main.UserQueue = False
Me.Close()
End Sub

Expand All @@ -44,7 +52,6 @@ Public Class Queue
If Main.ListBoxList.Count <> ListBox1.Items.Count Then
bs.ResetBindings(False)
End If

End Sub

Private Sub Queue_Resize(sender As Object, e As EventArgs) Handles Me.Resize
Expand Down

0 comments on commit c9e85c5

Please sign in to comment.