From db9e2cfb887e8c4b6d34b2b543c5de736651fcdf Mon Sep 17 00:00:00 2001 From: Andy <88590076+AAndyProgram@users.noreply.github.com> Date: Sun, 5 Mar 2023 06:12:08 +0300 Subject: [PATCH] 2023.3.5.0 Fixed SavedPosts new file naming method Fixed Twitter MD5 comparison error Fixed ffmpeg file parts concatenation algorithm --- Changelog.md | 9 +++++++++ SCrawler/API/Base/UserDataBase.vb | 1 + SCrawler/API/BaseObjects/DomainEnvir.vb | 4 ++-- SCrawler/API/Twitter/UserData.vb | 5 +++-- SCrawler/Download/Groups/GroupDefaults.vb | 6 +++--- SCrawler/ListImagesLoader.vb | 2 +- SCrawler/My Project/AssemblyInfo.vb | 4 ++-- SCrawler/SettingsCLS.vb | 9 +++------ SCrawler/UserFinder.vb | 2 +- 9 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Changelog.md b/Changelog.md index 2820ecb..7692a25 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,12 @@ +# 2023.3.5.0 + +*2023-03-05* + +- Fixed + - A bug in the new way of naming `SavedPosts` data files. + - An error that could occur during Twitter MD5 comparison. + - A bug in the ffmpeg file parts concatenation algorithm that could occur in some cases. + # 2023.3.1.0 *2023-03-01* diff --git a/SCrawler/API/Base/UserDataBase.vb b/SCrawler/API/Base/UserDataBase.vb index da557d4..2358142 100644 --- a/SCrawler/API/Base/UserDataBase.vb +++ b/SCrawler/API/Base/UserDataBase.vb @@ -1046,6 +1046,7 @@ BlockNullPicture: u.UpdateUserFile() Dim mfp As SFile = u.File mfp.Name &= "_Posts" + mfp.Extension = "txt" If (ValidateContetnt AndAlso mfp.Exists) Or (Not ValidateContetnt AndAlso u.File.Exists) Or ForceSaved Then MyFileSettings = u.File End If If MyFileSettings.IsEmptyString Then MyFileSettings = User.File diff --git a/SCrawler/API/BaseObjects/DomainEnvir.vb b/SCrawler/API/BaseObjects/DomainEnvir.vb index 1dc66c6..8df1ee5 100644 --- a/SCrawler/API/BaseObjects/DomainEnvir.vb +++ b/SCrawler/API/BaseObjects/DomainEnvir.vb @@ -58,9 +58,9 @@ Namespace API.BaseObjects s.DomainsChanged = False End Sub Friend Shared Sub OpenSettingsForm(ByVal s As IDomainContainer) - Dim __add As EventHandler(Of SimpleListFormEventArgs) = Sub(sender, e) e.ValueNew = InputBoxE($"Enter a new domain using the pattern [{s.Site}.com]:", "New domain").IfNullOrEmptyE(Nothing) + Dim __add As EventHandler(Of SimpleListFormEventArgs) = Sub(sender, e) e.Item = InputBoxE($"Enter a new domain using the pattern [{s.Site}.com]:", "New domain").IfNullOrEmptyE(Nothing) Dim __delete As EventHandler(Of SimpleListFormEventArgs) = Sub(sender, e) - Dim n$ = AConvert(Of String)(e.ValueCurrent, AModes.Var, String.Empty) + Dim n$ = AConvert(Of String)(e.Item, AModes.Var, String.Empty) e.Result = MsgBoxE({$"Are you sure you want to delete the [{n}] domain?", "Removing domains"}, vbYesNo) = vbYes End Sub diff --git a/SCrawler/API/Twitter/UserData.vb b/SCrawler/API/Twitter/UserData.vb index 0557d44..855bf6c 100644 --- a/SCrawler/API/Twitter/UserData.vb +++ b/SCrawler/API/Twitter/UserData.vb @@ -394,7 +394,7 @@ Namespace API.Twitter h = __getMD5(New UserMedia With {.File = existingFiles(i)}, False) If Not h.IsEmptyString Then If hashList.ContainsKey(h) Then - MyMainLOG = $"[{ToStringForLog()}]: Removed image [{existingFiles(i).File}] (duplicate of [{hashList(h).File}])" + MyMainLOG = $"{ToStringForLog()}: Removed image [{existingFiles(i).File}] (duplicate of [{hashList(h).File}])" existingFiles(i).Delete(SFO.File, SFODelete.DeleteToRecycleBin, ErrMD5) existingFiles.RemoveAt(i) Else @@ -437,7 +437,8 @@ Namespace API.Twitter If _ContentList.Count > 0 Then With _ContentList.Select(Function(d) d.MD5) - If .ListExists Then .ToList.ForEach(Sub(md5value) If Not hashList.ContainsKey(md5value) Then hashList.Add(md5value, New SFile)) + If .ListExists Then .ToList.ForEach(Sub(md5value) _ + If Not md5value.IsEmptyString AndAlso Not hashList.ContainsKey(md5value) Then hashList.Add(md5value, New SFile)) End With End If diff --git a/SCrawler/Download/Groups/GroupDefaults.vb b/SCrawler/Download/Groups/GroupDefaults.vb index b8a8bcd..5953230 100644 --- a/SCrawler/Download/Groups/GroupDefaults.vb +++ b/SCrawler/Download/Groups/GroupDefaults.vb @@ -117,7 +117,7 @@ Namespace DownloadObjects.Groups Select Case Sender.DefaultButton Case ADB.Edit, ADB.Delete With If(Sender.DefaultButton = ADB.Edit, Labels, LabelsExcluded) - Using f As New LabelsForm(.ListSelf, True) + Using f As New LabelsForm(.Self, True) If Sender.DefaultButton = ADB.Delete Then f.Text &= " excluded" f.ShowDialog() If f.DialogResult = DialogResult.OK Then @@ -133,11 +133,11 @@ Namespace DownloadObjects.Groups Select Case Sender.DefaultButton Case ADB.Edit, ADB.Delete With If(Sender.DefaultButton = ADB.Edit, Sites, SitesExcluded) - Using f As New Editors.SiteSelectionForm(.ListSelf) + Using f As New Editors.SiteSelectionForm(.Self) If Sender.DefaultButton = ADB.Delete Then f.Text &= " excluded" f.ShowDialog() If f.DialogResult = DialogResult.OK Then - .AsList.ListAddList(f.SelectedSites, LAP.NotContainsOnly, LAP.ClearBeforeAdd) + .Self.ListAddList(f.SelectedSites, LAP.NotContainsOnly, LAP.ClearBeforeAdd) UpdateSitesText() End If End Using diff --git a/SCrawler/ListImagesLoader.vb b/SCrawler/ListImagesLoader.vb index cef565a..b9c90c6 100644 --- a/SCrawler/ListImagesLoader.vb +++ b/SCrawler/ListImagesLoader.vb @@ -197,7 +197,7 @@ Friend Class ListImagesLoader ElseIf CheckUserCollection(User) Then .BackColor = Color.LightSkyBlue .ForeColor = Color.MidnightBlue - Else 'If Not IsInit Then + Else .BackColor = Settings.UserListBackColorF .ForeColor = Settings.UserListForeColorF End If diff --git a/SCrawler/My Project/AssemblyInfo.vb b/SCrawler/My Project/AssemblyInfo.vb index 9ecdba6..54f9464 100644 --- a/SCrawler/My Project/AssemblyInfo.vb +++ b/SCrawler/My Project/AssemblyInfo.vb @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + diff --git a/SCrawler/SettingsCLS.vb b/SCrawler/SettingsCLS.vb index cd3e7a9..c81bc2a 100644 --- a/SCrawler/SettingsCLS.vb +++ b/SCrawler/SettingsCLS.vb @@ -81,12 +81,9 @@ Friend Class SettingsCLS : Implements IDisposable FFMPEGNotification = New XMLValue(Of Boolean)("FFMPEGNotification", True, MyXML) If Not FfmpegExists Then - If FFMPEGNotification.Value AndAlso MsgBoxE(New MMessage("[ffmpeg.exe] is missing", "ffmpeg.exe", - {"OK", New MsgBoxButton("Disable notification") With { - .IsDialogResultButton = False, .ToolTip = "Disable ffmpeg missing notification"}}, vbExclamation) With { - .DefaultButton = 0, .CancelButton = 0}) = 1 Then - FFMPEGNotification.Value = False - End If + If FFMPEGNotification.Value AndAlso + MsgBoxE({"[ffmpeg.exe] is missing", "ffmpeg.exe"}, vbExclamation,,, + {"OK", New MsgBoxButton("Disable notification", "Disable ffmpeg missing notification")}) = 1 Then FFMPEGNotification.Value = False Else FFMPEGNotification.Value = True End If diff --git a/SCrawler/UserFinder.vb b/SCrawler/UserFinder.vb index 968d280..c451401 100644 --- a/SCrawler/UserFinder.vb +++ b/SCrawler/UserFinder.vb @@ -283,7 +283,7 @@ Friend Class UserFinder : Implements IDisposable Private Function GetLabels() As List(Of String) Const DesignNode$ = "ImportUserSelectorLabels" Try - Dim __add As EventHandler(Of SimpleListFormEventArgs) = Sub(sender, e) e.ValueNew = InputBoxE("Enter a new label name", "New label").IfNullOrEmptyE(Nothing) + Dim __add As EventHandler(Of SimpleListFormEventArgs) = Sub(sender, e) e.Item = InputBoxE("Enter a new label name", "New label").IfNullOrEmptyE(Nothing) Dim l As List(Of String) = ListAddList(Nothing, Settings.Labels, LAP.NotContainsOnly).ListAddValue(LabelImported, LAP.NotContainsOnly) If l.Count > 0 Then l.Sort() If Not Settings.Design.Contains(DesignNode) Then Settings.Design.Add(DesignNode, String.Empty)