mirror of
https://github.com/AAndyProgram/SCrawler.git
synced 2026-03-15 00:02:17 +00:00
2024.2.22.1
Feed: add the ability to update file location when moving media Automation: make the automation file relative
This commit is contained in:
@@ -38,7 +38,13 @@ Namespace DownloadObjects
|
|||||||
End Property
|
End Property
|
||||||
Friend Sub New()
|
Friend Sub New()
|
||||||
Plans = New List(Of AutoDownloader)
|
Plans = New List(Of AutoDownloader)
|
||||||
File = Settings.AutomationFile.Value.IfNullOrEmpty(FileDefault)
|
Dim sFolder As SFile = SettingsFolderName.CSFileP
|
||||||
|
File = New SFile(Settings.AutomationFile.Value.IfNullOrEmpty(FileDefault.ToString))
|
||||||
|
If File.Path.IsEmptyString OrElse Not File.Path.StartsWith(sFolder.Path) Then
|
||||||
|
Dim updateSetting As Boolean = File.Path.IsEmptyString OrElse Not File.Path.StartsWith(sFolder.CutPath.Path)
|
||||||
|
File.Path = sFolder.Path
|
||||||
|
If File.Exists And updateSetting Then Settings.AutomationFile.Value = File.File
|
||||||
|
End If
|
||||||
If Not File.Exists Then File = FileDefault
|
If Not File.Exists Then File = FileDefault
|
||||||
Reset(File, True)
|
Reset(File, True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -279,9 +279,9 @@ Namespace DownloadObjects
|
|||||||
If Not Settings.Automation.File = f AndAlso Settings.Automation.Reset(f, False) Then
|
If Not Settings.Automation.File = f AndAlso Settings.Automation.Reset(f, False) Then
|
||||||
Settings.Automation.File = f
|
Settings.Automation.File = f
|
||||||
If selectedName = defName Then
|
If selectedName = defName Then
|
||||||
Settings.AutomationFile.Value = Nothing
|
Settings.AutomationFile.Value = String.Empty
|
||||||
Else
|
Else
|
||||||
Settings.AutomationFile.Value = f
|
Settings.AutomationFile.Value = f.File
|
||||||
End If
|
End If
|
||||||
PauseArr.UpdatePauseButtons()
|
PauseArr.UpdatePauseButtons()
|
||||||
Refill()
|
Refill()
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ Namespace DownloadObjects
|
|||||||
DataList.Clear()
|
DataList.Clear()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub DownloadFeedForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
Private Sub DownloadFeedForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||||
If e.KeyCode = Keys.F5 Then RefillList0() : e.Handled = True
|
If e.KeyCode = Keys.F5 Then RefillList() : e.Handled = True
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Feeds handlers"
|
#Region "Feeds handlers"
|
||||||
@@ -340,19 +340,19 @@ Namespace DownloadObjects
|
|||||||
MyRange.HandlersSuspended = True
|
MyRange.HandlersSuspended = True
|
||||||
MyRange.Limit = c
|
MyRange.Limit = c
|
||||||
MyRange.HandlersSuspended = False
|
MyRange.HandlersSuspended = False
|
||||||
If Not MyDefs.Initializing Then RefillList0()
|
If Not MyDefs.Initializing Then RefillList()
|
||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Refill"
|
#Region "Refill"
|
||||||
Private Sub RefillList0(Optional ByVal RememberPosition As Boolean? = Nothing)
|
Private Overloads Sub RefillList(Optional ByVal RememberPosition As Boolean? = Nothing)
|
||||||
If IsSession Then
|
If IsSession Then
|
||||||
RefillList(FeedMode = FeedModes.Current, If(RememberPosition, True))
|
RefillList(FeedMode = FeedModes.Current, If(RememberPosition, True))
|
||||||
Else
|
Else
|
||||||
RefillSpecialFeedsData()
|
RefillSpecialFeedsData()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub RefillList(Optional ByVal RefillDataList As Boolean = True, Optional ByVal RememberPosition As Boolean = False)
|
Private Overloads Sub RefillList(ByVal RefillDataList As Boolean, ByVal RememberPosition As Boolean)
|
||||||
DataPopulated = False
|
DataPopulated = False
|
||||||
Dim rIndx% = -1
|
Dim rIndx% = -1
|
||||||
If RememberPosition Then rIndx = MyRange.CurrentIndex
|
If RememberPosition Then rIndx = MyRange.CurrentIndex
|
||||||
@@ -493,39 +493,136 @@ Namespace DownloadObjects
|
|||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
Private Sub BTT_COPY_MOVE_TO_Click(sender As Object, e As EventArgs) Handles BTT_COPY_TO.Click, BTT_MOVE_TO.Click
|
Private Sub BTT_COPY_MOVE_TO_Click(sender As Object, e As EventArgs) Handles BTT_COPY_TO.Click, BTT_MOVE_TO.Click
|
||||||
|
MoveCopyFiles(True, sender, Nothing, Nothing)
|
||||||
|
End Sub
|
||||||
|
Private Function MoveCopyFiles(ByVal IsInternal As Boolean, ByVal Sender As Object, ByVal NewDestination As SFile, ByVal FeedMediaFile As SFile) As Boolean
|
||||||
Const MsgTitle$ = "Copy/Move checked files"
|
Const MsgTitle$ = "Copy/Move checked files"
|
||||||
Try
|
Try
|
||||||
Dim isCopy As Boolean = sender Is BTT_COPY_TO
|
Dim isCopy As Boolean = Not Sender Is Nothing AndAlso Sender Is BTT_COPY_TO
|
||||||
Dim dest As SFile = Nothing
|
Dim dest As SFile = Nothing
|
||||||
Dim ff As SFile, df As SFile
|
Dim ff As SFile = Nothing, df As SFile
|
||||||
Dim files As IEnumerable(Of SFile) = Nothing
|
Dim files As IEnumerable(Of SFile) = Nothing
|
||||||
|
Dim mm As UserMediaD
|
||||||
|
Dim mm_data As API.Base.UserMedia
|
||||||
|
Dim indx%
|
||||||
|
Dim renameExisting As Boolean = False
|
||||||
|
Dim downloaderFilesUpdated As Boolean = False
|
||||||
|
Dim eFiles As IEnumerable(Of SFile)
|
||||||
|
Dim finder As Predicate(Of UserMediaD) = Function(media) media.Data.File = ff
|
||||||
|
Dim x As XmlFile
|
||||||
|
Dim sessionData As New List(Of UserMediaD)
|
||||||
|
Dim sesFile As SFile
|
||||||
|
Dim sesFilesReplaced As Boolean = False
|
||||||
|
Dim filesReplace As New List(Of KeyValuePair(Of SFile, SFile))
|
||||||
|
Dim updateFileLocations As Boolean = Settings.FeedUpdateFileLocationOnMove
|
||||||
|
Dim result As Boolean = False
|
||||||
|
|
||||||
With GetCheckedMedia()
|
If FeedMediaFile.IsEmptyString Then
|
||||||
If .ListExists Then files = .Select(Function(m) m.Data.File)
|
With GetCheckedMedia()
|
||||||
End With
|
If .ListExists Then files = .Select(Function(m) m.Data.File)
|
||||||
|
End With
|
||||||
|
Else
|
||||||
|
files = {FeedMediaFile}
|
||||||
|
End If
|
||||||
If files.ListExists Then
|
If files.ListExists Then
|
||||||
Using f As New FeedCopyToForm(files, isCopy)
|
If NewDestination.IsEmptyString Then
|
||||||
f.ShowDialog()
|
Using f As New FeedCopyToForm(files, isCopy)
|
||||||
If f.DialogResult = DialogResult.OK Then dest = f.Destination
|
f.ShowDialog()
|
||||||
End Using
|
If f.DialogResult = DialogResult.OK Then dest = f.Destination
|
||||||
|
End Using
|
||||||
|
Else
|
||||||
|
dest = NewDestination
|
||||||
|
End If
|
||||||
If Not dest.IsEmptyString Then
|
If Not dest.IsEmptyString Then
|
||||||
|
If Not isCopy Then
|
||||||
|
eFiles = files.Where(Function(ByVal fff As SFile) As Boolean
|
||||||
|
fff.Path = dest
|
||||||
|
Return fff.Exists
|
||||||
|
End Function)
|
||||||
|
If eFiles.ListExists Then _
|
||||||
|
renameExisting = MsgBoxE(New MMessage("The following files already exist at the destination. " &
|
||||||
|
"Do you still want to move them? These files will be renamed and moved." & vbCr &
|
||||||
|
$"Destination: {dest.PathWithSeparator}{vbCr}{vbCr}" &
|
||||||
|
eFiles.ListToString(vbCr), MsgTitle, {"Move", "Cancel"}, vbExclamation)) = 0
|
||||||
|
|
||||||
|
End If
|
||||||
For Each ff In files
|
For Each ff In files
|
||||||
If Not ff.IsEmptyString Then
|
If Not ff.IsEmptyString Then
|
||||||
df = ff
|
df = ff
|
||||||
df.Path = dest.Path
|
df.Path = dest.Path
|
||||||
If isCopy Then ff.Copy(df) Else SFile.Move(ff, df)
|
If isCopy Then
|
||||||
|
If ff.Copy(df) Then result = True
|
||||||
|
Else
|
||||||
|
If df.Exists And renameExisting Then df = SFile.IndexReindex(df,,,, New ErrorsDescriber(False, False, False, df))
|
||||||
|
If SFile.Move(ff, df) Then
|
||||||
|
result = True
|
||||||
|
If updateFileLocations Then
|
||||||
|
filesReplace.Add(New KeyValuePair(Of SFile, SFile)(ff, df))
|
||||||
|
indx = Downloader.Files.FindIndex(finder)
|
||||||
|
If indx >= 0 Then
|
||||||
|
mm = Downloader.Files(indx)
|
||||||
|
mm_data = mm.Data
|
||||||
|
mm_data.File = df
|
||||||
|
mm = New UserMediaD(mm_data, mm.User, mm.Session, mm.Date)
|
||||||
|
Downloader.Files(indx) = mm
|
||||||
|
downloaderFilesUpdated = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
If Not isCopy Then RefillList0()
|
If Not isCopy And updateFileLocations Then
|
||||||
MsgBoxE({$"The following files were copied to{vbCr}{dest}{vbCr}{vbCr}{files.ListToString(vbCr)}", MsgTitle})
|
If downloaderFilesUpdated Then Downloader.FilesSave()
|
||||||
|
If FeedMode = FeedModes.Saved And Not LoadedSessionName.IsEmptyString And filesReplace.Count > 0 Then
|
||||||
|
sesFile = $"{TDownloader.SessionsPath.CSFilePS}{LoadedSessionName}.xml"
|
||||||
|
If sesFile.Exists Then
|
||||||
|
sessionData.Clear()
|
||||||
|
x = New XmlFile(sesFile, Protector.Modes.All, False) With {.AllowSameNames = True}
|
||||||
|
x.LoadData()
|
||||||
|
If x.Count > 0 Then sessionData.ListAddList(x)
|
||||||
|
x.Dispose()
|
||||||
|
If sessionData.Count > 0 Then
|
||||||
|
For Each rfile As KeyValuePair(Of SFile, SFile) In filesReplace
|
||||||
|
ff = rfile.Key
|
||||||
|
df = rfile.Value
|
||||||
|
indx = sessionData.FindIndex(finder)
|
||||||
|
If indx >= 0 Then
|
||||||
|
mm = sessionData(indx)
|
||||||
|
mm_data = mm.Data
|
||||||
|
mm_data.File = df
|
||||||
|
mm = New UserMediaD(mm_data, mm.User, mm.Session, mm.Date)
|
||||||
|
sessionData(indx) = mm
|
||||||
|
sesFilesReplaced = True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If sesFilesReplaced Then
|
||||||
|
x = New XmlFile With {.AllowSameNames = True}
|
||||||
|
x.AddRange(sessionData)
|
||||||
|
x.Name = TDownloader.Name_SessionXML
|
||||||
|
x.Save(sesFile, EDP.SendToLog)
|
||||||
|
x.Dispose()
|
||||||
|
End If
|
||||||
|
sessionData.Clear()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
If filesReplace.Count > 0 Then filesReplace.ForEach(Sub(fr) Settings.Feeds.UpdateDataByFile(fr.Key, fr.Value))
|
||||||
|
filesReplace.Clear()
|
||||||
|
RefillList()
|
||||||
|
End If
|
||||||
|
If IsInternal Then MsgBoxE({$"The following files were {IIf(isCopy, "copied", "moved")} to{vbCr}{dest}{vbCr}{vbCr}{files.ListToString(vbCr)}", MsgTitle})
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
MsgBoxE({"No files selected", MsgTitle}, vbExclamation)
|
MsgBoxE({"No files selected", MsgTitle}, vbExclamation)
|
||||||
End If
|
End If
|
||||||
|
Return result
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, MsgTitle)
|
Return ErrorsDescriber.Execute(EDP.LogMessageValue, ex, MsgTitle, False)
|
||||||
|
Finally
|
||||||
|
Settings.Feeds.UpdateWhereDataReplaced()
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Function
|
||||||
#Region "Load fav, spec"
|
#Region "Load fav, spec"
|
||||||
Private Sub BTT_LOAD_FAV_Click(sender As Object, e As EventArgs) Handles BTT_LOAD_FAV.Click
|
Private Sub BTT_LOAD_FAV_Click(sender As Object, e As EventArgs) Handles BTT_LOAD_FAV.Click
|
||||||
FeedChangeMode(FeedModes.Special, {FeedSpecial.FavoriteName})
|
FeedChangeMode(FeedModes.Special, {FeedSpecial.FavoriteName})
|
||||||
@@ -713,7 +810,7 @@ Namespace DownloadObjects
|
|||||||
If MsgBoxE({"Are you sure you want to clear this session data?", "Clear session"}, vbExclamation,,, {"Process", "Cancel"}) = 0 Then
|
If MsgBoxE({"Are you sure you want to clear this session data?", "Clear session"}, vbExclamation,,, {"Process", "Cancel"}) = 0 Then
|
||||||
Downloader.Files.Clear()
|
Downloader.Files.Clear()
|
||||||
ClearTable()
|
ClearTable()
|
||||||
RefillList0()
|
RefillList()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
@@ -848,7 +945,7 @@ Namespace DownloadObjects
|
|||||||
Settings.FeedLastModeSubscriptions.Value = OPT_SUBSCRIPTIONS.Checked
|
Settings.FeedLastModeSubscriptions.Value = OPT_SUBSCRIPTIONS.Checked
|
||||||
MENU_DOWN.Visible = OPT_SUBSCRIPTIONS.Checked
|
MENU_DOWN.Visible = OPT_SUBSCRIPTIONS.Checked
|
||||||
End Sub, EDP.None)
|
End Sub, EDP.None)
|
||||||
If __refill Then RefillList0()
|
If __refill Then RefillList()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
Friend Sub Downloader_FilesChanged(ByVal Added As Boolean)
|
Friend Sub Downloader_FilesChanged(ByVal Added As Boolean)
|
||||||
@@ -856,10 +953,13 @@ Namespace DownloadObjects
|
|||||||
BTT_REFRESH.ControlChangeColor(ToolbarTOP, Added, False)
|
BTT_REFRESH.ControlChangeColor(ToolbarTOP, Added, False)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub BTT_REFRESH_Click(sender As Object, e As EventArgs) Handles BTT_REFRESH.Click
|
Private Sub BTT_REFRESH_Click(sender As Object, e As EventArgs) Handles BTT_REFRESH.Click
|
||||||
RefillList0()
|
RefillList()
|
||||||
End Sub
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "FeedMedia handlers"
|
#Region "FeedMedia handlers"
|
||||||
|
Private Sub FeedMedia_MediaMove(ByVal Sender As FeedMedia, ByVal Destination As SFile, ByRef Result As Boolean)
|
||||||
|
Result = MoveCopyFiles(False, Nothing, Destination, Sender.File)
|
||||||
|
End Sub
|
||||||
Private Sub FeedMedia_MediaDeleted(ByVal Sender As FeedMedia)
|
Private Sub FeedMedia_MediaDeleted(ByVal Sender As FeedMedia)
|
||||||
Try
|
Try
|
||||||
ControlInvoke(TP_DATA, Sub() TPRemoveControl(Sender, True))
|
ControlInvoke(TP_DATA, Sub() TPRemoveControl(Sender, True))
|
||||||
@@ -1061,7 +1161,7 @@ Namespace DownloadObjects
|
|||||||
If d.ListExists AndAlso Not IsSubscription AndAlso d.All(FileNotExist) Then
|
If d.ListExists AndAlso Not IsSubscription AndAlso d.All(FileNotExist) Then
|
||||||
i = Sender.CurrentIndex
|
i = Sender.CurrentIndex
|
||||||
Sender.HandlersSuspended = True
|
Sender.HandlersSuspended = True
|
||||||
RefillList0(False)
|
RefillList(False)
|
||||||
If Sender.Count > 0 Then
|
If Sender.Count > 0 Then
|
||||||
If i.ValueBetween(0, Sender.Count - 1) Then Sender.CurrentIndex = i
|
If i.ValueBetween(0, Sender.Count - 1) Then Sender.CurrentIndex = i
|
||||||
Sender.HandlersSuspended = False
|
Sender.HandlersSuspended = False
|
||||||
@@ -1087,6 +1187,7 @@ Namespace DownloadObjects
|
|||||||
With fmList.Last
|
With fmList.Last
|
||||||
AddHandler .MediaDeleted, AddressOf FeedMedia_MediaDeleted
|
AddHandler .MediaDeleted, AddressOf FeedMedia_MediaDeleted
|
||||||
AddHandler .MediaDownload, AddressOf FeedMedia_Download
|
AddHandler .MediaDownload, AddressOf FeedMedia_Download
|
||||||
|
AddHandler .MediaMove, AddressOf FeedMedia_MediaMove
|
||||||
AddHandler .FeedAddWithRemove, AddressOf FeedMedia_FeedAddWithRemove
|
AddHandler .FeedAddWithRemove, AddressOf FeedMedia_FeedAddWithRemove
|
||||||
End With
|
End With
|
||||||
End Sub)
|
End Sub)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Namespace DownloadObjects
|
|||||||
Friend Event MediaDeleted(ByVal Sender As Object)
|
Friend Event MediaDeleted(ByVal Sender As Object)
|
||||||
Friend Event MediaDownload As EventHandler
|
Friend Event MediaDownload As EventHandler
|
||||||
Friend Event FeedAddWithRemove(ByVal Sender As FeedMedia, ByVal Feeds As IEnumerable(Of String), ByVal Media As UserMediaD, ByVal RemoveOperation As Boolean)
|
Friend Event FeedAddWithRemove(ByVal Sender As FeedMedia, ByVal Feeds As IEnumerable(Of String), ByVal Media As UserMediaD, ByVal RemoveOperation As Boolean)
|
||||||
|
Friend Event MediaMove(ByVal Sender As FeedMedia, ByVal Destination As SFile, ByRef Result As Boolean)
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Declarations"
|
#Region "Declarations"
|
||||||
Private Const VideoHeight As Integer = 450
|
Private Const VideoHeight As Integer = 450
|
||||||
@@ -490,6 +491,8 @@ Namespace DownloadObjects
|
|||||||
Dim isCopy As Boolean = sender Is BTT_COPY_TO
|
Dim isCopy As Boolean = sender Is BTT_COPY_TO
|
||||||
Dim dest As SFile = Nothing
|
Dim dest As SFile = Nothing
|
||||||
Dim ff As SFile = File
|
Dim ff As SFile = File
|
||||||
|
Dim result As Boolean = False
|
||||||
|
|
||||||
Using f As New FeedCopyToForm({File}, isCopy)
|
Using f As New FeedCopyToForm({File}, isCopy)
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
If f.DialogResult = DialogResult.OK Then dest = f.Destination
|
If f.DialogResult = DialogResult.OK Then dest = f.Destination
|
||||||
@@ -497,11 +500,11 @@ Namespace DownloadObjects
|
|||||||
If Not dest.IsEmptyString Then
|
If Not dest.IsEmptyString Then
|
||||||
ff.Path = dest
|
ff.Path = dest
|
||||||
If isCopy Then
|
If isCopy Then
|
||||||
File.Copy(ff)
|
result = File.Copy(ff)
|
||||||
Else
|
Else
|
||||||
If SFile.Move(File, ff) Then RaiseEvent MediaDeleted(Me)
|
RaiseEvent MediaMove(Me, dest, result)
|
||||||
End If
|
End If
|
||||||
MsgBoxE({$"File {IIf(isCopy, "copied", "moved")}{vbCr}Source: '{File}'{vbCr}Destination: '{ff}'", MsgTitle})
|
If result Then MsgBoxE({$"File {IIf(isCopy, "copied", "moved")}{vbCr}Source: '{File}'{vbCr}Destination: '{ff}'", MsgTitle})
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ Namespace DownloadObjects
|
|||||||
Friend Const FavoriteName As String = "Favorite"
|
Friend Const FavoriteName As String = "Favorite"
|
||||||
Friend Const SpecialName As String = "Special"
|
Friend Const SpecialName As String = "Special"
|
||||||
Private ReadOnly Items As List(Of UserMediaD)
|
Private ReadOnly Items As List(Of UserMediaD)
|
||||||
|
Private _FilesUpdated As Boolean = False
|
||||||
Private _File As SFile
|
Private _File As SFile
|
||||||
Friend ReadOnly Property File As SFile
|
Friend ReadOnly Property File As SFile
|
||||||
Get
|
Get
|
||||||
@@ -167,6 +168,26 @@ Namespace DownloadObjects
|
|||||||
Return Item
|
Return Item
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
|
#Region "UpdateDataByFile"
|
||||||
|
Friend Sub UpdateDataByFile(ByVal InitialFile As SFile, ByVal NewFile As SFile)
|
||||||
|
Try
|
||||||
|
Dim indx% = Items.FindIndex(Function(ii) ii.Data.File = InitialFile)
|
||||||
|
If indx >= 0 Then
|
||||||
|
Dim m As UserMediaD = Items(indx)
|
||||||
|
Dim mm As UserMedia = m.Data
|
||||||
|
mm.File = NewFile
|
||||||
|
m = New UserMediaD(mm, m.User, m.Session, m.Date)
|
||||||
|
Items(indx) = m
|
||||||
|
_FilesUpdated = True
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
ErrorsDescriber.Execute(EDP.SendToLog, ex, "[FeedSpecial.UpdateDataByFile]")
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
Friend Sub UpdateIfRequired()
|
||||||
|
If _FilesUpdated Then Save() : _FilesUpdated = False
|
||||||
|
End Sub
|
||||||
|
#End Region
|
||||||
#Region "Add"
|
#Region "Add"
|
||||||
Friend Overloads Function Add(ByVal Item As UserMediaD, Optional ByVal AutoSave As Boolean = True) As Boolean
|
Friend Overloads Function Add(ByVal Item As UserMediaD, Optional ByVal AutoSave As Boolean = True) As Boolean
|
||||||
If Not Items.Contains(Item) Then
|
If Not Items.Contains(Item) Then
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ Namespace DownloadObjects
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Add, Delete"
|
#Region "Add, Delete, UpdateDataByFile, UpdateWhereDataReplaced"
|
||||||
Friend Function Add(ByVal Name As String) As Integer
|
Friend Function Add(ByVal Name As String) As Integer
|
||||||
Dim i% = -1
|
Dim i% = -1
|
||||||
If Not Name.IsEmptyString Then
|
If Not Name.IsEmptyString Then
|
||||||
@@ -219,6 +219,12 @@ Namespace DownloadObjects
|
|||||||
End If
|
End If
|
||||||
Return result
|
Return result
|
||||||
End Function
|
End Function
|
||||||
|
Friend Sub UpdateDataByFile(ByVal InitialFile As SFile, ByVal NewFile As SFile)
|
||||||
|
If Count > 0 Then Feeds.ForEach(Sub(f) f.UpdateDataByFile(InitialFile, NewFile))
|
||||||
|
End Sub
|
||||||
|
Friend Sub UpdateWhereDataReplaced()
|
||||||
|
If Count > 0 Then Feeds.ForEach(Sub(f) f.UpdateIfRequired())
|
||||||
|
End Sub
|
||||||
#End Region
|
#End Region
|
||||||
#Region "IndexOf"
|
#Region "IndexOf"
|
||||||
Friend Function IndexOf(ByVal Name As String) As Integer
|
Friend Function IndexOf(ByVal Name As String) As Integer
|
||||||
|
|||||||
40
SCrawler/Editors/GlobalSettingsForm.Designer.vb
generated
40
SCrawler/Editors/GlobalSettingsForm.Designer.vb
generated
@@ -133,6 +133,7 @@ Namespace Editors
|
|||||||
Me.CH_STD_SNAP_CACHE_PERMANENT = New System.Windows.Forms.CheckBox()
|
Me.CH_STD_SNAP_CACHE_PERMANENT = New System.Windows.Forms.CheckBox()
|
||||||
Me.CH_STD_YT_CREATE_URL = New System.Windows.Forms.CheckBox()
|
Me.CH_STD_YT_CREATE_URL = New System.Windows.Forms.CheckBox()
|
||||||
Me.CH_USE_DEF_ACC = New System.Windows.Forms.CheckBox()
|
Me.CH_USE_DEF_ACC = New System.Windows.Forms.CheckBox()
|
||||||
|
Me.CH_NOTIFY_LOG = New System.Windows.Forms.CheckBox()
|
||||||
Me.TXT_CHANNELS_ROWS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_CHANNELS_ROWS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.TXT_CHANNELS_COLUMNS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
Me.TXT_CHANNELS_COLUMNS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
|
||||||
Me.CH_DOWN_IMAGES_NATIVE = New System.Windows.Forms.CheckBox()
|
Me.CH_DOWN_IMAGES_NATIVE = New System.Windows.Forms.CheckBox()
|
||||||
@@ -178,7 +179,7 @@ Namespace Editors
|
|||||||
Me.TAB_MAIN = New System.Windows.Forms.TabControl()
|
Me.TAB_MAIN = New System.Windows.Forms.TabControl()
|
||||||
Me.TAB_ENVIR = New System.Windows.Forms.TabPage()
|
Me.TAB_ENVIR = New System.Windows.Forms.TabPage()
|
||||||
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
|
||||||
Me.CH_NOTIFY_LOG = New System.Windows.Forms.CheckBox()
|
Me.CH_FEED_UP_FILE_LOC_MOVE = New System.Windows.Forms.CheckBox()
|
||||||
TP_BASIS = New System.Windows.Forms.TableLayoutPanel()
|
TP_BASIS = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TP_IMAGES = New System.Windows.Forms.TableLayoutPanel()
|
TP_IMAGES = New System.Windows.Forms.TableLayoutPanel()
|
||||||
TP_FILE_NAME = New System.Windows.Forms.TableLayoutPanel()
|
TP_FILE_NAME = New System.Windows.Forms.TableLayoutPanel()
|
||||||
@@ -1037,6 +1038,18 @@ Namespace Editors
|
|||||||
TT_MAIN.SetToolTip(Me.CH_USE_DEF_ACC, "Use the default account if you deleted an account that you used for some users")
|
TT_MAIN.SetToolTip(Me.CH_USE_DEF_ACC, "Use the default account if you deleted an account that you used for some users")
|
||||||
Me.CH_USE_DEF_ACC.UseVisualStyleBackColor = True
|
Me.CH_USE_DEF_ACC.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
|
'CH_NOTIFY_LOG
|
||||||
|
'
|
||||||
|
Me.CH_NOTIFY_LOG.AutoSize = True
|
||||||
|
Me.CH_NOTIFY_LOG.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
Me.CH_NOTIFY_LOG.Location = New System.Drawing.Point(4, 212)
|
||||||
|
Me.CH_NOTIFY_LOG.Name = "CH_NOTIFY_LOG"
|
||||||
|
Me.CH_NOTIFY_LOG.Size = New System.Drawing.Size(568, 19)
|
||||||
|
Me.CH_NOTIFY_LOG.TabIndex = 8
|
||||||
|
Me.CH_NOTIFY_LOG.Text = "The log contains new data"
|
||||||
|
TT_MAIN.SetToolTip(Me.CH_NOTIFY_LOG, "Show a notification when the new data is added to the log.")
|
||||||
|
Me.CH_NOTIFY_LOG.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
'TP_CHANNELS_IMGS
|
'TP_CHANNELS_IMGS
|
||||||
'
|
'
|
||||||
TP_CHANNELS_IMGS.ColumnCount = 2
|
TP_CHANNELS_IMGS.ColumnCount = 2
|
||||||
@@ -1507,10 +1520,11 @@ Namespace Editors
|
|||||||
TP_FEED.Controls.Add(Me.CH_FEED_OPEN_LAST_MODE, 0, 7)
|
TP_FEED.Controls.Add(Me.CH_FEED_OPEN_LAST_MODE, 0, 7)
|
||||||
TP_FEED.Controls.Add(Me.CH_FEED_SHOW_FRIENDLY, 0, 8)
|
TP_FEED.Controls.Add(Me.CH_FEED_SHOW_FRIENDLY, 0, 8)
|
||||||
TP_FEED.Controls.Add(Me.CH_FEED_SHOW_SPEC_MEDIAITEM, 0, 9)
|
TP_FEED.Controls.Add(Me.CH_FEED_SHOW_SPEC_MEDIAITEM, 0, 9)
|
||||||
|
TP_FEED.Controls.Add(Me.CH_FEED_UP_FILE_LOC_MOVE, 0, 10)
|
||||||
TP_FEED.Dock = System.Windows.Forms.DockStyle.Fill
|
TP_FEED.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
TP_FEED.Location = New System.Drawing.Point(0, 0)
|
TP_FEED.Location = New System.Drawing.Point(0, 0)
|
||||||
TP_FEED.Name = "TP_FEED"
|
TP_FEED.Name = "TP_FEED"
|
||||||
TP_FEED.RowCount = 11
|
TP_FEED.RowCount = 12
|
||||||
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
|
||||||
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
|
||||||
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
||||||
@@ -1521,6 +1535,7 @@ Namespace Editors
|
|||||||
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
||||||
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
||||||
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
||||||
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
|
||||||
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
TP_FEED.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
|
||||||
TP_FEED.Size = New System.Drawing.Size(576, 399)
|
TP_FEED.Size = New System.Drawing.Size(576, 399)
|
||||||
TP_FEED.TabIndex = 0
|
TP_FEED.TabIndex = 0
|
||||||
@@ -2154,17 +2169,17 @@ Namespace Editors
|
|||||||
Me.CONTAINER_MAIN.TabIndex = 0
|
Me.CONTAINER_MAIN.TabIndex = 0
|
||||||
Me.CONTAINER_MAIN.TopToolStripPanelVisible = False
|
Me.CONTAINER_MAIN.TopToolStripPanelVisible = False
|
||||||
'
|
'
|
||||||
'CH_NOTIFY_LOG
|
'CH_FEED_UP_FILE_LOC_MOVE
|
||||||
'
|
'
|
||||||
Me.CH_NOTIFY_LOG.AutoSize = True
|
Me.CH_FEED_UP_FILE_LOC_MOVE.AutoSize = True
|
||||||
Me.CH_NOTIFY_LOG.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.CH_FEED_UP_FILE_LOC_MOVE.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.CH_NOTIFY_LOG.Location = New System.Drawing.Point(4, 212)
|
Me.CH_FEED_UP_FILE_LOC_MOVE.Location = New System.Drawing.Point(4, 273)
|
||||||
Me.CH_NOTIFY_LOG.Name = "CH_NOTIFY_LOG"
|
Me.CH_FEED_UP_FILE_LOC_MOVE.Name = "CH_FEED_UP_FILE_LOC_MOVE"
|
||||||
Me.CH_NOTIFY_LOG.Size = New System.Drawing.Size(568, 19)
|
Me.CH_FEED_UP_FILE_LOC_MOVE.Size = New System.Drawing.Size(568, 19)
|
||||||
Me.CH_NOTIFY_LOG.TabIndex = 8
|
Me.CH_FEED_UP_FILE_LOC_MOVE.TabIndex = 10
|
||||||
Me.CH_NOTIFY_LOG.Text = "The log contains new data"
|
Me.CH_FEED_UP_FILE_LOC_MOVE.Text = "Update file location when moved"
|
||||||
TT_MAIN.SetToolTip(Me.CH_NOTIFY_LOG, "Show a notification when the new data is added to the log.")
|
TT_MAIN.SetToolTip(Me.CH_FEED_UP_FILE_LOC_MOVE, "The file location will be updated in the session data and in the feeds data")
|
||||||
Me.CH_NOTIFY_LOG.UseVisualStyleBackColor = True
|
Me.CH_FEED_UP_FILE_LOC_MOVE.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
'GlobalSettingsForm
|
'GlobalSettingsForm
|
||||||
'
|
'
|
||||||
@@ -2357,5 +2372,6 @@ Namespace Editors
|
|||||||
Private WithEvents CH_USE_DEF_ACC As CheckBox
|
Private WithEvents CH_USE_DEF_ACC As CheckBox
|
||||||
Private WithEvents CH_FEED_SHOW_SPEC_MEDIAITEM As CheckBox
|
Private WithEvents CH_FEED_SHOW_SPEC_MEDIAITEM As CheckBox
|
||||||
Private WithEvents CH_NOTIFY_LOG As CheckBox
|
Private WithEvents CH_NOTIFY_LOG As CheckBox
|
||||||
|
Private WithEvents CH_FEED_UP_FILE_LOC_MOVE As CheckBox
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
@@ -143,6 +143,7 @@ Namespace Editors
|
|||||||
CH_FEED_OPEN_LAST_MODE.Checked = .FeedOpenLastMode
|
CH_FEED_OPEN_LAST_MODE.Checked = .FeedOpenLastMode
|
||||||
CH_FEED_SHOW_FRIENDLY.Checked = .FeedShowFriendlyNames
|
CH_FEED_SHOW_FRIENDLY.Checked = .FeedShowFriendlyNames
|
||||||
CH_FEED_SHOW_SPEC_MEDIAITEM.Checked = .FeedShowSpecialFeedsMediaItem
|
CH_FEED_SHOW_SPEC_MEDIAITEM.Checked = .FeedShowSpecialFeedsMediaItem
|
||||||
|
CH_FEED_UP_FILE_LOC_MOVE.Checked = .FeedUpdateFileLocationOnMove
|
||||||
End With
|
End With
|
||||||
.MyFieldsChecker = New FieldsChecker
|
.MyFieldsChecker = New FieldsChecker
|
||||||
With .MyFieldsCheckerE
|
With .MyFieldsCheckerE
|
||||||
@@ -316,6 +317,7 @@ Namespace Editors
|
|||||||
.FeedOpenLastMode.Value = CH_FEED_OPEN_LAST_MODE.Checked
|
.FeedOpenLastMode.Value = CH_FEED_OPEN_LAST_MODE.Checked
|
||||||
.FeedShowFriendlyNames.Value = CH_FEED_SHOW_FRIENDLY.Checked
|
.FeedShowFriendlyNames.Value = CH_FEED_SHOW_FRIENDLY.Checked
|
||||||
.FeedShowSpecialFeedsMediaItem.Value = CH_FEED_SHOW_SPEC_MEDIAITEM.Checked
|
.FeedShowSpecialFeedsMediaItem.Value = CH_FEED_SHOW_SPEC_MEDIAITEM.Checked
|
||||||
|
.FeedUpdateFileLocationOnMove.Value = CH_FEED_UP_FILE_LOC_MOVE.Checked
|
||||||
FeedParametersChanged = .FeedDataRows.ChangesDetected Or .FeedDataColumns.ChangesDetected Or
|
FeedParametersChanged = .FeedDataRows.ChangesDetected Or .FeedDataColumns.ChangesDetected Or
|
||||||
.FeedEndless.ChangesDetected Or .FeedBackColor.ChangesDetected Or
|
.FeedEndless.ChangesDetected Or .FeedBackColor.ChangesDetected Or
|
||||||
.FeedForeColor.ChangesDetected Or .FeedCenterImage.ChangesDetected
|
.FeedForeColor.ChangesDetected Or .FeedCenterImage.ChangesDetected
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
|
|||||||
Friend ReadOnly Property DownloadLocations As STDownloader.DownloadLocationsCollection
|
Friend ReadOnly Property DownloadLocations As STDownloader.DownloadLocationsCollection
|
||||||
Friend ReadOnly Property GlobalLocations As STDownloader.DownloadLocationsCollection
|
Friend ReadOnly Property GlobalLocations As STDownloader.DownloadLocationsCollection
|
||||||
Friend Property Automation As Scheduler
|
Friend Property Automation As Scheduler
|
||||||
Friend ReadOnly Property AutomationFile As XMLValue(Of SFile)
|
Friend ReadOnly Property AutomationFile As XMLValue(Of String)
|
||||||
Friend ReadOnly Property Feeds As FeedSpecialCollection
|
Friend ReadOnly Property Feeds As FeedSpecialCollection
|
||||||
Friend ReadOnly Property BlackList As List(Of UserBan)
|
Friend ReadOnly Property BlackList As List(Of UserBan)
|
||||||
Private ReadOnly BlackListFile As SFile = $"{SettingsFolderName}\BlackList.txt"
|
Private ReadOnly BlackListFile As SFile = $"{SettingsFolderName}\BlackList.txt"
|
||||||
@@ -179,7 +179,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
|
|||||||
|
|
||||||
SeparateVideoFolder = New XMLValue(Of Boolean)("SeparateVideoFolder", True, MyXML)
|
SeparateVideoFolder = New XMLValue(Of Boolean)("SeparateVideoFolder", True, MyXML)
|
||||||
CollectionsPath = New XMLValue(Of String)("CollectionsPath", CollectionsFolderName, MyXML)
|
CollectionsPath = New XMLValue(Of String)("CollectionsPath", CollectionsFolderName, MyXML)
|
||||||
AutomationFile = New XMLValue(Of SFile)("AutomationFile",, MyXML)
|
AutomationFile = New XMLValue(Of String)("AutomationFile",, MyXML)
|
||||||
|
|
||||||
UserAgent = New XMLValue(Of String)("UserAgent",, MyXML)
|
UserAgent = New XMLValue(Of String)("UserAgent",, MyXML)
|
||||||
If Not UserAgent.IsEmptyString Then DefaultUserAgent = UserAgent
|
If Not UserAgent.IsEmptyString Then DefaultUserAgent = UserAgent
|
||||||
@@ -321,6 +321,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
|
|||||||
FeedShowFriendlyNames = New XMLValue(Of Boolean)("ShowFriendlyNames", True, MyXML, n)
|
FeedShowFriendlyNames = New XMLValue(Of Boolean)("ShowFriendlyNames", True, MyXML, n)
|
||||||
FeedShowSpecialFeedsMediaItem = New XMLValue(Of Boolean)("ShowSpecialFeedsMediaItem", False, MyXML, n)
|
FeedShowSpecialFeedsMediaItem = New XMLValue(Of Boolean)("ShowSpecialFeedsMediaItem", False, MyXML, n)
|
||||||
FeedLastCopyMoveLocation = New XMLValue(Of SFile)("LastCopyMoveLocation",, MyXML, n)
|
FeedLastCopyMoveLocation = New XMLValue(Of SFile)("LastCopyMoveLocation",, MyXML, n)
|
||||||
|
FeedUpdateFileLocationOnMove = New XMLValue(Of Boolean)("UpdateFileLocationOnMove", True, MyXML, n)
|
||||||
|
|
||||||
n = {"Users"}
|
n = {"Users"}
|
||||||
FromChannelDownloadTop = New XMLValue(Of Integer)("FromChannelDownloadTop", 10, MyXML, n)
|
FromChannelDownloadTop = New XMLValue(Of Integer)("FromChannelDownloadTop", 10, MyXML, n)
|
||||||
@@ -956,6 +957,7 @@ Friend Class SettingsCLS : Implements IDownloaderSettings, IDisposable
|
|||||||
Friend ReadOnly Property FeedShowFriendlyNames As XMLValue(Of Boolean)
|
Friend ReadOnly Property FeedShowFriendlyNames As XMLValue(Of Boolean)
|
||||||
Friend ReadOnly Property FeedShowSpecialFeedsMediaItem As XMLValue(Of Boolean)
|
Friend ReadOnly Property FeedShowSpecialFeedsMediaItem As XMLValue(Of Boolean)
|
||||||
Friend ReadOnly Property FeedLastCopyMoveLocation As XMLValue(Of SFile)
|
Friend ReadOnly Property FeedLastCopyMoveLocation As XMLValue(Of SFile)
|
||||||
|
Friend ReadOnly Property FeedUpdateFileLocationOnMove As XMLValue(Of Boolean)
|
||||||
#End Region
|
#End Region
|
||||||
#Region "New version properties"
|
#Region "New version properties"
|
||||||
Friend ReadOnly Property CheckUpdatesAtStart As XMLValue(Of Boolean)
|
Friend ReadOnly Property CheckUpdatesAtStart As XMLValue(Of Boolean)
|
||||||
|
|||||||
Reference in New Issue
Block a user