mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-14 15:52:18 +00:00
2023.10.4.0
YT: file name is missing when destination is changed by selecting one of the saved locations; missing files still appear in the list API.UserDataBase: hide 'OperationCanceledException' and 'ObjectDisposedException' API.Reddit: unable to save settings without OAuth data TDownloader: 'ReconfPool' MainFrame: replace 'DownloadQueue.FormShow' with 'ShowDownloadQueueForm' SettingsHost: add a notification if the user has disabled downloading from the site
This commit is contained in:
@@ -433,6 +433,27 @@ Namespace API.YouTube.Controls
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Footer"
|
||||
Private _FilePathBeforeItemChange As SFile = Nothing
|
||||
Private Sub TXT_FILE_ActionSelectedItemBeforeChanged(ByVal Sender As Object, ByVal e As EventArgs, ByVal Item As ListViewItem) Handles TXT_FILE.ActionSelectedItemBeforeChanged
|
||||
If Not TXT_FILE.Text.IsEmptyString Then _FilePathBeforeItemChange = TXT_FILE.Text Else _FilePathBeforeItemChange = Nothing
|
||||
End Sub
|
||||
Private Sub TXT_FILE_ActionSelectedItemChanged(ByVal Sender As Object, ByVal e As EventArgs, ByVal Item As ListViewItem) Handles TXT_FILE.ActionSelectedItemChanged
|
||||
Try
|
||||
If Not MyContainer.HasElements Then
|
||||
Dim currentPath As SFile = _FilePathBeforeItemChange
|
||||
Dim newPath As SFile = TXT_FILE.Text.CSFileP
|
||||
If Not currentPath.File.IsEmptyString Then
|
||||
newPath.Name = currentPath.Name
|
||||
newPath.Extension = currentPath.Extension
|
||||
TXT_FILE.Text = newPath
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[API.YouTube.Controls.VideoOptionsForm.ChangeDestinationPath]")
|
||||
Finally
|
||||
_FilePathBeforeItemChange = Nothing
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub BTT_BROWSE_MouseDown(sender As Object, e As MouseEventArgs) Handles BTT_BROWSE.MouseDown
|
||||
Dim f As SFile
|
||||
#Disable Warning BC40000
|
||||
|
||||
@@ -1060,7 +1060,11 @@ Namespace API.YouTube.Objects
|
||||
If fc.Exists(SFO.Path, False) AndAlso SFile.GetFiles(fc, "*.json",, EDP.ReturnValue).Count > 0 Then Parse(Nothing, fc, IsMusic)
|
||||
XMLPopulateData(Me, x)
|
||||
_MediaStateOnLoad = _MediaState
|
||||
If Me.MediaState = UMStates.Downloaded Then
|
||||
_Exists = File.Exists(IIf(ObjectType = YouTubeMediaType.Single, SFO.File, SFO.Path), False)
|
||||
Else
|
||||
_Exists = True
|
||||
End If
|
||||
If If(x(Name_CheckedElements)?.Count, 0) > 0 Then ApplyElementCheckedValue(x(Name_CheckedElements))
|
||||
If ArrayMaxResolution <> -10 Then SetMaxResolution(ArrayMaxResolution)
|
||||
End Using
|
||||
|
||||
@@ -1305,6 +1305,10 @@ BlockNullPicture:
|
||||
DownloadSingleObject_CreateMedia(Data, Token)
|
||||
DownloadSingleObject_Download(Data, Token)
|
||||
DownloadSingleObject_PostProcessing(Data)
|
||||
Catch oex As OperationCanceledException When Token.IsCancellationRequested
|
||||
Data.DownloadState = UserMediaStates.Missing
|
||||
ErrorsDescriber.Execute(EDP.SendToLog, oex, $"{Site} download canceled: {Data.URL}")
|
||||
Catch dex As ObjectDisposedException When Disposed
|
||||
Catch ex As Exception
|
||||
Data.DownloadState = UserMediaStates.Missing
|
||||
ErrorsDescriber.Execute(EDP.SendToLog, ex, $"{Site} single data downloader error: {Data.URL}")
|
||||
|
||||
@@ -238,7 +238,7 @@ Namespace API.Reddit
|
||||
For i% = 0 To p.Count - 1
|
||||
If CStr(p(i).Value).IsEmptyString Then wrong.Add(p(i).Name)
|
||||
Next
|
||||
If wrong.Count > 0 Then
|
||||
If wrong.Count > 0 And wrong.Count <> 4 Then
|
||||
MsgBoxE({$"You have not completed the following fields: {wrong.ListToString}." & vbCr &
|
||||
"To use OAuth authorization, all authorization fields must be filled in.", "Validate token fields"}, vbCritical)
|
||||
Return False
|
||||
|
||||
@@ -303,7 +303,8 @@ Namespace DownloadObjects
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Pool"
|
||||
Friend Sub ReconfPool()
|
||||
Friend Sub ReconfPool(Optional ByVal Round As Integer = 0)
|
||||
Try
|
||||
If Pool.Count = 0 OrElse Not Pool.Exists(Function(j) j.Working Or j.Count > 0) Then
|
||||
Dim i%
|
||||
Pool.ListClearDispose
|
||||
@@ -329,6 +330,13 @@ Namespace DownloadObjects
|
||||
End If
|
||||
RaiseEvent Reconfigured()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
If Round = 0 Then
|
||||
ReconfPool(Round + 1)
|
||||
Else
|
||||
Throw ex
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
#End Region
|
||||
#Region "Thread"
|
||||
|
||||
@@ -423,7 +423,19 @@ CloseResume:
|
||||
InfoForm.FormShow(EDP.LogMessageValue)
|
||||
End Sub
|
||||
Private Sub MENU_INFO_SHOW_QUEUE_Click(sender As Object, e As EventArgs) Handles MENU_INFO_SHOW_QUEUE.Click
|
||||
ShowDownloadQueueForm()
|
||||
End Sub
|
||||
Private Sub ShowDownloadQueueForm(Optional ByVal Round As Integer = 0)
|
||||
Try
|
||||
DownloadQueue.FormShow(EDP.LogMessageValue)
|
||||
Catch ex As Exception
|
||||
If Round = 0 Then
|
||||
If Not DownloadQueue Is Nothing Then DownloadQueue.Dispose() : DownloadQueue = Nothing
|
||||
ShowDownloadQueueForm(Round + 1)
|
||||
Else
|
||||
ErrorsDescriber.Execute(EDP.SendToLog, ex, "ShowDownloadQueueForm")
|
||||
End If
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub MENU_INFO_SHOW_MISSING_Click(sender As Object, e As EventArgs) Handles MENU_INFO_SHOW_MISSING.Click
|
||||
MyMissingPosts.FormShow(EDP.LogMessageValue)
|
||||
|
||||
@@ -331,6 +331,7 @@ Namespace Plugin.Hosts
|
||||
End If
|
||||
Return _AvailableValue
|
||||
Else
|
||||
If Not Silent Then MsgBoxE({$"Downloading data for the site {Name} has been disabled by you.", $"{Name} downloading disabled"}, vbExclamation)
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user