From e3da1bf1d307b566b3a1bea65de73f1656479d5d Mon Sep 17 00:00:00 2001 From: Andy <88590076+AAndyProgram@users.noreply.github.com> Date: Thu, 21 Dec 2023 10:01:30 +0300 Subject: [PATCH] 2023.12.21.0 Update 'new log data' notification Feed: improve last session loading --- SCrawler/Download/Feed/DownloadFeedForm.vb | 28 +++++++++++++--------- SCrawler/MainFrame.vb | 5 +--- SCrawler/MainFrameObjects.vb | 7 ++++++ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/SCrawler/Download/Feed/DownloadFeedForm.vb b/SCrawler/Download/Feed/DownloadFeedForm.vb index e6e5a11..c67a644 100644 --- a/SCrawler/Download/Feed/DownloadFeedForm.vb +++ b/SCrawler/Download/Feed/DownloadFeedForm.vb @@ -318,7 +318,7 @@ Namespace DownloadObjects Return False End If End Function - If Not GetLast Then __getFiles.Invoke + __getFiles.Invoke If Not GetLast And GetFilesOnly And Not fList.ListExists Then MsgBoxE({"No session files found", "Get session files"}, vbExclamation) ElseIf Not GetLast AndAlso fList.ListExists Then @@ -352,18 +352,24 @@ Namespace DownloadObjects MsgBoxE(m) End If End Using - ElseIf Downloader.FilesSessionActual(False).Exists OrElse __getFiles.Invoke Then - If Downloader.FilesSessionActual(False).Exists Then - f = Downloader.FilesSessionActual(False) + ElseIf Downloader.FilesSessionActual(False).Exists OrElse fList.ListExists Then + If GetLast Then + If fList.ListExists Then + f = fList(IIf(fList.Count > 1 And Downloader.FilesSessionActual(False).Exists, 1, 0)) + Else + f = Downloader.FilesSessionActual(False) + End If Else - f = fList(0) + f = Downloader.FilesSessionActual(False) + End If + If f.Exists Then + x = New XmlFile(f,, False) With {.AllowSameNames = True, .XmlReadOnly = True} + x.LoadData() + If x.Count > 0 Then DataList.Clear() : DataList.ListAddList(x, lcr) + x.Dispose() + CleanDataList() + RefillList(False) End If - x = New XmlFile(f,, False) With {.AllowSameNames = True, .XmlReadOnly = True} - x.LoadData() - If x.Count > 0 Then DataList.Clear() : DataList.ListAddList(x, lcr) - x.Dispose() - CleanDataList() - RefillList(False) Else m.Text = "Saved sessions not found" MsgBoxE(m) diff --git a/SCrawler/MainFrame.vb b/SCrawler/MainFrame.vb index 1d03b32..8c30f98 100644 --- a/SCrawler/MainFrame.vb +++ b/SCrawler/MainFrame.vb @@ -842,10 +842,7 @@ CloseResume: #End Region #End Region Private Sub BTT_LOG_Click(sender As Object, e As EventArgs) Handles BTT_LOG.Click - MyMainLOG_ShowForm(Settings.Design,,,, Sub() - MainFrameObj.UpdateLogButton() - MainFrameObj.LogFormClosed() - End Sub) + MainFrameObj.ShowLog() End Sub Private Sub BTT_VERSION_INFO_Click(sender As Object, e As EventArgs) Handles BTT_VERSION_INFO.Click CheckVersion(True) diff --git a/SCrawler/MainFrameObjects.vb b/SCrawler/MainFrameObjects.vb index 5a7885b..242e17f 100644 --- a/SCrawler/MainFrameObjects.vb +++ b/SCrawler/MainFrameObjects.vb @@ -70,6 +70,12 @@ Friend Class MainFrameObjects : Implements INotificator Friend Function GetUserListProvider(ByVal WithCollections As Boolean) As IFormatProvider Return MF.GetUserListProvider(WithCollections) End Function + Friend Sub ShowLog() + MyMainLOG_ShowForm(Settings.Design,,,, Sub() + UpdateLogButton() + LogFormClosed() + End Sub) + End Sub #End Region #Region "Notifications" Private Sub INotificator_ShowNotification(ByVal Text As String, ByVal Image As SFile) Implements INotificator.ShowNotification @@ -93,6 +99,7 @@ Friend Class MainFrameObjects : Implements INotificator Case $"{NotificationInternalKey}_{NotifyObj.Channels}" : MF.MyChannels.FormShowS() Case $"{NotificationInternalKey}_{NotifyObj.SavedPosts}" : MF.MySavedPosts.FormShowS() Case $"{NotificationInternalKey}_{NotifyObj.STDownloader}" : VideoDownloader.FormShowS() + Case $"{NotificationInternalKey}_{NotifyObj.LOG}" : ShowLog() Case Else : Focus(True) End Select ElseIf Settings.Automation Is Nothing OrElse Not Settings.Automation.NotificationClicked(Key, found, activateForm) Then