Compare commits

...

8 Commits

Author SHA1 Message Date
Andy
129558c262 2022.9.24.0
Fixed wrong image opening in Autodownloader
Fixed incorrect feed grid resizing when removing media
Fixed incorrect removal of users from the collection
Fixed Instagram function displaying number of requests: wrong value type.
Fixed XVIDEOS cycle bug
Collection: add multiple users
Collection: new collections at the top
Copying user data
Feed: 'Season' and 'Date' to the post title.
2022-09-24 20:26:40 +03:00
Andy
a3e79eb4bc Update UserDataBase.vb
Fixed typo
2022-09-17 20:28:27 +03:00
Andy
eb28255de3 2022.9.17.0
Extended filters by date
Added download by dates for multiple users
Changed validation of dates ranges in UserDataBase
Add user filters by dates
Add disabling site downloading
Fixed Twitter date validator
2022-09-17 19:59:55 +03:00
Andy
92be0994ae 2022.9.16.0
Removed some compatible functions
Fixed Settings.GetUser bug
Design improvements
Changed UserMediD comparer
FeedVideo design updated, incorrect time position fixed, bugs fixed
Fixed getting Reddit channel video thumbnail
2022-09-16 19:41:24 +03:00
Andy
9567b0a367 2022.9.13.0
Added video duration to the feed
Added skipping of pinned Instagram posts if they are already downloaded
2022-09-13 16:20:07 +03:00
Andy
c28c0e1ba3 2022.9.10.0
Fixed: missed posts are not saved
Fixed memory leaking because of the video
2022-09-10 12:28:40 +03:00
Andy
86771eee94 2022.9.8.1
Fixed unexpected memory leak when using the 'Feed' form
2022-09-08 22:24:36 +03:00
Andy
02e8a15ae3 2022.9.8.0
Temporary disabled RedGifs downloading
Added 'missing posts', 'feed'
Fixed minor bugs
2022-09-08 12:36:25 +03:00
96 changed files with 4263 additions and 574 deletions

View File

@@ -1,3 +1,81 @@
# 2022.9.24.0
*2022-09-24*
- Added
- Ability to copy user data to another destination
- Ability to add 'Session' and 'Date' values to the post title in the feed
- Minor feed improvements
- The newly created collection will now appear at the top of the list (after reopening the form)
- Ability to add multiple users at a time to the collection.
- Fixed
- Autodownloader opens a compressed image instead of a full one
- Incorrect resizing of the feed grid after deleting a media file
- Incorrect behavior when deleting/removing a user from a collection.
- An incorrect function that displayed the number of spent Instagram requests.
- Bug in the XVIDEOS downloader
- Minor bugs
# 2022.9.17.0
*2022-09-17*
- Added
- Added two date filters to filter users (in range, not in range)
- (Request #71) Download data for a specific date range
- The ability to disable site downloading (in the site settings form)
- Updated
- Plugins
- Fixed
- (Issue #71) ```Download data to the date``` doesn't work for Twitter
- Download data for a specific date range doesn't work for multiple users
- Incorrect feed sorting algorithm
- Minor bugs
# 2022.9.16.0
*2022-09-16*
- Fixed
- Failed to get video thumbnail for channel video post
- Incorrect rendering of the 'Feed' table when the number of columns is more than one
- Minor design bugs
# 2022.9.13.0
*2022-09-13*
- Added
- Video duration to the feed
- Fixed
- (Issue #70) Instagram posts not downloading if there are pinned posts that have already been downloaded
- Minor bugs
# 2022.9.10.0
*2022-09-10*
- Fixed
- The memory is still leaking. This time because of the video. *Using WMP was not the best choice.*
# 2022.9.8.1
*2022-09-08*
- Fixed
- Unexpected memory leak when using the 'Feed' form
# 2022.9.8.0
*2022-09-08*
- Added
- **Feed** (feed of downloaded media files)
- Missing posts tracking and management
- Simple scheduler notifications
- Fixed
- (Issue #67) Saved Instagram posts not downloading
# 2022.8.28.0 # 2022.8.28.0
*2022-08-28* *2022-08-28*

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 KiB

After

Width:  |  Height:  |  Size: 370 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 KiB

After

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -18,7 +18,7 @@ https://www.4kdownload.com/products/product-stogram
| Download posts by location | No | **Yes** | | Download posts by location | No | **Yes** |
| Save Private Instagram Content with Permission| Yes | Yes | | Save Private Instagram Content with Permission| Yes | Yes |
| Download Instagram Stories and Highlights | Yes | Yes | | Download Instagram Stories and Highlights | Yes | Yes |
| See Others Instagram Feed As Your Own | No | **Yes** | | See Others Instagram Feed As Your Own | Yes | Yes |
| Download Instagram Video Posts | Yes | Yes | | Download Instagram Video Posts | Yes | Yes |
| Backup Your Instagram Account | Yes | Yes | | Backup Your Instagram Account | Yes | Yes |
| Save Instagram Posts by Date | Yes | Yes | | Save Instagram Posts by Date | Yes | Yes |
@@ -31,7 +31,7 @@ https://www.4kdownload.com/products/product-stogram
| Automatic Subscriptions Update | **Free** | Paid (43.56 EUR) | | Automatic Subscriptions Update | **Free** | Paid (43.56 EUR) |
| Posts and Captions Export | No | Paid (43.56 EUR) | | Posts and Captions Export | No | Paid (43.56 EUR) |
| Advertisements free | **No ADs at all for free** | Paid (14.52) | | Advertisements free | **No ADs at all for free** | Paid (14.52) |
| Operating Systems | Windows 7+ | Windows 7+, MacOS 10.13+, Ubuntu x64 | | Operating Systems | Windows 10+ | Windows 7+, MacOS 10.13+, Ubuntu x64 |
| Select want content type to download | **Yes** | No | | Select want content type to download | **Yes** | No |
| Instagram support | Yes | Yes | | Instagram support | Yes | Yes |
| Twitter support | **Yes** | No | | Twitter support | **Yes** | No |
@@ -66,9 +66,9 @@ https://github.com/RipMeApp/ripme
| Export and import subscriptions | No | No | | Export and import subscriptions | No | No |
| **Paid** | **No** | **No** | | **Paid** | **No** | **No** |
| **Free options** | The program is completely free | The program is completely free, but site limits are not declared | | **Free options** | The program is completely free | The program is completely free, but site limits are not declared |
| Operating Systems | Windows 7+ | Windows, MacOS, Linux | | Operating Systems | Windows 10+ | Windows, MacOS, Linux |
| Select want content type to download | Yes | Yes | | Select want content type to download | Yes | Yes |
| Suported sites | 3 internal and any site using plugins | 86+ sites (declared) | | Suported sites | 6 internal and any site using plugins | 86+ sites (declared) |
| Other sites support | **Yes** | No | | Other sites support | **Yes** | No |
| Still supported | **Yes** | **No (last release date May 4, 2021)** | | Still supported | **Yes** | **No (last release date May 4, 2021)** |

View File

@@ -8,6 +8,8 @@
A program to download photo and video from [any site](#supported-sites) (e.g. Reddit, Twitter, Instagram). A program to download photo and video from [any site](#supported-sites) (e.g. Reddit, Twitter, Instagram).
**If you like SCrawler, please like the program on [this site]( https://alternativeto.net/software/scrawler/about/)**
Do you like this program? Consider adding to my coffee fund by making a donation to show your support. :blush: Do you like this program? Consider adding to my coffee fund by making a donation to show your support. :blush:
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/andyprogram) [![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/andyprogram)
@@ -35,6 +37,7 @@ Do you like this program? Consider adding to my coffee fund by making a donation
- Add users from parsed channel - Add users from parsed channel
- **Advanced user management** - **Advanced user management**
- **Automation** (downloading data automatically every ```X``` minutes) - **Automation** (downloading data automatically every ```X``` minutes)
- **Feed** (feed of downloaded media files)
- Labeling users - Labeling users
- Create download groups - Create download groups
- Adding users to favorites and temporary - Adding users to favorites and temporary

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2022.8.22.0")> <Assembly: AssemblyVersion("2022.9.17.0")>
<Assembly: AssemblyFileVersion("2022.8.22.0")> <Assembly: AssemblyFileVersion("2022.9.17.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -97,4 +97,7 @@ Public Class SiteSettings : Implements ISiteSettings
Public Function ReadyToDownload(ByVal What As ISiteSettings.Download) As Boolean Implements ISiteSettings.ReadyToDownload Public Function ReadyToDownload(ByVal What As ISiteSettings.Download) As Boolean Implements ISiteSettings.ReadyToDownload
Return True Return True
End Function End Function
Public Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String Implements ISiteSettings.GetUserPostUrl
Return String.Empty
End Function
End Class End Class

View File

@@ -38,7 +38,8 @@ Public Class UserData : Implements IPluginContentProvider
Public Property SeparateVideoFolder As Boolean Implements IPluginContentProvider.SeparateVideoFolder Public Property SeparateVideoFolder As Boolean Implements IPluginContentProvider.SeparateVideoFolder
Public Property DataPath As String Implements IPluginContentProvider.DataPath Public Property DataPath As String Implements IPluginContentProvider.DataPath
Public Property PostsNumberLimit As Integer? Implements IPluginContentProvider.PostsNumberLimit Public Property PostsNumberLimit As Integer? Implements IPluginContentProvider.PostsNumberLimit
Public Property PostsDateLimit As Date? Implements IPluginContentProvider.PostsDateLimit Public Property DownloadDateFrom As Date? Implements IPluginContentProvider.DownloadDateFrom
Public Property DownloadDateTo As Date? Implements IPluginContentProvider.DownloadDateTo
#End Region #End Region
#Region "Interface exchange options" #Region "Interface exchange options"
Public Sub ExchangeOptionsSet(ByVal Obj As Object) Implements IPluginContentProvider.ExchangeOptionsSet Public Sub ExchangeOptionsSet(ByVal Obj As Object) Implements IPluginContentProvider.ExchangeOptionsSet
@@ -152,7 +153,8 @@ Public Class UserData : Implements IPluginContentProvider
If Responser.Client.StatusCode = Net.HttpStatusCode.ServiceUnavailable Then If Responser.Client.StatusCode = Net.HttpStatusCode.ServiceUnavailable Then
LogProvider.Add("LPSG not available") LogProvider.Add("LPSG not available")
Else Else
m.DownloadState = UStates.Skipped m.DownloadState = UStates.Missing
m.Attempts += 1
End If End If
End Try End Try
RaiseEvent ProgressChanged(1) RaiseEvent ProgressChanged(1)

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2022.8.22.0")> <Assembly: AssemblyVersion("2022.9.24.0")>
<Assembly: AssemblyFileVersion("2022.8.22.0")> <Assembly: AssemblyFileVersion("2022.9.24.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -35,7 +35,7 @@ Public Class SettingsForm
Settings.UpdateDomains() Settings.UpdateDomains()
MyDefs.CloseForm() MyDefs.CloseForm()
End Sub End Sub
Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonAddClick Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EditToolbarEventArgs) Handles MyDefs.ButtonAddClick
Dim nd$ = InputBoxE("Enter a new domain using the pattern [xvideos.com]:", "New domain") Dim nd$ = InputBoxE("Enter a new domain using the pattern [xvideos.com]:", "New domain")
If Not nd.IsEmptyString Then If Not nd.IsEmptyString Then
If Not LIST_DOMAINS.Items.Contains(nd) Then If Not LIST_DOMAINS.Items.Contains(nd) Then
@@ -45,7 +45,7 @@ Public Class SettingsForm
End If End If
End If End If
End Sub End Sub
Private Sub MyDefs_ButtonDeleteClickE(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonDeleteClickE Private Sub MyDefs_ButtonDeleteClickE(ByVal Sender As Object, ByVal e As EditToolbarEventArgs) Handles MyDefs.ButtonDeleteClickE
If _LatestSelected.ValueBetween(0, LIST_DOMAINS.Items.Count - 1) Then If _LatestSelected.ValueBetween(0, LIST_DOMAINS.Items.Count - 1) Then
Dim n$ = LIST_DOMAINS.Items(_LatestSelected) Dim n$ = LIST_DOMAINS.Items(_LatestSelected)
If MsgBoxE({$"Are you sure you want to delete the [{n}] domain?", "Removing domains"}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If MsgBoxE({$"Are you sure you want to delete the [{n}] domain?", "Removing domains"}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then

View File

@@ -179,4 +179,7 @@ Public Class SiteSettings : Implements ISiteSettings
End If End If
Return Nothing Return Nothing
End Function End Function
Public Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String Implements ISiteSettings.GetUserPostUrl
Return String.Empty
End Function
End Class End Class

View File

@@ -37,7 +37,8 @@ Public Class UserData : Implements IPluginContentProvider
Public Property SeparateVideoFolder As Boolean Implements IPluginContentProvider.SeparateVideoFolder Public Property SeparateVideoFolder As Boolean Implements IPluginContentProvider.SeparateVideoFolder
Public Property DataPath As String Implements IPluginContentProvider.DataPath Public Property DataPath As String Implements IPluginContentProvider.DataPath
Public Property PostsNumberLimit As Integer? Implements IPluginContentProvider.PostsNumberLimit Public Property PostsNumberLimit As Integer? Implements IPluginContentProvider.PostsNumberLimit
Public Property PostsDateLimit As Date? Implements IPluginContentProvider.PostsDateLimit Public Property DownloadDateFrom As Date? Implements IPluginContentProvider.DownloadDateFrom
Public Property DownloadDateTo As Date? Implements IPluginContentProvider.DownloadDateTo
#End Region #End Region
#Region "Interface exchange options" #Region "Interface exchange options"
Public Sub ExchangeOptionsSet(ByVal Obj As Object) Implements IPluginContentProvider.ExchangeOptionsSet Public Sub ExchangeOptionsSet(ByVal Obj As Object) Implements IPluginContentProvider.ExchangeOptionsSet
@@ -70,7 +71,7 @@ Public Class UserData : Implements IPluginContentProvider
Dim NextPage% = 0 Dim NextPage% = 0
Dim r$ Dim r$
Dim j As EContainer, jj As EContainer Dim jj As EContainer
Dim e As ErrorsDescriber = EDP.ThrowException Dim e As ErrorsDescriber = EDP.ThrowException
Dim user$ = Settings.GetUserUrl(Name, False) Dim user$ = Settings.GetUserUrl(Name, False)
Dim p As PluginUserMedia Dim p As PluginUserMedia
@@ -81,8 +82,7 @@ Public Class UserData : Implements IPluginContentProvider
r = Responser.GetResponse($"https://www.xvideos.com/{user}/videos/new/{If(NextPage = 0, String.Empty, NextPage)}",, e) r = Responser.GetResponse($"https://www.xvideos.com/{user}/videos/new/{If(NextPage = 0, String.Empty, NextPage)}",, e)
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
If Not EnvirSet Then UserExists = True : UserSuspended = False : EnvirSet = True If Not EnvirSet Then UserExists = True : UserSuspended = False : EnvirSet = True
j = JsonDocument.Parse(r).XmlIfNothing With JsonDocument.Parse(r).XmlIfNothing
With j
If .Contains("videos") Then If .Contains("videos") Then
With .Item("videos") With .Item("videos")
If .Count > 0 Then If .Count > 0 Then
@@ -93,9 +93,12 @@ Public Class UserData : Implements IPluginContentProvider
.URL = $"https://www.xvideos.com{jj.Value("u")}" .URL = $"https://www.xvideos.com{jj.Value("u")}"
} }
If Not p.PostID.IsEmptyString And Not jj.Value("u").IsEmptyString Then If Not p.PostID.IsEmptyString And Not jj.Value("u").IsEmptyString Then
If Not TempPostsList.Contains(p.PostID) Then TempPostsList.Add(p.PostID) : TempMediaList.Add(p) Else Exit Do If Not TempPostsList.Contains(p.PostID) Then TempPostsList.Add(p.PostID) : TempMediaList.Add(p) Else .Dispose() : Exit Do
End If End If
Next Next
Else
.Dispose()
Exit Do
End If End If
End With End With
Else Else
@@ -208,7 +211,8 @@ Public Class UserData : Implements IPluginContentProvider
m.File = f m.File = f
m.DownloadState = UStates.Downloaded m.DownloadState = UStates.Downloaded
Catch ex As Exception Catch ex As Exception
m.DownloadState = UStates.Skipped m.DownloadState = UStates.Missing
m.Attempts += 1
End Try End Try
TempMediaList(i) = m TempMediaList(i) = m
RaiseEvent ProgressChanged(1) RaiseEvent ProgressChanged(1)

View File

@@ -26,7 +26,8 @@ Namespace Plugin
Property SeparateVideoFolder As Boolean Property SeparateVideoFolder As Boolean
Property DataPath As String Property DataPath As String
Property PostsNumberLimit As Integer? Property PostsNumberLimit As Integer?
Property PostsDateLimit As Date? Property DownloadDateFrom As Date?
Property DownloadDateTo As Date?
Function ExchangeOptionsGet() As Object Function ExchangeOptionsGet() As Object
Sub ExchangeOptionsSet(ByVal Obj As Object) Sub ExchangeOptionsSet(ByVal Obj As Object)
Sub XmlFieldsSet(ByVal Fields As List(Of KeyValuePair(Of String, String))) Sub XmlFieldsSet(ByVal Fields As List(Of KeyValuePair(Of String, String)))

View File

@@ -23,6 +23,7 @@ Namespace Plugin
Function IsMyImageVideo(ByVal URL As String) As ExchangeOptions Function IsMyImageVideo(ByVal URL As String) As ExchangeOptions
Function GetSpecialData(ByVal URL As String, ByVal Path As String, ByVal AskForPath As Boolean) As IEnumerable(Of PluginUserMedia) Function GetSpecialData(ByVal URL As String, ByVal Path As String, ByVal AskForPath As Boolean) As IEnumerable(Of PluginUserMedia)
Function GetInstance(ByVal What As Download) As IPluginContentProvider Function GetInstance(ByVal What As Download) As IPluginContentProvider
Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String
#Region "XML Support" #Region "XML Support"
Sub Load(ByVal XMLValues As IEnumerable(Of KeyValuePair(Of String, String))) Sub Load(ByVal XMLValues As IEnumerable(Of KeyValuePair(Of String, String)))
#End Region #End Region

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2022.8.22.0")> <Assembly: AssemblyVersion("2022.9.17.0")>
<Assembly: AssemblyFileVersion("2022.8.22.0")> <Assembly: AssemblyFileVersion("2022.9.17.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -17,7 +17,7 @@ Namespace Plugin
GIF = 50 GIF = 50
m3u8 = 100 m3u8 = 100
End Enum End Enum
Enum States As Integer : Unknown = 0 : Tried = 1 : Downloaded = 2 : Skipped = 3 : End Enum Enum States As Integer : Unknown = 0 : Tried = 1 : Downloaded = 2 : Skipped = 3 : Missing = 4 : End Enum
Public ContentType As Integer Public ContentType As Integer
Public URL As String Public URL As String
Public MD5 As String Public MD5 As String
@@ -26,5 +26,6 @@ Namespace Plugin
Public PostID As String Public PostID As String
Public PostDate As Date? Public PostDate As Date?
Public SpecialFolder As String Public SpecialFolder As String
Public Attempts As Integer
End Structure End Structure
End Namespace End Namespace

View File

@@ -11,12 +11,18 @@ Imports PersonalUtilities.Tools.WEB
Imports SCrawler.Plugin Imports SCrawler.Plugin
Imports Download = SCrawler.Plugin.ISiteSettings.Download Imports Download = SCrawler.Plugin.ISiteSettings.Download
Namespace API.Base Namespace API.Base
Friend MustInherit Class SiteSettingsBase : Implements ISiteSettings Friend MustInherit Class SiteSettingsBase : Implements ISiteSettings, IResponserContainer
Friend ReadOnly Property Site As String Implements ISiteSettings.Site Friend ReadOnly Property Site As String Implements ISiteSettings.Site
Friend Overridable ReadOnly Property Icon As Icon Implements ISiteSettings.Icon Friend Overridable ReadOnly Property Icon As Icon Implements ISiteSettings.Icon
Friend Overridable ReadOnly Property Image As Image Implements ISiteSettings.Image Friend Overridable ReadOnly Property Image As Image Implements ISiteSettings.Image
Private Property Logger As ILogProvider = LogConnector Implements ISiteSettings.Logger Private Property Logger As ILogProvider = LogConnector Implements ISiteSettings.Logger
Friend Overridable ReadOnly Property Responser As Response Friend Overridable ReadOnly Property Responser As Response
Private Property IResponserContainer_Responser As Response Implements IResponserContainer.Responser
Get
Return Responser
End Get
Set : End Set
End Property
Friend MustOverride Function GetInstance(ByVal What As Download) As IPluginContentProvider Implements ISiteSettings.GetInstance Friend MustOverride Function GetInstance(ByVal What As Download) As IPluginContentProvider Implements ISiteSettings.GetInstance
Friend Sub New(ByVal SiteName As String) Friend Sub New(ByVal SiteName As String)
Site = SiteName Site = SiteName
@@ -25,7 +31,15 @@ Namespace API.Base
Site = SiteName Site = SiteName
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml") Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
With Responser With Responser
If .File.Exists Then .LoadSettings() Else .CookiesDomain = CookiesDomain : .Cookies = New CookieKeeper(.CookiesDomain) : .SaveSettings() If .File.Exists Then
If EncryptCookies.CookiesEncrypted Then .CookiesEncryptKey = SettingsCLS.CookieEncryptKey
.LoadSettings()
Else
.CookiesDomain = CookiesDomain
.Cookies = New CookieKeeper(.CookiesDomain) With {.EncryptKey = SettingsCLS.CookieEncryptKey}
.CookiesEncryptKey = SettingsCLS.CookieEncryptKey
.SaveSettings()
End If
End With End With
End Sub End Sub
#Region "XML" #Region "XML"
@@ -36,6 +50,7 @@ Namespace API.Base
Friend Overridable Sub BeginInit() Implements ISiteSettings.BeginInit Friend Overridable Sub BeginInit() Implements ISiteSettings.BeginInit
End Sub End Sub
Friend Overridable Sub EndInit() Implements ISiteSettings.EndInit Friend Overridable Sub EndInit() Implements ISiteSettings.EndInit
EncryptCookies.ValidateCookiesEncrypt(Responser)
End Sub End Sub
Friend Overridable Sub BeginUpdate() Implements ISiteSettings.BeginUpdate Friend Overridable Sub BeginUpdate() Implements ISiteSettings.BeginUpdate
End Sub End Sub
@@ -63,6 +78,9 @@ Namespace API.Base
End If End If
Return String.Empty Return String.Empty
End Function End Function
Friend Overridable Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String Implements ISiteSettings.GetUserPostUrl
Return String.Empty
End Function
Protected UserRegex As RParams = Nothing Protected UserRegex As RParams = Nothing
Friend Overridable Function IsMyUser(ByVal UserURL As String) As ExchangeOptions Implements ISiteSettings.IsMyUser Friend Overridable Function IsMyUser(ByVal UserURL As String) As ExchangeOptions Implements ISiteSettings.IsMyUser
Try Try

View File

@@ -18,7 +18,7 @@ Namespace API.Base
GIF = 50 GIF = 50
m3u8 = 100 m3u8 = 100
End Enum End Enum
Friend Enum States As Integer : Unknown = 0 : Tried = 1 : Downloaded = 2 : Skipped = 3 : End Enum Friend Enum States As Integer : Unknown = 0 : Tried = 1 : Downloaded = 2 : Skipped = 3 : Missing = 4 : End Enum
Friend [Type] As Types Friend [Type] As Types
Friend URL_BASE As String Friend URL_BASE As String
Friend URL As String Friend URL As String
@@ -27,6 +27,7 @@ Namespace API.Base
Friend Post As UserPost Friend Post As UserPost
Friend PictureOption As String Friend PictureOption As String
Friend State As States Friend State As States
Friend Attempts As Integer
''' <summary> ''' <summary>
''' SomeFolder<br/> ''' SomeFolder<br/>
''' SomeFolder\SomeFolder2 ''' SomeFolder\SomeFolder2
@@ -51,6 +52,7 @@ Namespace API.Base
Post = New UserPost With {.ID = m.PostID, .[Date] = m.PostDate} Post = New UserPost With {.ID = m.PostID, .[Date] = m.PostDate}
State = m.DownloadState State = m.DownloadState
SpecialFolder = m.SpecialFolder SpecialFolder = m.SpecialFolder
Attempts = m.Attempts
End If End If
End Sub End Sub
Public Shared Widening Operator CType(ByVal _URL As String) As UserMedia Public Shared Widening Operator CType(ByVal _URL As String) As UserMedia
@@ -71,7 +73,8 @@ Namespace API.Base
.URL = URL, .URL = URL,
.SpecialFolder = SpecialFolder, .SpecialFolder = SpecialFolder,
.PostID = Post.ID, .PostID = Post.ID,
.PostDate = Post.Date .PostDate = Post.Date,
.Attempts = Attempts
} }
End Function End Function
Friend Overloads Function Equals(ByVal Other As UserMedia) As Boolean Implements IEquatable(Of UserMedia).Equals Friend Overloads Function Equals(ByVal Other As UserMedia) As Boolean Implements IEquatable(Of UserMedia).Equals

View File

@@ -127,6 +127,8 @@ Namespace API.Base
Private Const Name_DataMerging As String = "DataMerging" Private Const Name_DataMerging As String = "DataMerging"
#Region "Downloaded data" #Region "Downloaded data"
Private Const Name_MediaType As String = "Type" Private Const Name_MediaType As String = "Type"
Private Const Name_MediaState As String = "State"
Private Const Name_MediaAttempts As String = "Attempts"
Private Const Name_MediaURL As String = "URL" Private Const Name_MediaURL As String = "URL"
Private Const Name_MediaHash As String = "Hash" Private Const Name_MediaHash As String = "Hash"
Private Const Name_MediaFile As String = "File" Private Const Name_MediaFile As String = "File"
@@ -358,10 +360,31 @@ BlockNullPicture:
Friend Overridable Property ReadyForDownload As Boolean = True Implements IUserData.ReadyForDownload Friend Overridable Property ReadyForDownload As Boolean = True Implements IUserData.ReadyForDownload
Friend Property DownloadImages As Boolean = True Implements IUserData.DownloadImages Friend Property DownloadImages As Boolean = True Implements IUserData.DownloadImages
Friend Property DownloadVideos As Boolean = True Implements IUserData.DownloadVideos Friend Property DownloadVideos As Boolean = True Implements IUserData.DownloadVideos
Friend Property DownloadMissingOnly As Boolean = False Implements IUserData.DownloadMissingOnly
#End Region #End Region
#Region "Content" #Region "Content"
Protected ReadOnly _ContentList As List(Of UserMedia) Protected ReadOnly _ContentList As List(Of UserMedia)
Protected ReadOnly _ContentNew As List(Of UserMedia) Protected ReadOnly _ContentNew As List(Of UserMedia)
Friend ReadOnly Property LatestData As List(Of UserMedia)
Protected ReadOnly MissingFinder As Predicate(Of UserMedia) = Function(c) c.State = UStates.Missing
Friend ReadOnly Property ContentMissing As List(Of UserMedia)
Get
If _ContentList.Count > 0 Then
Return _ContentList.Where(Function(c) MissingFinder(c)).ListIfNothing
Else
Return New List(Of UserMedia)
End If
End Get
End Property
Friend Overridable ReadOnly Property ContentMissingExists As Boolean
Get
Return _ContentList.Exists(MissingFinder)
End Get
End Property
Friend Sub RemoveMedia(ByVal m As UserMedia, ByVal State As UStates?)
Dim i% = If(State.HasValue, _ContentList.FindIndex(Function(mm) mm.State = State.Value And mm.Equals(m)), _ContentList.IndexOf(m))
If i >= 0 Then _ContentList.RemoveAt(i)
End Sub
Protected ReadOnly _TempMediaList As List(Of UserMedia) Protected ReadOnly _TempMediaList As List(Of UserMedia)
Protected ReadOnly _TempPostsList As List(Of String) Protected ReadOnly _TempPostsList As List(Of String)
Friend Function GetLastImageAddress() As SFile Friend Function GetLastImageAddress() As SFile
@@ -527,23 +550,31 @@ BlockNullPicture:
End Function End Function
Friend Overridable ReadOnly Property FitToAddParams As Boolean Implements IUserData.FitToAddParams Friend Overridable ReadOnly Property FitToAddParams As Boolean Implements IUserData.FitToAddParams
Get Get
If Settings.LastUpdatedDate.HasValue AndAlso LastUpdated.HasValue AndAlso With Settings
LastUpdated.Value.Date > Settings.LastUpdatedDate.Value.Date Then Return False If LastUpdated.HasValue And Not .ViewDateMode.Value = ShowingDates.Off Then
If Not Settings.Labels.ExcludedIgnore AndAlso Settings.Labels.Excluded.ValuesList.ListContains(Labels) Then Return False Dim f As Date = If(.ViewDateFrom.HasValue, .ViewDateFrom.Value.Date, Date.MinValue.Date)
If Settings.SelectedSites.Count = 0 OrElse Settings.SelectedSites.Contains(Site) Then Dim t As Date = If(.ViewDateTo.HasValue, .ViewDateTo.Value.Date, Date.MaxValue.Date)
Select Case Settings.ShowingMode.Value Select Case DirectCast(.ViewDateMode.Value, ShowingDates)
Case ShowingModes.Regular : Return Not Temporary And Not Favorite Case ShowingDates.In : If Not LastUpdated.Value.ValueBetween(f, t) Then Return False
Case ShowingModes.Temporary : Return Temporary Case ShowingDates.Not : If LastUpdated.Value.ValueBetween(f, t) Then Return False
Case ShowingModes.Favorite : Return Favorite End Select
Case ShowingModes.Deleted : Return Not UserExists End If
Case ShowingModes.Suspended : Return UserSuspended If Not .Labels.ExcludedIgnore AndAlso .Labels.Excluded.ValuesList.ListContains(Labels) Then Return False
Case ShowingModes.Labels : Return Settings.Labels.Current.ValuesList.ListContains(Labels) If .SelectedSites.Count = 0 OrElse .SelectedSites.Contains(Site) Then
Case ShowingModes.NoLabels : Return Labels.Count = 0 Select Case .ShowingMode.Value
Case Else : Return True Case ShowingModes.Regular : Return Not Temporary And Not Favorite
End Select Case ShowingModes.Temporary : Return Temporary
Else Case ShowingModes.Favorite : Return Favorite
Return False Case ShowingModes.Deleted : Return Not UserExists
End If Case ShowingModes.Suspended : Return UserSuspended
Case ShowingModes.Labels : Return Settings.Labels.Current.ValuesList.ListContains(Labels)
Case ShowingModes.NoLabels : Return Labels.Count = 0
Case Else : Return True
End Select
Else
Return False
End If
End With
End Get End Get
End Property End Property
Friend Function GetLVIGroup(ByVal Destination As ListView) As ListViewGroup Implements IUserData.GetLVIGroup Friend Function GetLVIGroup(ByVal Destination As ListView) As ListViewGroup Implements IUserData.GetLVIGroup
@@ -568,11 +599,12 @@ BlockNullPicture:
Friend Sub New(Optional ByVal InvokeImageHandler As Boolean = True) Friend Sub New(Optional ByVal InvokeImageHandler As Boolean = True)
_ContentList = New List(Of UserMedia) _ContentList = New List(Of UserMedia)
_ContentNew = New List(Of UserMedia) _ContentNew = New List(Of UserMedia)
LatestData = New List(Of UserMedia)
_TempMediaList = New List(Of UserMedia) _TempMediaList = New List(Of UserMedia)
_TempPostsList = New List(Of String) _TempPostsList = New List(Of String)
Labels = New List(Of String) Labels = New List(Of String)
UserUpdatedEventHandlers = New List(Of IUserData.UserUpdatedEventHandler) UserUpdatedEventHandlers = New List(Of IUserData.UserUpdatedEventHandler)
If InvokeImageHandler Then ImageHandler(Me) If InvokeImageHandler Then MainFrameObj.ImageHandler(Me)
End Sub End Sub
Friend Sub SetEnvironment(ByRef h As SettingsHost, ByVal u As UserInfo, ByVal _LoadUserInformation As Boolean, Friend Sub SetEnvironment(ByRef h As SettingsHost, ByVal u As UserInfo, ByVal _LoadUserInformation As Boolean,
Optional ByVal AttachUserInfo As Boolean = True) Implements IUserData.SetEnvironment Optional ByVal AttachUserInfo As Boolean = True) Implements IUserData.SetEnvironment
@@ -583,13 +615,29 @@ BlockNullPicture:
End If End If
End Sub End Sub
''' <exception cref="ArgumentOutOfRangeException"></exception> ''' <exception cref="ArgumentOutOfRangeException"></exception>
Friend Overloads Shared Function GetInstance(ByVal u As UserInfo, Optional ByVal _LoadUserInformation As Boolean = True) As IUserData Friend Shared Function GetInstance(ByVal u As UserInfo, Optional ByVal _LoadUserInformation As Boolean = True) As IUserData
If Not u.Plugin.IsEmptyString Then If Not u.Plugin.IsEmptyString Then
Return Settings(u.Plugin).GetInstance(u.DownloadOption, u, _LoadUserInformation) Return Settings(u.Plugin).GetInstance(u.DownloadOption, u, _LoadUserInformation)
Else Else
Throw New ArgumentOutOfRangeException("Plugin", $"Plugin [{u.Plugin}] information does not recognized by loader") Throw New ArgumentOutOfRangeException("Plugin", $"Plugin [{u.Plugin}] information does not recognized by loader")
End If End If
End Function End Function
Friend Shared Function GetPostUrl(ByVal u As IUserData, ByVal PostData As UserMedia) As String
Dim uName$ = String.Empty
Try
If Not u Is Nothing AndAlso Not u.IsCollection Then
With DirectCast(u, UserDataBase)
If Not .User.Plugin.IsEmptyString Then
uName = .User.Name
Return Settings(.User.Plugin).GetUserPostUrl(.ID, PostData.Post.ID)
End If
End With
End If
Return String.Empty
Catch ex As Exception
Return ErrorsDescriber.Execute(EDP.SendInLog, ex, $"GetPostUrl({uName}, {PostData.Post.ID})", String.Empty)
End Try
End Function
#End Region #End Region
#Region "Information & Content data files loader and saver" #Region "Information & Content data files loader and saver"
#Region "User information" #Region "User information"
@@ -676,19 +724,22 @@ BlockNullPicture:
Protected MustOverride Sub LoadUserInformation_OptionalFields(ByRef Container As XmlFile, ByVal Loading As Boolean) Protected MustOverride Sub LoadUserInformation_OptionalFields(ByRef Container As XmlFile, ByVal Loading As Boolean)
#End Region #End Region
#Region "User data" #Region "User data"
Friend Overridable Overloads Sub LoadContentInformation() Friend Overridable Overloads Sub LoadContentInformation(Optional ByVal Force As Boolean = False)
Try Try
UpdateDataFiles() UpdateDataFiles()
If Not MyFileData.Exists Then Exit Sub If Not MyFileData.Exists Or (_DataLoaded And Not Force) Then Exit Sub
Using x As New XmlFile(MyFileData, Protector.Modes.All, False) With {.XmlReadOnly = True, .AllowSameNames = True} Using x As New XmlFile(MyFileData, Protector.Modes.All, False) With {.XmlReadOnly = True, .AllowSameNames = True}
x.LoadData() x.LoadData()
If x.Count > 0 Then If x.Count > 0 Then
Dim fs$ = MyFile.CutPath.PathWithSeparator Dim fs$ = MyFile.CutPath.PathWithSeparator
Dim gfn As Func(Of String, String) = Function(Input) If(Input.IsEmptyString, String.Empty, Dim gfn As Func(Of String, String) = Function(Input) If(Input.IsEmptyString, String.Empty,
If(Input.Contains("\"), Input.CSFile.File, Input)) If(Input.Contains("\"), Input.CSFile.File, Input))
For Each v As EContainer In x For Each v As EContainer In x
_ContentList.Add(New UserMedia With { _ContentList.Add(New UserMedia With {
.Type = AConvert(Of Integer)(v.Attribute(Name_MediaType).Value, 0), .Type = v.Attribute(Name_MediaType).Value.FromXML(Of Integer)(CInt(UTypes.Undefined)),
.State = v.Attribute(Name_MediaState).Value.FromXML(Of Integer)(CInt(UStates.Downloaded)),
.Attempts = v.Attribute(Name_MediaAttempts).Value.FromXML(Of Integer)(0),
.URL = v.Attribute(Name_MediaURL).Value, .URL = v.Attribute(Name_MediaURL).Value,
.URL_BASE = v.Value, .URL_BASE = v.Value,
.MD5 = v.Attribute(Name_MediaHash).Value, .MD5 = v.Attribute(Name_MediaHash).Value,
@@ -715,6 +766,8 @@ BlockNullPicture:
If _ContentList.Count > 0 Then If _ContentList.Count > 0 Then
For Each i As UserMedia In _ContentList For Each i As UserMedia In _ContentList
x.Add(New EContainer("MediaData", i.URL_BASE, {New EAttribute(Name_MediaType, CInt(i.Type)), x.Add(New EContainer("MediaData", i.URL_BASE, {New EAttribute(Name_MediaType, CInt(i.Type)),
New EAttribute(Name_MediaState, CInt(i.State)),
New EAttribute(Name_MediaAttempts, i.Attempts),
New EAttribute(Name_MediaURL, i.URL), New EAttribute(Name_MediaURL, i.URL),
New EAttribute(Name_MediaHash, i.MD5), New EAttribute(Name_MediaHash, i.MD5),
New EAttribute(Name_MediaFile, i.File.File), New EAttribute(Name_MediaFile, i.File.File),
@@ -747,9 +800,52 @@ BlockNullPicture:
GlobalOpenPath(MyFile.CutPath) GlobalOpenPath(MyFile.CutPath)
End Sub End Sub
#End Region #End Region
#Region "Download functions and options" #Region "Download limits"
Protected Enum DateResult : [Continue] : [Skip] : [Exit] : End Enum
Friend Overridable Property DownloadTopCount As Integer? = Nothing Implements IUserData.DownloadTopCount, IPluginContentProvider.PostsNumberLimit Friend Overridable Property DownloadTopCount As Integer? = Nothing Implements IUserData.DownloadTopCount, IPluginContentProvider.PostsNumberLimit
Friend Overridable Property DownloadToDate As Date? = Nothing Implements IUserData.DownloadToDate, IPluginContentProvider.PostsDateLimit Private _DownloadDateFrom As Date? = Nothing
Private _DownloadDateFromF As Date
Friend Overridable Property DownloadDateFrom As Date? Implements IUserData.DownloadDateFrom, IPluginContentProvider.DownloadDateFrom
Get
Return _DownloadDateFrom
End Get
Set(ByVal d As Date?)
_DownloadDateFrom = d
If _DownloadDateFrom.HasValue Then _DownloadDateFromF = _DownloadDateFrom.Value.Date Else _DownloadDateFromF = Date.MinValue.Date
End Set
End Property
Private _DownloadDateTo As Date? = Nothing
Private _DownloadDateToF As Date
Friend Overridable Property DownloadDateTo As Date? Implements IUserData.DownloadDateTo, IPluginContentProvider.DownloadDateTo
Get
Return _DownloadDateTo
End Get
Set(ByVal d As Date?)
_DownloadDateTo = d
If _DownloadDateTo.HasValue Then _DownloadDateToF = _DownloadDateTo.Value Else _DownloadDateToF = Date.MaxValue.Date
End Set
End Property
Protected Function CheckDatesLimit(ByVal DateString As String, ByVal DateProvider As IFormatProvider) As DateResult
Try
If (DownloadDateFrom.HasValue Or DownloadDateTo.HasValue) And Not DateString.IsEmptyString Then
Dim td As Date? = AConvert(Of Date)(DateString, DateProvider, Nothing)
If td.HasValue Then
If td.Value.ValueBetween(_DownloadDateFromF, _DownloadDateToF) Then
Return DateResult.Continue
ElseIf td.Value > _DownloadDateToF Then
Return DateResult.Skip
Else
Return DateResult.Exit
End If
End If
End If
Return DateResult.Continue
Catch ex As Exception
Return ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[UserDataBase.CheckDatesLimit({DateString})]", DateResult.Continue)
End Try
End Function
#End Region
#Region "Download functions and options"
Protected Responser As Response Protected Responser As Response
Friend Overridable Sub DownloadData(ByVal Token As CancellationToken) Implements IContentProvider.DownloadData Friend Overridable Sub DownloadData(ByVal Token As CancellationToken) Implements IContentProvider.DownloadData
Dim Canceled As Boolean = False Dim Canceled As Boolean = False
@@ -764,6 +860,7 @@ BlockNullPicture:
Dim UpPic As Boolean = Settings.ViewModeIsPicture AndAlso GetPicture(Of Image)(False) Is Nothing Dim UpPic As Boolean = Settings.ViewModeIsPicture AndAlso GetPicture(Of Image)(False) Is Nothing
Dim sEnvir() As Boolean = {UserExists, UserSuspended} Dim sEnvir() As Boolean = {UserExists, UserSuspended}
Dim EnvirChanged As Func(Of Boolean) = Function() Not sEnvir(0) = UserExists Or Not sEnvir(1) = UserSuspended Dim EnvirChanged As Func(Of Boolean) = Function() Not sEnvir(0) = UserExists Or Not sEnvir(1) = UserSuspended
Dim _downContent As Func(Of UserMedia, Boolean) = Function(c) c.State = UStates.Downloaded
UserExists = True UserExists = True
UserSuspended = False UserSuspended = False
DownloadedPictures(False) = 0 DownloadedPictures(False) = 0
@@ -772,19 +869,26 @@ BlockNullPicture:
_TempPostsList.Clear() _TempPostsList.Clear()
Dim __SaveData As Boolean = Not CreatedByChannel Or Not Settings.FromChannelDownloadTopUse Dim __SaveData As Boolean = Not CreatedByChannel Or Not Settings.FromChannelDownloadTopUse
If Not _DataLoaded Then LoadContentInformation() LoadContentInformation()
If MyFilePosts.Exists Then _TempPostsList.ListAddList(File.ReadAllLines(MyFilePosts)) If MyFilePosts.Exists Then _TempPostsList.ListAddList(File.ReadAllLines(MyFilePosts))
If _ContentList.Count > 0 Then _TempPostsList.ListAddList(_ContentList.Select(Function(u) u.Post.ID), LNC) If _ContentList.Count > 0 Then _TempPostsList.ListAddList(_ContentList.Select(Function(u) u.Post.ID), LNC)
ThrowAny(Token) If Not DownloadMissingOnly Then
DownloadDataF(Token) ThrowAny(Token)
ThrowAny(Token) DownloadDataF(Token)
ThrowAny(Token)
Else
'PENDING: UserDataBase ReparseMissing (DownloadDataF)
'ReparseMissing(Token)
End If
'_TempMediaList.ListAddList(ContentMissing, LNC)
If _TempMediaList.Count > 0 Then If _TempMediaList.Count > 0 Then
If Not DownloadImages Then _TempMediaList.RemoveAll(Function(m) m.Type = UTypes.GIF Or m.Type = UTypes.Picture) If Not DownloadImages Then _TempMediaList.RemoveAll(Function(m) m.Type = UTypes.GIF Or m.Type = UTypes.Picture)
If Not DownloadVideos Then _TempMediaList.RemoveAll(Function(m) m.Type = UTypes.Video Or If Not DownloadVideos Then _TempMediaList.RemoveAll(Function(m) m.Type = UTypes.Video Or
m.Type = UTypes.VideoPre Or m.Type = UTypes.m3u8) m.Type = UTypes.VideoPre Or m.Type = UTypes.m3u8)
If DownloadMissingOnly Then _TempMediaList.RemoveAll(Function(m) Not m.State = UStates.Missing)
End If End If
ReparseVideo(Token) ReparseVideo(Token)
@@ -793,8 +897,12 @@ BlockNullPicture:
_ContentNew.ListAddList(_TempMediaList, LAP.ClearBeforeAdd) _ContentNew.ListAddList(_TempMediaList, LAP.ClearBeforeAdd)
DownloadContent(Token) DownloadContent(Token)
ThrowIfDisposed() ThrowIfDisposed()
_ContentList.ListAddList(_ContentNew.Where(Function(c) c.State = UStates.Downloaded), LNC)
If DownloadedTotal(False) > 0 Or EnvirChanged.Invoke Then LatestData.ListAddList(_ContentNew.Where(_downContent), LNC)
Dim mcb& = If(ContentMissingExists, _ContentList.LongCount(Function(c) MissingFinder(c)), 0)
_ContentList.ListAddList(_ContentNew.Where(Function(c) _downContent(c) Or MissingFinder(c)), LNC)
Dim mca& = If(ContentMissingExists, _ContentList.LongCount(Function(c) MissingFinder(c)), 0)
If DownloadedTotal(False) > 0 Or EnvirChanged.Invoke Or Not mcb = mca Then
If __SaveData Then If __SaveData Then
LastUpdated = Now LastUpdated = Now
RunScript() RunScript()
@@ -827,20 +935,11 @@ BlockNullPicture:
If Not Canceled Then _DataParsed = True If Not Canceled Then _DataParsed = True
_ContentNew.Clear() _ContentNew.Clear()
DownloadTopCount = Nothing DownloadTopCount = Nothing
DownloadToDate = Nothing DownloadDateFrom = Nothing
DownloadDateTo = Nothing
DownloadMissingOnly = False
End Try End Try
End Sub End Sub
Protected Function CheckDatesLimit(ByVal DateString As String, ByVal DateProvider As IFormatProvider) As Boolean
Try
If DownloadToDate.HasValue And Not DateString.IsEmptyString Then
Dim td As Date? = AConvert(Of Date)(DateString, DateProvider, Nothing)
If td.HasValue Then Return td.Value < DownloadToDate.Value
End If
Return True
Catch ex As Exception
Return ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[UserDataBase.CheckDatesLimit({DateString})]", True)
End Try
End Function
Protected Sub UpdateDataFiles() Protected Sub UpdateDataFiles()
If Not User.File.IsEmptyString Then If Not User.File.IsEmptyString Then
MyFileData = User.File MyFileData = User.File
@@ -853,7 +952,10 @@ BlockNullPicture:
End If End If
End Sub End Sub
Protected MustOverride Sub DownloadDataF(ByVal Token As CancellationToken) Protected MustOverride Sub DownloadDataF(ByVal Token As CancellationToken)
Protected MustOverride Sub ReparseVideo(ByVal Token As CancellationToken) Protected Overridable Sub ReparseVideo(ByVal Token As CancellationToken)
End Sub
Protected Overridable Sub ReparseMissing(ByVal Token As CancellationToken)
End Sub
Protected MustOverride Sub DownloadContent(ByVal Token As CancellationToken) Protected MustOverride Sub DownloadContent(ByVal Token As CancellationToken)
Protected Sub DownloadContentDefault(ByVal Token As CancellationToken) Protected Sub DownloadContentDefault(ByVal Token As CancellationToken)
Try Try
@@ -864,6 +966,7 @@ BlockNullPicture:
_ContentNew.RemoveAll(Function(c) c.URL.IsEmptyString) _ContentNew.RemoveAll(Function(c) c.URL.IsEmptyString)
If _ContentNew.Count > 0 Then If _ContentNew.Count > 0 Then
MyFile.Exists(SFO.Path) MyFile.Exists(SFO.Path)
Dim MissingErrorsAdd As Boolean = Settings.AddMissingErrorsToLog
Dim MyDir$ = MyFile.CutPath.PathNoSeparator Dim MyDir$ = MyFile.CutPath.PathNoSeparator
Dim vsf As Boolean = SeparateVideoFolderF Dim vsf As Boolean = SeparateVideoFolderF
Dim __isVideo As Boolean Dim __isVideo As Boolean
@@ -871,7 +974,7 @@ BlockNullPicture:
Dim v As UserMedia Dim v As UserMedia
Using w As New WebClient Using w As New WebClient
If vsf Then SFileShares.SFileExists($"{MyDir}\Video\", SFO.Path) If vsf Then SFileShares.SFileExists($"{MyDir}\Video\", SFO.Path)
Progress.TotalCount += _ContentNew.Count Progress.Maximum += _ContentNew.Count
For i = 0 To _ContentNew.Count - 1 For i = 0 To _ContentNew.Count - 1
ThrowAny(Token) ThrowAny(Token)
v = _ContentNew(i) v = _ContentNew(i)
@@ -922,7 +1025,9 @@ BlockNullPicture:
v.State = UStates.Downloaded v.State = UStates.Downloaded
dCount += 1 dCount += 1
Catch wex As Exception Catch wex As Exception
ErrorDownloading(f, v.URL_BASE) v.Attempts += 1
v.State = UStates.Missing
If MissingErrorsAdd Then ErrorDownloading(f, v.URL_BASE)
End Try End Try
Else Else
v.State = UStates.Skipped v.State = UStates.Skipped
@@ -996,14 +1101,14 @@ BlockNullPicture:
End Try End Try
End Sub End Sub
#End Region #End Region
#Region "Delete, Move, Merge" #Region "Delete, Move, Merge, Copy"
Friend Overridable Function Delete() As Integer Implements IUserData.Delete Friend Overridable Function Delete() As Integer Implements IUserData.Delete
Dim f As SFile = SFile.GetPath(MyFile.CutPath.Path) Dim f As SFile = SFile.GetPath(MyFile.CutPath.Path)
If f.Exists(SFO.Path, False) AndAlso (User.Merged OrElse f.Delete(SFO.Path, Settings.DeleteMode)) Then If f.Exists(SFO.Path, False) AndAlso (User.Merged OrElse f.Delete(SFO.Path, Settings.DeleteMode)) Then
ImageHandler(Me, False) If Not IncludedInCollection Then MainFrameObj.ImageHandler(Me, False)
Settings.UsersList.Remove(User) Settings.UsersList.Remove(User)
Settings.UpdateUsersList() Settings.UpdateUsersList()
Settings.Users.Remove(Me) If Not IncludedInCollection Then Settings.Users.Remove(Me)
Downloader.UserRemove(Me) Downloader.UserRemove(Me)
Dispose(True) Dispose(True)
Return 1 Return 1
@@ -1120,6 +1225,48 @@ BlockNullPicture:
End If End If
Return f Return f
End Function End Function
Private Class FilesCopyingException : Inherits ErrorsDescriberException
Friend Sub New(ByVal User As IUserData, ByVal Msg As String, ByVal Path As SFile)
SendInLogOnlyMessage = True
If User.IncludedInCollection Then _MainMessage = $"[{User.CollectionName}] - "
_MainMessage &= $"[{User.Site}] - [{User.Name}]. {Msg}: {Path.Path}."
End Sub
End Class
Friend Overridable Function CopyFiles(ByVal DestinationPath As SFile, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean Implements IUserData.CopyFiles
Dim fSource As SFile = Nothing
Dim fDest As SFile = Nothing
Try
Dim pOffset%
If IncludedInCollection Then
If DataMerging Then pOffset = 1 Else pOffset = 2
Else
pOffset = 1
End If
fSource = User.File.CutPath(pOffset).Path.CSFileP
Dim OptPath$ = String.Empty
If IncludedInCollection Then
OptPath = $"Collections\{CollectionName}" 'Copying a collection based on the first file
Else
OptPath = $"{Site}\{Name}"
End If
fDest = $"{DestinationPath.PathWithSeparator}{OptPath}".CSFileP
If fDest.Exists(SFO.Path, False) AndAlso MsgBoxE({$"The following path already exists:{vbCr}{fDest.Path}" & vbCr &
"Do you want to copy files here?", "Copying files"}, vbExclamation + vbYesNo) = vbNo Then _
Throw New FilesCopyingException(Me, "The following path already exists", fDest)
If DestinationPath.Exists(SFO.Path, True) Then
My.Computer.FileSystem.CopyDirectory(fSource, fDest, FileIO.UIOption.OnlyErrorDialogs, FileIO.UICancelOption.ThrowException)
Else
Throw New FilesCopyingException(Me, "Cannot create the following path", fDest)
End If
Return True
Catch cex As OperationCanceledException
Return ErrorsDescriber.Execute(e, New FilesCopyingException(Me, "Copy canceled", fDest),, False)
Catch ex As Exception
Return ErrorsDescriber.Execute(e, ex,, False)
End Try
End Function
#End Region #End Region
#Region "Errors functions" #Region "Errors functions"
Protected Sub LogError(ByVal ex As Exception, ByVal Message As String) Protected Sub LogError(ByVal ex As Exception, ByVal Message As String)
@@ -1150,6 +1297,16 @@ BlockNullPicture:
Return IIf(FriendlyName.IsEmptyString, Name, FriendlyName) Return IIf(FriendlyName.IsEmptyString, Name, FriendlyName)
End If End If
End Function End Function
Public Overrides Function GetHashCode() As Integer
Dim hcStr$
If Not CollectionName.IsEmptyString Then
hcStr = CollectionName
Else
hcStr = IIf(FriendlyName.IsEmptyString, Name, FriendlyName)
End If
If hcStr.IsEmptyString Then hcStr = LVIKey
Return hcStr.GetHashCode
End Function
#Region "Buttons actions" #Region "Buttons actions"
Private Sub BTT_CONTEXT_DOWN_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_DOWN.Click Private Sub BTT_CONTEXT_DOWN_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_DOWN.Click
Downloader.Add(Me) Downloader.Add(Me)
@@ -1205,6 +1362,7 @@ BlockNullPicture:
If disposing Then If disposing Then
_ContentList.Clear() _ContentList.Clear()
_ContentNew.Clear() _ContentNew.Clear()
LatestData.Clear()
_TempMediaList.Clear() _TempMediaList.Clear()
_TempPostsList.Clear() _TempPostsList.Clear()
If Not Responser Is Nothing Then Responser.Dispose() If Not Responser Is Nothing Then Responser.Dispose()
@@ -1268,6 +1426,7 @@ BlockNullPicture:
ReadOnly Property Key As String ReadOnly Property Key As String
Property DownloadImages As Boolean Property DownloadImages As Boolean
Property DownloadVideos As Boolean Property DownloadVideos As Boolean
Property DownloadMissingOnly As Boolean
Property ScriptUse As Boolean Property ScriptUse As Boolean
Property ScriptData As String Property ScriptData As String
Function GetLVI(ByVal Destination As ListView) As ListViewItem Function GetLVI(ByVal Destination As ListView) As ListViewItem
@@ -1282,10 +1441,12 @@ BlockNullPicture:
''' </summary> ''' </summary>
Function Delete() As Integer Function Delete() As Integer
Function MoveFiles(ByVal CollectionName As String) As Boolean Function MoveFiles(ByVal CollectionName As String) As Boolean
Function CopyFiles(ByVal DestinationPath As SFile, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean
Sub OpenFolder() Sub OpenFolder()
ReadOnly Property Self As IUserData ReadOnly Property Self As IUserData
Property DownloadTopCount As Integer? Property DownloadTopCount As Integer?
Property DownloadToDate As Date? Property DownloadDateFrom As Date?
Property DownloadDateTo As Date?
Sub SetEnvironment(ByRef h As SettingsHost, ByVal u As UserInfo, ByVal _LoadUserInformation As Boolean, Sub SetEnvironment(ByRef h As SettingsHost, ByVal u As UserInfo, ByVal _LoadUserInformation As Boolean,
Optional ByVal AttachUserInfo As Boolean = True) Optional ByVal AttachUserInfo As Boolean = True)
ReadOnly Property Disposed As Boolean ReadOnly Property Disposed As Boolean

View File

@@ -186,30 +186,23 @@ Namespace API.Instagram
End With End With
End Sub End Sub
#End Region #End Region
Friend Overrides ReadOnly Property Responser As Response
Private Initialized As Boolean = False Private Initialized As Boolean = False
#End Region #End Region
#Region "Initializer" #Region "Initializer"
Friend Sub New(ByRef _XML As XmlFile, ByVal GlobalPath As SFile) Friend Sub New(ByRef _XML As XmlFile, ByVal GlobalPath As SFile)
MyBase.New(InstagramSite) MyBase.New(InstagramSite, "instagram.com")
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
Dim app_id$ = String.Empty Dim app_id$ = String.Empty
Dim www_claim$ = String.Empty Dim www_claim$ = String.Empty
Dim token$ = String.Empty Dim token$ = String.Empty
With Responser With Responser
If .File.Exists Then If .Headers.Count > 0 Then
.LoadSettings()
With .Headers With .Headers
If .ContainsKey(Header_CSRF_TOKEN) Then token = .Item(Header_CSRF_TOKEN) If .ContainsKey(Header_CSRF_TOKEN) Then token = .Item(Header_CSRF_TOKEN)
If .ContainsKey(Header_IG_APP_ID) Then app_id = .Item(Header_IG_APP_ID) If .ContainsKey(Header_IG_APP_ID) Then app_id = .Item(Header_IG_APP_ID)
If .ContainsKey(Header_IG_WWW_CLAIM) Then www_claim = .Item(Header_IG_WWW_CLAIM) If .ContainsKey(Header_IG_WWW_CLAIM) Then www_claim = .Item(Header_IG_WWW_CLAIM)
End With End With
Else
.CookiesDomain = "instagram.com"
.Cookies = New CookieKeeper(.CookiesDomain)
.SaveSettings()
End If End If
End With End With
@@ -240,7 +233,7 @@ Namespace API.Instagram
LastDownloadDate = New XMLValue(Of Date)("LastDownloadDate", Now.AddDays(-1), _XML, n) LastDownloadDate = New XMLValue(Of Date)("LastDownloadDate", Now.AddDays(-1), _XML, n)
LastRequestsCount = New XMLValue(Of Integer)("LastRequestsCount", 0, _XML, n) LastRequestsCount = New XMLValue(Of Integer)("LastRequestsCount", 0, _XML, n)
LastRequestsCountLabel = New PropertyValue(LastRequestsCountLabelStr.Invoke(LastRequestsCount.Value)) LastRequestsCountLabel = New PropertyValue(LastRequestsCountLabelStr.Invoke(LastRequestsCount.Value))
AddHandler LastRequestsCount.OnValueChanged, Sub(sender, __name, __value) LastRequestsCountLabel.Value = LastRequestsCountLabelStr.Invoke(__value) AddHandler LastRequestsCount.OnValueChanged, Sub(sender, __name, __value) LastRequestsCountLabel.Value = LastRequestsCountLabelStr.Invoke(DirectCast(__value, Existable(Of Integer)).Value)
UrlPatternUser = "https://www.instagram.com/{0}/" UrlPatternUser = "https://www.instagram.com/{0}/"
UserRegex = RParams.DMS("[htps:/]{7,8}.*?instagram.com/([^/]+)", 1) UserRegex = RParams.DMS("[htps:/]{7,8}.*?instagram.com/([^/]+)", 1)
@@ -250,6 +243,7 @@ Namespace API.Instagram
End Sub End Sub
Friend Overrides Sub EndInit() Friend Overrides Sub EndInit()
Initialized = True Initialized = True
MyBase.EndInit()
End Sub End Sub
#End Region #End Region
#Region "PropertiesDataChecker" #Region "PropertiesDataChecker"

View File

@@ -247,6 +247,7 @@ Namespace API.Instagram
Try Try
Dim n As EContainer, nn As EContainer, node As EContainer Dim n As EContainer, nn As EContainer, node As EContainer
Dim HasNextPage As Boolean = False Dim HasNextPage As Boolean = False
Dim Pinned As Boolean
Dim EndCursor$ = String.Empty Dim EndCursor$ = String.Empty
Dim PostID$ = String.Empty, PostDate$ = String.Empty, SpecFolder$ = String.Empty Dim PostID$ = String.Empty, PostDate$ = String.Empty, SpecFolder$ = String.Empty
Dim TaggedCount% Dim TaggedCount%
@@ -255,7 +256,7 @@ Namespace API.Instagram
'Check environment 'Check environment
If Cursor.IsEmptyString And _InstaHash.IsEmptyString Then _ If Cursor.IsEmptyString And _InstaHash.IsEmptyString Then _
_InstaHash = CStr(If(IsSavedPosts, MySiteSettings.HashSavedPosts, MySiteSettings.Hash).Value) _InstaHash = CStr(If(IsSavedPosts, MySiteSettings.HashSavedPosts, MySiteSettings.Hash).Value)
If ID.IsEmptyString Then GetUserId() If ID.IsEmptyString Then GetUserId()
If ID.IsEmptyString Then Throw New ArgumentException("User ID is not detected", "ID") If ID.IsEmptyString Then Throw New ArgumentException("User ID is not detected", "ID")
@@ -296,7 +297,7 @@ Namespace API.Instagram
RequestsCount += 1 RequestsCount += 1
ThrowAny(Token) ThrowAny(Token)
'Data 'Parsing
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
Using j As EContainer = JsonDocument.Parse(r).XmlIfNothing Using j As EContainer = JsonDocument.Parse(r).XmlIfNothing
n = j.ItemF(ENode).XmlIfNothing n = j.ItemF(ENode).XmlIfNothing
@@ -317,14 +318,21 @@ Namespace API.Instagram
If IsSavedPosts Then If IsSavedPosts Then
PostID = node.Value("shortcode") PostID = node.Value("shortcode")
If Not PostID.IsEmptyString Then If Not PostID.IsEmptyString Then
If _TempPostsList.Contains(PostID) Then Throw New ExitException(_DownloadComplete) Else _SavedPostsIDs.Add(PostID) If _TempPostsList.Contains(PostID) Then Throw New ExitException(_DownloadComplete) 'Else _SavedPostsIDs.Add(PostID)
End If End If
End If
PostID = node.Value("id")
Pinned = CBool(If(node("pinned_for_users")?.Count, 0))
If Not PostID.IsEmptyString And _TempPostsList.Contains(PostID) And Not Pinned Then Throw New ExitException(_DownloadComplete)
_TempPostsList.Add(PostID)
PostDate = node.Value("taken_at_timestamp")
If IsSavedPosts Then
_SavedPostsIDs.Add(PostID)
Else Else
PostID = node.Value("id") Select Case CheckDatesLimit(PostDate, DateProvider)
If Not PostID.IsEmptyString And _TempPostsList.Contains(PostID) Then Throw New ExitException(_DownloadComplete) Case DateResult.Skip : Continue For
_TempPostsList.Add(PostID) Case DateResult.Exit : If Not Pinned Then Throw New ExitException(_DownloadComplete)
PostDate = node.Value("taken_at_timestamp") End Select
If Not CheckDatesLimit(PostDate, DateProvider) Then Throw New ExitException(_DownloadComplete)
ObtainMedia(node, PostID, PostDate, SpecFolder) ObtainMedia(node, PostID, PostDate, SpecFolder)
End If End If
Next Next
@@ -394,7 +402,8 @@ Namespace API.Instagram
Dim e As New ErrorsDescriber(EDP.ThrowException) Dim e As New ErrorsDescriber(EDP.ThrowException)
For i% = _Index To _SavedPostsIDs.Count - 1 For i% = _Index To _SavedPostsIDs.Count - 1
_Index = i _Index = i
URL = $"https://instagram.com/p/{_SavedPostsIDs(i)}/?__a=1" 'URL = $"https://instagram.com/p/{_SavedPostsIDs(i)}/?__a=1"
URL = $"https://i.instagram.com/api/v1/media/{_SavedPostsIDs(i)}/info/"
ThrowAny(Token) ThrowAny(Token)
NextRequest(((i + 1) Mod 5) = 0) NextRequest(((i + 1) Mod 5) = 0)
ThrowAny(Token) ThrowAny(Token)
@@ -437,8 +446,26 @@ Namespace API.Instagram
ProcessException(DoEx, Token, $"downloading saved posts error [{URL}]") ProcessException(DoEx, Token, $"downloading saved posts error [{URL}]")
End Try End Try
End Sub End Sub
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken) #End Region
End Sub #Region "Code ID converters"
Friend Shared Function CodeToID(ByVal Code As String) As String
Const CodeSymbols$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
Try
If Not Code.IsEmptyString Then
Dim c As Char
Dim id& = 0
For i% = 0 To Code.Length - 1
c = Code(i)
id = (id * 64) + CodeSymbols.IndexOf(c)
Next
Return id
Else
Return String.Empty
End If
Catch ex As Exception
Return ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[API.Instagram.UserData.CodeToID({Code})", String.Empty)
End Try
End Function
#End Region #End Region
#Region "Obtain Media" #Region "Obtain Media"
Private Sub ObtainMedia(ByVal node As EContainer, ByVal PostID As String, ByVal PostDate As String, ByVal SpecFolder As String) Private Sub ObtainMedia(ByVal node As EContainer, ByVal PostID As String, ByVal PostDate As String, ByVal SpecFolder As String)
@@ -690,6 +717,7 @@ Namespace API.Instagram
Try Try
If Not URL.IsEmptyString AndAlso URL.Contains("instagram.com") Then If Not URL.IsEmptyString AndAlso URL.Contains("instagram.com") Then
Dim PID$ = RegexReplace(URL, RParams.DMS(".*?instagram.com/p/([_\w\d]+)", 1)) Dim PID$ = RegexReplace(URL, RParams.DMS(".*?instagram.com/p/([_\w\d]+)", 1))
If Not PID.IsEmptyString AndAlso Not ACheck(Of Long)(PID) Then PID = CodeToID(PID)
If Not PID.IsEmptyString Then If Not PID.IsEmptyString Then
Using t As New UserData Using t As New UserData
t.SetEnvironment(Settings(_Settings.GetType.GetCustomAttribute(Of Plugin.Attributes.Manifest)().GUID), Nothing, False, False) t.SetEnvironment(Settings(_Settings.GetType.GetCustomAttribute(Of Plugin.Attributes.Manifest)().GUID), Nothing, False, False)

View File

@@ -30,20 +30,11 @@ Namespace API.Reddit
Friend ReadOnly Property SavedPostsUserName As PropertyValue Friend ReadOnly Property SavedPostsUserName As PropertyValue
<PropertyOption(ControlText:="Use M3U8", ControlToolTip:="Use M3U8 or mp4 for Reddit videos"), PXML> <PropertyOption(ControlText:="Use M3U8", ControlToolTip:="Use M3U8 or mp4 for Reddit videos"), PXML>
Friend ReadOnly Property UseM3U8 As PropertyValue Friend ReadOnly Property UseM3U8 As PropertyValue
Friend Overrides ReadOnly Property Responser As Response
Friend Sub New() Friend Sub New()
MyBase.New(RedditSite) MyBase.New(RedditSite, "reddit.com")
Responser = New Response($"{SettingsFolderName}\Responser_{Site}.xml")
With Responser With Responser
If .File.Exists Then If .Decoders.Count = 0 OrElse Not .Decoders.Contains(SymbolsConverter.Converters.Unicode) Then _
.LoadSettings() .Decoders.Add(SymbolsConverter.Converters.Unicode) : .SaveSettings()
Else
.CookiesDomain = "reddit.com"
.Cookies = New CookieKeeper(.CookiesDomain)
.Decoders.Add(SymbolsConverter.Converters.Unicode)
.SaveSettings()
End If
End With End With
SavedPostsUserName = New PropertyValue(String.Empty, GetType(String)) SavedPostsUserName = New PropertyValue(String.Empty, GetType(String))
UseM3U8 = New PropertyValue(True) UseM3U8 = New PropertyValue(True)
@@ -110,5 +101,8 @@ Namespace API.Reddit
Using f As New RedditViewSettingsForm(Options) : f.ShowDialog() : End Using Using f As New RedditViewSettingsForm(Options) : f.ShowDialog() : End Using
End If End If
End Sub End Sub
Friend Overrides Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String
Return $"https://www.reddit.com/comments/{PostID.Split("_").LastOrDefault}/"
End Function
End Class End Class
End Namespace End Namespace

View File

@@ -150,6 +150,8 @@ Namespace API.Reddit
End Sub End Sub
Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken) Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken)
_TotalPostsDownloaded = 0 _TotalPostsDownloaded = 0
'PENDING: Reddit ReparseMissing (DownloadDataF)
'If Not IsSavedPosts AndAlso (Not IsChannel OrElse ChannelInfo Is Nothing) Then ReparseMissing(Token)
If IsSavedPosts Then If IsSavedPosts Then
DownloadDataChannel(String.Empty, Token) DownloadDataChannel(String.Empty, Token)
ElseIf IsChannel Then ElseIf IsChannel Then
@@ -163,6 +165,8 @@ Namespace API.Reddit
End If End If
If DownloadTopCount.HasValue Then DownloadLimitCount = DownloadTopCount If DownloadTopCount.HasValue Then DownloadLimitCount = DownloadTopCount
End If End If
If SaveToCache AndAlso Not Responser.Decoders.Contains(SymbolsConverter.Converters.HTML) Then _
Responser.Decoders.Add(SymbolsConverter.Converters.HTML)
DownloadDataChannel(String.Empty, Token) DownloadDataChannel(String.Empty, Token)
If ChannelInfo Is Nothing Then _TempPostsList.ListAddList(_TempMediaList.Select(Function(m) m.Post.ID), LNC) If ChannelInfo Is Nothing Then _TempPostsList.ListAddList(_TempMediaList.Select(Function(m) m.Post.ID), LNC)
Else Else
@@ -227,7 +231,10 @@ Namespace API.Reddit
Continue For Continue For
End If End If
If nn.Contains("created") Then PostDate = nn("created").Value Else PostDate = String.Empty If nn.Contains("created") Then PostDate = nn("created").Value Else PostDate = String.Empty
If DownloadToDate.HasValue AndAlso Not CheckDatesLimit(PostDate, DateTrueProvider(IsChannel)) Then Exit Sub Select Case CheckDatesLimit(PostDate, DateTrueProvider(IsChannel))
Case DateResult.Skip : Continue For
Case DateResult.Exit : Exit Sub
End Select
_ItemsBefore = _TempMediaList.Count _ItemsBefore = _TempMediaList.Count
added = True added = True
@@ -370,9 +377,11 @@ Namespace API.Reddit
ElseIf Not s.Value({"media", "reddit_video"}, "fallback_url").IsEmptyString Then ElseIf Not s.Value({"media", "reddit_video"}, "fallback_url").IsEmptyString Then
tmpUrl = s.Value({"media", "reddit_video"}, "fallback_url") tmpUrl = s.Value({"media", "reddit_video"}, "fallback_url")
If SaveToCache Then If SaveToCache Then
tmpUrl = s.Value("thumbnail") 'TODELETE: Reddit thumbnail -> GetVideoRedditPreview
'tmpUrl = s.Value("thumbnail")
tmpUrl = GetVideoRedditPreview(s)
If Not tmpUrl.IsEmptyString Then If Not tmpUrl.IsEmptyString Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, tmpUrl, PostID, PostDate, _UserID, IsChannel), LNC) _TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, tmpUrl, PostID, PostDate, _UserID, IsChannel, False), LNC)
_TotalPostsDownloaded += 1 _TotalPostsDownloaded += 1
End If End If
ElseIf UseM3U8 AndAlso Not s.Value({"media", "reddit_video"}, "hls_url").IsEmptyString Then ElseIf UseM3U8 AndAlso Not s.Value({"media", "reddit_video"}, "hls_url").IsEmptyString Then
@@ -470,6 +479,38 @@ Namespace API.Reddit
Return False Return False
End Try End Try
End Function End Function
Private Function GetVideoRedditPreview(ByVal Node As EContainer) As String
Try
If Not Node Is Nothing Then
Dim n As EContainer = Node.ItemF({"preview", "images", 0})
Dim DestNode$() = Nothing
If If(n?.Count, 0) > 0 Then
If If(n("resolutions")?.Count, 0) > 0 Then
DestNode = {"resolutions"}
ElseIf If(n({"variants", "nsfw", "resolutions"})?.Count, 0) > 0 Then
DestNode = {"variants", "nsfw", "resolutions"}
End If
If Not DestNode Is Nothing Then
With n(DestNode)
Dim sl As List(Of Sizes) = .Select(Function(e) New Sizes(e.Value("width"), e.Value("url"))).
ListWithRemove(Function(ss) ss.HasError Or ss.Data.IsEmptyString)
If sl.ListExists Then
Dim s As Sizes
sl.Sort()
s = sl.First
sl.Clear()
Return s.Data
End If
End With
End If
End If
End If
Return String.Empty
Catch ex As Exception
ProcessException(ex, Nothing, "reddit video preview parsing error", False)
Return String.Empty
End Try
End Function
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken) Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
Try Try
ThrowAny(Token) ThrowAny(Token)
@@ -507,6 +548,72 @@ Namespace API.Reddit
ProcessException(ex, Token, "video reparsing error", False) ProcessException(ex, Token, "video reparsing error", False)
End Try End Try
End Sub End Sub
Protected Overrides Sub ReparseMissing(ByVal Token As CancellationToken)
Dim rList As New List(Of Integer)
Try
If _ContentList.Exists(MissingFinder) Then
Dim m As UserMedia
Dim j As EContainer, ss As EContainer
Dim r$, tmpUrl$, PostDate$, _UserID$
Dim err As New ErrorsDescriber(EDP.ReturnValue)
Dim node As Object() = {"data", "children", 0, "data"}
Dim eCount As Predicate(Of EContainer) = Function(e) e.Count > 0
Dim cItems As Predicate(Of EContainer) = Function(e) If(e.ItemF(node)?.Count, 0) > 0
For i% = 0 To _ContentList.Count - 1
m = _ContentList(i)
If m.State = UStates.Missing AndAlso Not m.Post.ID.IsEmptyString Then
ThrowAny(Token)
r = Responser.GetResponse($"https://www.reddit.com/comments/{m.Post.ID.Split("_").LastOrDefault}/.json",, err)
If Not r.IsEmptyString Then
j = JsonDocument.Parse(r, err)
If Not j Is Nothing Then
If j.Contains(cItems) Then
With j.ItemF({cItems}).ItemF(node)
If .Contains("created") Then PostDate = .Item("created").Value Else PostDate = String.Empty
_UserID = .Value("author")
tmpUrl = .Value("url")
If Not tmpUrl.IsEmptyString AndAlso tmpUrl.StringContains({"redgifs.com", "gfycat.com"}) Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre, tmpUrl, m.Post.ID, PostDate, _UserID, IsChannel), LNC)
_TotalPostsDownloaded += 1
ElseIf Not .Value({"media", "reddit_video"}, "fallback_url").IsEmptyString Then
tmpUrl = .Value({"media", "reddit_video"}, "fallback_url")
If UseM3U8 AndAlso Not .Value({"media", "reddit_video"}, "hls_url").IsEmptyString Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.m3u8, .Value({"media", "reddit_video"}, "hls_url"),
m.Post.ID, PostDate, _UserID, IsChannel), LNC)
Else
'_TempMediaList.ListAddValue(MediaFromData(UTypes.VideoPre + UTypes.m3u8, tmpUrl, PostID, PostDate, _UserID, IsChannel), LNC)
_TempMediaList.ListAddValue(MediaFromData(UTypes.Video, tmpUrl, m.Post.ID, PostDate, _UserID, IsChannel), LNC)
_TotalPostsDownloaded += 1
End If
ElseIf CreateImgurMedia(tmpUrl, m.Post.ID, PostDate, _UserID, IsChannel) Then
_TotalPostsDownloaded += 1
ElseIf If(.Item("media_metadata")?.Count, 0) > 0 Then
DownloadGallery(.Self, m.Post.ID, PostDate, _UserID, SaveToCache)
_TotalPostsDownloaded += 1
ElseIf .Contains("preview") Then
ss = .ItemF({"preview", "images", eCount, "source", "url"}).XmlIfNothing
If Not ss.Value.IsEmptyString Then
_TempMediaList.ListAddValue(MediaFromData(UTypes.Picture, ss.Value, m.Post.ID, PostDate, _UserID, IsChannel), LNC)
_TotalPostsDownloaded += 1
End If
End If
End With
End If
j.Dispose()
End If
End If
End If
Next
End If
Catch ex As Exception
ProcessException(ex, Token, "missing data downloading error")
Finally
If rList.Count > 0 Then
For i% = rList.Count - 1 To 0 Step -1 : _ContentList.RemoveAt(rList(i)) : Next
rList.Clear()
End If
End Try
End Sub
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Response) As IEnumerable(Of UserMedia) Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Response) As IEnumerable(Of UserMedia)
Try Try
If Not URL.IsEmptyString AndAlso URL.Contains("redgifs") Then If Not URL.IsEmptyString AndAlso URL.Contains("redgifs") Then
@@ -526,12 +633,13 @@ Namespace API.Reddit
#End Region #End Region
#Region "Structure creator" #Region "Structure creator"
Protected Shared Function MediaFromData(ByVal t As UTypes, ByVal _URL As String, ByVal PostID As String, ByVal PostDate As String, Protected Shared Function MediaFromData(ByVal t As UTypes, ByVal _URL As String, ByVal PostID As String, ByVal PostDate As String,
Optional ByVal _UserID As String = "", Optional ByVal IsChannel As Boolean = False) As UserMedia Optional ByVal _UserID As String = "", Optional ByVal IsChannel As Boolean = False,
Optional ByVal ReplacePreview As Boolean = True) As UserMedia
If _URL.IsEmptyString And t = UTypes.Picture Then Return Nothing If _URL.IsEmptyString And t = UTypes.Picture Then Return Nothing
_URL = LinkFormatterSecure(RegexReplace(_URL.Replace("\", String.Empty), LinkPattern)) _URL = LinkFormatterSecure(RegexReplace(_URL.Replace("\", String.Empty), LinkPattern))
Dim m As New UserMedia(_URL, t) With {.Post = New UserPost With {.ID = PostID, .UserID = _UserID}} Dim m As New UserMedia(_URL, t) With {.Post = New UserPost With {.ID = PostID, .UserID = _UserID}}
If t = UTypes.Picture Or t = UTypes.GIF Then m.File = UrlToFile(m.URL) Else m.File = Nothing If t = UTypes.Picture Or t = UTypes.GIF Then m.File = UrlToFile(m.URL) Else m.File = Nothing
If m.URL.Contains("preview") Then m.URL = $"https://i.redd.it/{m.File.File}" If ReplacePreview And m.URL.Contains("preview") Then m.URL = $"https://i.redd.it/{m.File.File}"
If Not PostDate.IsEmptyString Then m.Post.Date = AConvert(Of Date)(PostDate, DateTrueProvider(IsChannel), Nothing) Else m.Post.Date = Nothing If Not PostDate.IsEmptyString Then m.Post.Date = AConvert(Of Date)(PostDate, DateTrueProvider(IsChannel), Nothing) Else m.Post.Date = Nothing
Return m Return m
End Function End Function
@@ -561,6 +669,8 @@ Namespace API.Reddit
_ContentNew.RemoveAll(Function(c) c.URL.IsEmptyString) _ContentNew.RemoveAll(Function(c) c.URL.IsEmptyString)
If _ContentNew.Count > 0 Then If _ContentNew.Count > 0 Then
MyFile.Exists(SFO.Path) MyFile.Exists(SFO.Path)
Dim MissingErrorsAdd As Boolean = Settings.AddMissingErrorsToLog
Dim IsImgurStuff As Boolean
Dim MyDir$ Dim MyDir$
If Not IsSavedPosts AndAlso (IsChannel And SaveToCache And Not ChannelInfo Is Nothing) Then If Not IsSavedPosts AndAlso (IsChannel And SaveToCache And Not ChannelInfo Is Nothing) Then
MyDir = ChannelInfo.CachePath.PathNoSeparator MyDir = ChannelInfo.CachePath.PathNoSeparator
@@ -629,7 +739,7 @@ Namespace API.Reddit
Dim m$ Dim m$
Using w As New WebClient Using w As New WebClient
If vsf Then SFileShares.SFileExists($"{MyDir}\Video\", SFO.Path) If vsf Then SFileShares.SFileExists($"{MyDir}\Video\", SFO.Path)
Progress.TotalCount += _ContentNew.Count Progress.Maximum += _ContentNew.Count
For i = 0 To _ContentNew.Count - 1 For i = 0 To _ContentNew.Count - 1
ThrowAny(Token) ThrowAny(Token)
v = _ContentNew(i) v = _ContentNew(i)
@@ -651,6 +761,7 @@ Namespace API.Reddit
If (Not m.IsEmptyString AndAlso Not HashList.Contains(m)) Or Not (v.Type = UTypes.Picture Or If (Not m.IsEmptyString AndAlso Not HashList.Contains(m)) Or Not (v.Type = UTypes.Picture Or
v.Type = UTypes.GIF) Or Not UseMD5 Or ImgurUrls.Count > 0 Then v.Type = UTypes.GIF) Or Not UseMD5 Or ImgurUrls.Count > 0 Then
isImgurStuff = ImgurUrls.Count > 0
Do Do
If Not cached And Not m.IsEmptyString Then HashList.Add(m) If Not cached And Not m.IsEmptyString Then HashList.Add(m)
v.MD5 = m v.MD5 = m
@@ -695,7 +806,11 @@ Namespace API.Reddit
dCount += 1 dCount += 1
End If End If
Catch wex As Exception Catch wex As Exception
If Not IsChannel Then ErrorDownloading(f, v.URL) If Not IsChannel Then
If Not IsImgurStuff And MissingErrorsAdd Then ErrorDownloading(f, v.URL)
v.Attempts += 1
v.State = UStates.Missing
End If
End Try End Try
If ImgurUrls.Count > 0 Then ImgurUrls.RemoveAt(0) If ImgurUrls.Count > 0 Then ImgurUrls.RemoveAt(0)
Loop While ImgurUrls.Count > 0 Loop While ImgurUrls.Count > 0

View File

@@ -15,12 +15,12 @@ Namespace API.RedGifs
Friend Class SiteSettings : Inherits SiteSettingsBase Friend Class SiteSettings : Inherits SiteSettingsBase
Friend Overrides ReadOnly Property Icon As Icon Friend Overrides ReadOnly Property Icon As Icon
Get Get
Return My.Resources.RegGifsIcon Return My.Resources.RedGifsIcon
End Get End Get
End Property End Property
Friend Overrides ReadOnly Property Image As Image Friend Overrides ReadOnly Property Image As Image
Get Get
Return My.Resources.RegGifsPic32 Return My.Resources.RedGifsPic32
End Get End Get
End Property End Property
Friend Sub New() Friend Sub New()
@@ -35,5 +35,12 @@ Namespace API.RedGifs
Friend Overrides Function GetSpecialDataF(ByVal URL As String) As IEnumerable(Of UserMedia) Friend Overrides Function GetSpecialDataF(ByVal URL As String) As IEnumerable(Of UserMedia)
Return Reddit.UserData.GetVideoInfo(URL, Nothing) Return Reddit.UserData.GetVideoInfo(URL, Nothing)
End Function End Function
Friend Overrides Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String
Return $"https://www.redgifs.com/watch/{PostID}"
End Function
Friend Overrides Function Available(ByVal What As ISiteSettings.Download, ByVal Silent As Boolean) As Boolean
'PENDING: RedGifs SiteSettings Available FALSE
Return False
End Function
End Class End Class
End Namespace End Namespace

View File

@@ -13,6 +13,7 @@ Imports System.Net
Imports System.Threading Imports System.Threading
Imports SCrawler.API.Base Imports SCrawler.API.Base
Imports UTypes = SCrawler.API.Base.UserMedia.Types Imports UTypes = SCrawler.API.Base.UserMedia.Types
Imports UStates = SCrawler.API.Base.UserMedia.States
Namespace API.RedGifs Namespace API.RedGifs
Friend Class UserData : Inherits UserDataBase Friend Class UserData : Inherits UserDataBase
Friend Sub New() Friend Sub New()
@@ -20,6 +21,7 @@ Namespace API.RedGifs
Protected Overrides Sub LoadUserInformation_OptionalFields(ByRef Container As XmlFile, ByVal Loading As Boolean) Protected Overrides Sub LoadUserInformation_OptionalFields(ByRef Container As XmlFile, ByVal Loading As Boolean)
End Sub End Sub
Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken) Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken)
ReparseMissing(Token)
DownloadData(1, Token) DownloadData(1, Token)
End Sub End Sub
Private Overloads Sub DownloadData(ByVal Page As Integer, ByVal Token As CancellationToken) Private Overloads Sub DownloadData(ByVal Page As Integer, ByVal Token As CancellationToken)
@@ -29,32 +31,19 @@ Namespace API.RedGifs
Dim r$ = Responser.GetResponse(URL,, EDP.ThrowException) Dim r$ = Responser.GetResponse(URL,, EDP.ThrowException)
Dim postDate$, postID$ Dim postDate$, postID$
Dim pTotal% = 0 Dim pTotal% = 0
Dim u$
Dim ut As UTypes
If Not r.IsEmptyString Then If Not r.IsEmptyString Then
Using j As EContainer = JsonDocument.Parse(r).XmlIfNothing Using j As EContainer = JsonDocument.Parse(r).XmlIfNothing
If j.Contains("gifs") Then If j.Contains("gifs") Then
pTotal = j.Value("pages").FromXML(Of Integer)(0) pTotal = j.Value("pages").FromXML(Of Integer)(0)
For Each g As EContainer In j("gifs") For Each g As EContainer In j("gifs")
postDate = g.Value("createDate") postDate = g.Value("createDate")
If Not CheckDatesLimit(postDate, DateProvider) Then Exit Sub Select Case CheckDatesLimit(postDate, DateProvider)
Case DateResult.Skip : Continue For
Case DateResult.Exit : Exit Sub
End Select
postID = g.Value("id") postID = g.Value("id")
If Not _TempPostsList.Contains(postID) Then _TempPostsList.Add(postID) Else Exit For If Not _TempPostsList.Contains(postID) Then _TempPostsList.Add(postID) Else Exit For
With g("urls") ObtainMedia(g, postID, postDate)
If .ListExists Then
u = If(.Item("hd"), .Item("sd")).XmlIfNothingValue
If Not u.IsEmptyString Then
ut = UTypes.Undefined
'Type 1: video
'Type 2: image
Select Case g.Value("type").FromXML(Of Integer)(0)
Case 1 : ut = UTypes.Video
Case 2 : ut = UTypes.Picture
End Select
If Not ut = UTypes.Undefined Then _TempMediaList.ListAddValue(MediaFromData(ut, u, postID, postDate))
End If
End If
End With
Next Next
End If End If
End Using End Using
@@ -64,16 +53,84 @@ Namespace API.RedGifs
ProcessException(ex, Token, $"data downloading error [{URL}]") ProcessException(ex, Token, $"data downloading error [{URL}]")
End Try End Try
End Sub End Sub
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken) Private Sub ObtainMedia(ByVal j As EContainer, ByVal PostID As String,
Optional ByVal PostDateStr As String = Nothing, Optional ByVal PostDateDate As Date? = Nothing,
Optional ByVal State As UStates = UStates.Unknown)
With j("urls")
If .ListExists Then
Dim u$ = If(.Item("hd"), .Item("sd")).XmlIfNothingValue
If Not u.IsEmptyString Then
Dim ut As UTypes = UTypes.Undefined
'Type 1: video
'Type 2: image
Select Case j.Value("type").FromXML(Of Integer)(0)
Case 1 : ut = UTypes.Video
Case 2 : ut = UTypes.Picture
End Select
If Not ut = UTypes.Undefined Then _TempMediaList.ListAddValue(MediaFromData(ut, u, PostID, PostDateStr, PostDateDate, State))
End If
End If
End With
End Sub
Protected Overrides Sub ReparseMissing(ByVal Token As CancellationToken)
Dim rList As New List(Of Integer)
Try
If _ContentList.Exists(MissingFinder) Then
Dim url$, r$
Dim u As UserMedia
Dim j As EContainer
For i% = 0 To _ContentList.Count - 1
If _ContentList(i).State = UserMedia.States.Missing Then
ThrowAny(Token)
u = _ContentList(i)
If Not u.Post.ID.IsEmptyString Then
url = $"https://api.redgifs.com/v2/gifs/{u.Post.ID}?views=yes&users=yes"
Try
r = Responser.GetResponse(url,, EDP.ThrowException)
If Not r.IsEmptyString Then
j = JsonDocument.Parse(r)
If Not j Is Nothing Then
If If(j("gif")?.Count, 0) > 0 Then
ObtainMedia(j("gif"), u.Post.ID,, u.Post.Date, UStates.Missing)
rList.Add(i)
End If
End If
End If
Catch down_ex As Exception
u.Attempts += 1
_ContentList(i) = u
End Try
Else
rList.Add(i)
End If
End If
Next
End If
Catch dex As ObjectDisposedException When Disposed
Catch ex As Exception
ProcessException(ex, Token, $"missing data downloading error")
Finally
If Not Disposed And rList.Count > 0 Then
For i% = rList.Count - 1 To 0 Step -1 : _ContentList.RemoveAt(rList(i)) : Next
End If
End Try
End Sub End Sub
Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken) Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken)
DownloadContentDefault(Token) DownloadContentDefault(Token)
End Sub End Sub
Private Shared Function MediaFromData(ByVal t As UTypes, ByVal _URL As String, ByVal PostID As String, ByVal PostDate As String) As UserMedia Private Shared Function MediaFromData(ByVal t As UTypes, ByVal _URL As String, ByVal PostID As String,
ByVal PostDateStr As String, ByVal PostDateDate As Date?, ByVal State As UStates) As UserMedia
_URL = LinkFormatterSecure(RegexReplace(_URL.Replace("\", String.Empty), LinkPattern)) _URL = LinkFormatterSecure(RegexReplace(_URL.Replace("\", String.Empty), LinkPattern))
Dim m As New UserMedia(_URL, t) With {.Post = New UserPost With {.ID = PostID}} Dim m As New UserMedia(_URL, t) With {.Post = New UserPost With {.ID = PostID}}
If Not m.URL.IsEmptyString Then m.File = CStr(RegexReplace(m.URL, FilesPattern)) : m.URL_BASE = m.URL If Not m.URL.IsEmptyString Then m.File = CStr(RegexReplace(m.URL, FilesPattern)) : m.URL_BASE = m.URL
If Not PostDate.IsEmptyString Then m.Post.Date = AConvert(Of Date)(PostDate, DateProvider, Nothing) Else m.Post.Date = Nothing If Not PostDateStr.IsEmptyString Then
m.Post.Date = AConvert(Of Date)(PostDateStr, DateProvider, Nothing)
ElseIf PostDateDate.HasValue Then
m.Post.Date = PostDateDate
Else
m.Post.Date = Nothing
End If
m.State = State
Return m Return m
End Function End Function
Protected Overrides Function DownloadingException(ByVal ex As Exception, ByVal Message As String, Optional ByVal FromPE As Boolean = False) As Integer Protected Overrides Function DownloadingException(ByVal ex As Exception, ByVal Message As String, Optional ByVal FromPE As Boolean = False) As Integer

View File

@@ -43,6 +43,7 @@ Namespace API.Twitter
With Responser With Responser
If .File.Exists Then If .File.Exists Then
If EncryptCookies.CookiesEncrypted Then .CookiesEncryptKey = SettingsCLS.CookieEncryptKey
.LoadSettings() .LoadSettings()
With .Headers With .Headers
If .ContainsKey(Header_Authorization) Then a = .Item(Header_Authorization) If .ContainsKey(Header_Authorization) Then a = .Item(Header_Authorization)
@@ -52,7 +53,8 @@ Namespace API.Twitter
.ContentType = "application/json" .ContentType = "application/json"
.Accept = "*/*" .Accept = "*/*"
.CookiesDomain = "twitter.com" .CookiesDomain = "twitter.com"
.Cookies = New CookieKeeper(.CookiesDomain) .Cookies = New CookieKeeper(.CookiesDomain) With {.EncryptKey = SettingsCLS.CookieEncryptKey}
.CookiesEncryptKey = SettingsCLS.CookieEncryptKey
.Decoders.Add(SymbolsConverter.Converters.Unicode) .Decoders.Add(SymbolsConverter.Converters.Unicode)
With .Headers With .Headers
.Add("sec-ch-ua", " Not;A Brand"";v=""99"", ""Google Chrome"";v=""91"", ""Chromium"";v=""91""") .Add("sec-ch-ua", " Not;A Brand"";v=""99"", ""Google Chrome"";v=""91"", ""Chromium"";v=""91""")
@@ -101,5 +103,8 @@ Namespace API.Twitter
Friend Overrides Function GetSpecialDataF(ByVal URL As String) As IEnumerable(Of UserMedia) Friend Overrides Function GetSpecialDataF(ByVal URL As String) As IEnumerable(Of UserMedia)
Return UserData.GetVideoInfo(URL, Responser) Return UserData.GetVideoInfo(URL, Responser)
End Function End Function
Friend Overrides Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String
Return $"https://twitter.com/{UserID}/status/{PostID}"
End Function
End Class End Class
End Namespace End Namespace

View File

@@ -13,6 +13,7 @@ Imports PersonalUtilities.Functions.RegularExpressions
Imports System.Net Imports System.Net
Imports System.Threading Imports System.Threading
Imports SCrawler.API.Base Imports SCrawler.API.Base
Imports UStates = SCrawler.API.Base.UserMedia.States
Namespace API.Twitter Namespace API.Twitter
Friend Class UserData : Inherits UserDataBase Friend Class UserData : Inherits UserDataBase
#Region "Declarations" #Region "Declarations"
@@ -33,6 +34,8 @@ Namespace API.Twitter
Else Else
If _ContentList.Count > 0 Then _DataNames.ListAddList(_ContentList.Select(Function(c) c.File.File), LAP.ClearBeforeAdd, LAP.NotContainsOnly) If _ContentList.Count > 0 Then _DataNames.ListAddList(_ContentList.Select(Function(c) c.File.File), LAP.ClearBeforeAdd, LAP.NotContainsOnly)
DownloadData(String.Empty, Token) DownloadData(String.Empty, Token)
'PENDING: Twitter ReparseMissing (DownloadDataF)
'ReparseMissing(Token)
End If End If
End Sub End Sub
Private Overloads Sub DownloadData(ByVal POST As String, ByVal Token As CancellationToken) Private Overloads Sub DownloadData(ByVal POST As String, ByVal Token As CancellationToken)
@@ -41,8 +44,8 @@ Namespace API.Twitter
Dim NextCursor$ = String.Empty Dim NextCursor$ = String.Empty
Dim __NextCursor As Predicate(Of EContainer) = Function(e) e.Value({"content", "operation", "cursor"}, "cursorType") = "Bottom" Dim __NextCursor As Predicate(Of EContainer) = Function(e) e.Value({"content", "operation", "cursor"}, "cursorType") = "Bottom"
Dim PostID$ = String.Empty Dim PostID$ = String.Empty
Dim PostDate$, dName$ Dim PostDate$ ', dName$
Dim m As EContainer, nn As EContainer, s As EContainer Dim nn As EContainer, s As EContainer ', m As EContainer
Dim NewPostDetected As Boolean = False Dim NewPostDetected As Boolean = False
Dim ExistsDetected As Boolean = False Dim ExistsDetected As Boolean = False
@@ -84,7 +87,10 @@ Namespace API.Twitter
'Date Pattern: 'Date Pattern:
'Sat Jan 01 01:10:15 +0000 2000 'Sat Jan 01 01:10:15 +0000 2000
If nn.Contains("created_at") Then PostDate = nn("created_at").Value Else PostDate = String.Empty If nn.Contains("created_at") Then PostDate = nn("created_at").Value Else PostDate = String.Empty
If Not CheckDatesLimit(PostDate, Declarations.DateProvider) Then Exit Sub Select Case CheckDatesLimit(PostDate, Declarations.DateProvider)
Case DateResult.Skip : Continue For
Case DateResult.Exit : Exit Sub
End Select
If Not _TempPostsList.Contains(PostID) Then If Not _TempPostsList.Contains(PostID) Then
NewPostDetected = True NewPostDetected = True
@@ -96,22 +102,24 @@ Namespace API.Twitter
If IsSavedPosts OrElse Not ParseUserMediaOnly OrElse (Not nn.Contains("retweeted_status") OrElse If IsSavedPosts OrElse Not ParseUserMediaOnly OrElse (Not nn.Contains("retweeted_status") OrElse
(Not ID.IsEmptyString AndAlso UID(nn("retweeted_status")) = ID)) Then (Not ID.IsEmptyString AndAlso UID(nn("retweeted_status")) = ID)) Then
If Not CheckVideoNode(nn, PostID, PostDate) Then 'TODELETE: Twitter ObtainMedia
s = nn.ItemF({"extended_entities", "media"}) 'If Not CheckVideoNode(nn, PostID, PostDate) Then
If s Is Nothing OrElse s.Count = 0 Then s = nn.ItemF({"retweeted_status", "extended_entities", "media"}) ' s = nn.ItemF({"extended_entities", "media"})
If Not s Is Nothing AndAlso s.Count > 0 Then ' If s Is Nothing OrElse s.Count = 0 Then s = nn.ItemF({"retweeted_status", "extended_entities", "media"})
For Each m In s ' If Not s Is Nothing AndAlso s.Count > 0 Then
If m.Count > 0 AndAlso m.Contains("media_url") Then ' For Each m In s
dName = UrlFile(m("media_url").Value) ' If m.Count > 0 AndAlso m.Contains("media_url") Then
If Not dName.IsEmptyString AndAlso Not _DataNames.Contains(dName) Then ' dName = UrlFile(m("media_url").Value)
_DataNames.Add(dName) ' If Not dName.IsEmptyString AndAlso Not _DataNames.Contains(dName) Then
_TempMediaList.ListAddValue(MediaFromData(m("media_url").Value, ' _DataNames.Add(dName)
PostID, PostDate, GetPictureOption(m)), LNC) ' _TempMediaList.ListAddValue(MediaFromData(m("media_url").Value,
End If ' PostID, PostDate, GetPictureOption(m)), LNC)
End If ' End If
Next ' End If
End If ' Next
End If ' End If
'End If
ObtainMedia(nn, PostID, PostDate)
End If End If
End If End If
Next Next
@@ -136,6 +144,62 @@ Namespace API.Twitter
ProcessException(ex, Token, $"data downloading error{IIf(IsSavedPosts, " (Saved Posts)", String.Empty)} [{URL}]") ProcessException(ex, Token, $"data downloading error{IIf(IsSavedPosts, " (Saved Posts)", String.Empty)} [{URL}]")
End Try End Try
End Sub End Sub
Private Sub ObtainMedia(ByVal e As EContainer, ByVal PostID As String, ByVal PostDate As String, Optional ByVal State As UStates = UStates.Unknown)
If Not CheckVideoNode(e, PostID, PostDate) Then
Dim s As EContainer = e.ItemF({"extended_entities", "media"})
If s Is Nothing OrElse s.Count = 0 Then s = e.ItemF({"retweeted_status", "extended_entities", "media"})
If If(s?.Count, 0) > 0 Then
For Each m In s
If m.Contains("media_url") Then
Dim dName$ = UrlFile(m("media_url").Value)
If Not dName.IsEmptyString AndAlso Not _DataNames.Contains(dName) Then
_DataNames.Add(dName)
_TempMediaList.ListAddValue(MediaFromData(m("media_url").Value,
PostID, PostDate, GetPictureOption(m), State), LNC)
End If
End If
Next
End If
End If
End Sub
Protected Overrides Sub ReparseMissing(ByVal Token As CancellationToken)
'PENDING: Twitter ReparseMissing verify
Dim rList As New List(Of Integer)
Dim URL$ = String.Empty
Try
If ContentMissingExists Then
Dim m As UserMedia
Dim r$, PostDate$
Dim j As EContainer
For i% = 0 To _ContentList.Count - 1
If _ContentList(i).State = UStates.Missing Then
m = _ContentList(i)
If Not m.Post.ID.IsEmptyString Then
ThrowAny(Token)
URL = $"https://api.twitter.com/1.1/statuses/show.json?id={m.Post.ID}"
r = Responser.GetResponse(URL,, EDP.ReturnValue)
If Not r.IsEmptyString Then
j = JsonDocument.Parse(r)
If Not j Is Nothing Then
PostDate = String.Empty
If j.Contains("created_at") Then PostDate = j("created_at").Value Else PostDate = String.Empty
ObtainMedia(j, m.Post.ID, PostDate, UStates.Missing)
rList.Add(i)
End If
End If
End If
End If
Next
End If
Catch ex As Exception
ProcessException(ex, Token, $"ReparseMissing error [{URL}]")
Finally
If rList.Count > 0 Then
For i% = rList.Count - 1 To 0 Step -1 : _ContentList.RemoveAt(i) : Next
rList.Clear()
End If
End Try
End Sub
Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Response) As IEnumerable(Of UserMedia) Friend Shared Function GetVideoInfo(ByVal URL As String, ByVal resp As Response) As IEnumerable(Of UserMedia)
Try Try
If URL.Contains("twitter") Then If URL.Contains("twitter") Then
@@ -268,8 +332,6 @@ Namespace API.Twitter
End If End If
Return String.Empty Return String.Empty
End Function End Function
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
End Sub
Private Function UrlFile(ByVal URL As String) As String Private Function UrlFile(ByVal URL As String) As String
Try Try
Dim f As SFile = CStr(RegexReplace(LinkFormatterSecure(RegexReplace(URL.Replace("\", String.Empty), LinkPattern)), FilesPattern)) Dim f As SFile = CStr(RegexReplace(LinkFormatterSecure(RegexReplace(URL.Replace("\", String.Empty), LinkPattern)), FilesPattern))
@@ -280,7 +342,8 @@ Namespace API.Twitter
End Function End Function
#End Region #End Region
Private Shared Function MediaFromData(ByVal _URL As String, ByVal PostID As String, ByVal PostDate As String, Private Shared Function MediaFromData(ByVal _URL As String, ByVal PostID As String, ByVal PostDate As String,
Optional ByVal _PictureOption As String = "") As UserMedia Optional ByVal _PictureOption As String = Nothing,
Optional ByVal State As UStates = UStates.Unknown) As UserMedia
_URL = LinkFormatterSecure(RegexReplace(_URL.Replace("\", String.Empty), LinkPattern)) _URL = LinkFormatterSecure(RegexReplace(_URL.Replace("\", String.Empty), LinkPattern))
Dim m As New UserMedia(_URL) With {.PictureOption = _PictureOption, .Post = New UserPost With {.ID = PostID}} Dim m As New UserMedia(_URL) With {.PictureOption = _PictureOption, .Post = New UserPost With {.ID = PostID}}
If Not m.URL.IsEmptyString Then m.File = CStr(RegexReplace(m.URL, FilesPattern)) If Not m.URL.IsEmptyString Then m.File = CStr(RegexReplace(m.URL, FilesPattern))
@@ -288,6 +351,7 @@ Namespace API.Twitter
m.URL_BASE = $"{m.URL.Replace($".{m.File.Extension}", String.Empty)}?format={m.File.Extension}&name={m.PictureOption}" m.URL_BASE = $"{m.URL.Replace($".{m.File.Extension}", String.Empty)}?format={m.File.Extension}&name={m.PictureOption}"
End If End If
If Not PostDate.IsEmptyString Then m.Post.Date = AConvert(Of Date)(PostDate, Declarations.DateProvider, Nothing) Else m.Post.Date = Nothing If Not PostDate.IsEmptyString Then m.Post.Date = AConvert(Of Date)(PostDate, Declarations.DateProvider, Nothing) Else m.Post.Date = Nothing
m.State = State
Return m Return m
End Function End Function
#End Region #End Region

View File

@@ -92,6 +92,11 @@ Namespace API
End If End If
End Get End Get
End Property End Property
Friend Overrides ReadOnly Property ContentMissingExists As Boolean
Get
Return Count > 0 AndAlso Collections.Exists(Function(c) DirectCast(c, UserDataBase).ContentMissingExists)
End Get
End Property
Friend ReadOnly Property Count As Integer Implements ICollection(Of IUserData).Count, IMyEnumerator(Of IUserData).MyEnumeratorCount Friend ReadOnly Property Count As Integer Implements ICollection(Of IUserData).Count, IMyEnumerator(Of IUserData).MyEnumeratorCount
Get Get
If Collections Is Nothing Then If Collections Is Nothing Then
@@ -285,8 +290,8 @@ Namespace API
Friend Overrides Sub UpdateUserInformation() Friend Overrides Sub UpdateUserInformation()
If Count > 0 Then Collections.ForEach(Sub(c) c.UpdateUserInformation()) If Count > 0 Then Collections.ForEach(Sub(c) c.UpdateUserInformation())
End Sub End Sub
Friend Overrides Sub LoadContentInformation() Friend Overrides Sub LoadContentInformation(Optional ByVal Force As Boolean = False)
If Count > 0 Then Collections.ForEach(Sub(c) DirectCast(c, UserDataBase).LoadContentInformation()) If Count > 0 Then Collections.ForEach(Sub(c) DirectCast(c, UserDataBase).LoadContentInformation(Force))
End Sub End Sub
Protected Overrides Sub LoadUserInformation_OptionalFields(ByRef Container As XmlFile, ByVal Loading As Boolean) Protected Overrides Sub LoadUserInformation_OptionalFields(ByRef Container As XmlFile, ByVal Loading As Boolean)
End Sub End Sub
@@ -309,8 +314,6 @@ Namespace API
End Sub End Sub
Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken) Protected Overrides Sub DownloadDataF(ByVal Token As CancellationToken)
End Sub End Sub
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
End Sub
Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken) Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken)
End Sub End Sub
Protected Overrides Function DownloadingException(ByVal ex As Exception, ByVal Message As String, Optional ByVal FromPE As Boolean = False) As Integer Protected Overrides Function DownloadingException(ByVal ex As Exception, ByVal Message As String, Optional ByVal FromPE As Boolean = False) As Integer
@@ -343,6 +346,14 @@ Namespace API
Return False Return False
End Get End Get
End Property End Property
Private Sub CopyTo(ByVal _Array() As IUserData, ByVal _ArrayIndex As Integer) Implements ICollection(Of IUserData).CopyTo
Throw New NotImplementedException("[CopyTo] method does not supported in collections context")
End Sub
Friend Sub Clear() Implements ICollection(Of IUserData).Clear
Collections.ListClearDispose
End Sub
#End Region
#Region "Add"
''' <exception cref="InvalidOperationException"></exception> ''' <exception cref="InvalidOperationException"></exception>
Friend Overloads Sub Add(ByVal _Item As IUserData) Implements ICollection(Of IUserData).Add Friend Overloads Sub Add(ByVal _Item As IUserData) Implements ICollection(Of IUserData).Add
With _Item With _Item
@@ -359,7 +370,7 @@ Namespace API
ConsolidateScripts() ConsolidateScripts()
.UpdateUserInformation() .UpdateUserInformation()
End If End If
ImageHandler(_Item, False) MainFrameObj.ImageHandler(_Item, False)
AddRemoveBttDeleteHandler(.Self, True) AddRemoveBttDeleteHandler(.Self, True)
AddHandler .Self.UserUpdated, AddressOf User_OnUserUpdated AddHandler .Self.UserUpdated, AddressOf User_OnUserUpdated
End With End With
@@ -410,6 +421,8 @@ Namespace API
For i% = 0 To _Items.Count - 1 : Add(_Items(i)) : Next For i% = 0 To _Items.Count - 1 : Add(_Items(i)) : Next
End If End If
End Sub End Sub
#End Region
#Region "Move, Merge"
Friend Overrides Function MoveFiles(ByVal __CollectionName As String) As Boolean Friend Overrides Function MoveFiles(ByVal __CollectionName As String) As Boolean
Throw New NotImplementedException("Move files is not available in the collection context") Throw New NotImplementedException("Move files is not available in the collection context")
End Function End Function
@@ -437,15 +450,8 @@ Namespace API
End If End If
End If End If
End Sub End Sub
Friend Sub Clear() Implements ICollection(Of IUserData).Clear #End Region
Collections.ListClearDispose #Region "Remove, Delete"
End Sub
Friend Function Contains(ByVal _Item As IUserData) As Boolean Implements ICollection(Of IUserData).Contains
Return Count > 0 AndAlso Collections.Contains(_Item)
End Function
Private Sub CopyTo(ByVal _Array() As IUserData, ByVal _ArrayIndex As Integer) Implements ICollection(Of IUserData).CopyTo
Throw New NotImplementedException("[CopyTo] method does not supported in collections context")
End Sub
Friend Function Remove(ByVal _Item As IUserData) As Boolean Implements ICollection(Of IUserData).Remove Friend Function Remove(ByVal _Item As IUserData) As Boolean Implements ICollection(Of IUserData).Remove
If DataMerging Then If DataMerging Then
MsgBoxE($"Collection [{CollectionName}] data is already merged" & vbCr & MsgBoxE($"Collection [{CollectionName}] data is already merged" & vbCr &
@@ -454,7 +460,7 @@ Namespace API
Return False Return False
Else Else
DirectCast(_Item, UserDataBase).MoveFiles(String.Empty) DirectCast(_Item, UserDataBase).MoveFiles(String.Empty)
ImageHandler(_Item) MainFrameObj.ImageHandler(_Item)
AddRemoveBttDeleteHandler(_Item, False) AddRemoveBttDeleteHandler(_Item, False)
RaiseEvent OnUserRemoved(_Item) RaiseEvent OnUserRemoved(_Item)
Return Collections.Remove(_Item) Return Collections.Remove(_Item)
@@ -469,7 +475,7 @@ Namespace API
Settings.Users.Remove(Me) Settings.Users.Remove(Me)
Collections.ForEach(Sub(c) c.Delete()) Collections.ForEach(Sub(c) c.Delete())
Downloader.UserRemove(Me) Downloader.UserRemove(Me)
ImageHandler(Me, False) MainFrameObj.ImageHandler(Me, False)
Collections.ListClearDispose Collections.ListClearDispose
Dispose(False) Dispose(False)
f.Delete(SFO.Path, SFODelete.EmptyOnly + Settings.DeleteMode, EDP.SendInLog) f.Delete(SFO.Path, SFODelete.EmptyOnly + Settings.DeleteMode, EDP.SendInLog)
@@ -487,12 +493,12 @@ Namespace API
Settings.Users.Remove(Me) Settings.Users.Remove(Me)
Collections.ForEach(Sub(c) Collections.ForEach(Sub(c)
c.MoveFiles(String.Empty) c.MoveFiles(String.Empty)
ImageHandler(c) MainFrameObj.ImageHandler(c)
End Sub) End Sub)
Collections.Clear() Collections.Clear()
f.Delete(SFO.Path, SFODelete.Default + Settings.DeleteMode, EDP.SendInLog) f.Delete(SFO.Path, SFODelete.Default + Settings.DeleteMode, EDP.SendInLog)
Downloader.UserRemove(Me) Downloader.UserRemove(Me)
ImageHandler(Me, False) MainFrameObj.ImageHandler(Me, False)
Dispose(False) Dispose(False)
Return 3 Return 3
Else Else
@@ -511,7 +517,7 @@ Namespace API
Dim RemoveMeIfNull As Action = Sub() Dim RemoveMeIfNull As Action = Sub()
If Count = 0 Then If Count = 0 Then
Settings.Users.Remove(Me) Settings.Users.Remove(Me)
ImageHandler(Me, False) MainFrameObj.ImageHandler(Me, False)
RaiseEvent OnCollectionSelfRemoved(Me) RaiseEvent OnCollectionSelfRemoved(Me)
Dispose(False) Dispose(False)
End If End If
@@ -544,6 +550,17 @@ Namespace API
End If End If
End With End With
End Sub End Sub
#End Region
#Region "Copy"
Friend Overrides Function CopyFiles(ByVal DestinationPath As SFile, Optional ByVal e As ErrorsDescriber = Nothing) As Boolean
Return Count > 0 AndAlso Collections(0).CopyFiles(DestinationPath, e)
End Function
#End Region
#Region "Contains"
Friend Function Contains(ByVal _Item As IUserData) As Boolean Implements ICollection(Of IUserData).Contains
Return Count > 0 AndAlso Collections.Contains(_Item)
End Function
#End Region
#Region "IEnumerable Support" #Region "IEnumerable Support"
Private Function GetEnumerator() As IEnumerator(Of IUserData) Implements IEnumerable(Of IUserData).GetEnumerator Private Function GetEnumerator() As IEnumerator(Of IUserData) Implements IEnumerable(Of IUserData).GetEnumerator
Return New MyEnumerator(Of IUserData)(Me) Return New MyEnumerator(Of IUserData)(Me)
@@ -551,7 +568,6 @@ Namespace API
Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator Private Function IEnumerable_GetEnumerator() As IEnumerator Implements IEnumerable.GetEnumerator
Return GetEnumerator() Return GetEnumerator()
End Function End Function
#End Region
#End Region #End Region
Friend Overrides Function Equals(ByVal Other As UserDataBase) As Boolean Friend Overrides Function Equals(ByVal Other As UserDataBase) As Boolean
If Other.IsCollection Then If Other.IsCollection Then

View File

@@ -142,7 +142,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
Friend Sub New() Friend Sub New()
InitializeComponent() InitializeComponent()
MyDefs = New DefaultFormOptions MyDefs = New DefaultFormOptions
CProgress = New MyProgress(ToolbarBOTTOM, PR_CN, LBL_STATUS, "Downloading data") With {.PerformMod = 10, .DropCurrentProgressOnTotalChange = False} CProgress = New MyProgress(ToolbarBOTTOM, PR_CN, LBL_STATUS, "Downloading data") With {.PerformMod = 10, .ResetProgressOnMaximumChanges = False}
CProvider = New ANumbers With {.FormatOptions = ANumbers.Options.GroupIntegral} CProvider = New ANumbers With {.FormatOptions = ANumbers.Options.GroupIntegral}
LimitProvider = New ADateTime("dd.MM.yyyy HH:mm") LimitProvider = New ADateTime("dd.MM.yyyy HH:mm")
PendingUsers = New List(Of PendingUser) PendingUsers = New List(Of PendingUser)
@@ -330,9 +330,9 @@ Friend Class ChannelViewForm : Implements IChannelLimits
If Not TokenSource Is Nothing OrElse Not HOST.Source.Available(Plugin.ISiteSettings.Download.Channel, False) Then Exit Sub If Not TokenSource Is Nothing OrElse Not HOST.Source.Available(Plugin.ISiteSettings.Download.Channel, False) Then Exit Sub
Dim InvokeToken As Action = Sub() Dim InvokeToken As Action = Sub()
If TokenSource Is Nothing Then If TokenSource Is Nothing Then
CProgress.TotalCount = 0 CProgress.Maximum = 0
CProgress.CurrentCounter = 0 CProgress.Value = 0
CProgress.Enabled = True CProgress.Visible = True
TokenSource = New CancellationTokenSource TokenSource = New CancellationTokenSource
Token = TokenSource.Token Token = TokenSource.Token
BTT_DOWNLOAD.Enabled = False BTT_DOWNLOAD.Enabled = False
@@ -389,7 +389,7 @@ Friend Class ChannelViewForm : Implements IChannelLimits
Finally Finally
If Not TokenSource Is Nothing AndAlso Not Settings.Channels.Downloading Then If Not TokenSource Is Nothing AndAlso Not Settings.Channels.Downloading Then
TokenSource = Nothing TokenSource = Nothing
CProgress.Enabled = False CProgress.Visible = False
BTT_DOWNLOAD.Enabled = True BTT_DOWNLOAD.Enabled = True
BTT_STOP.Enabled = False BTT_STOP.Enabled = False
_CollectionDownloading = False _CollectionDownloading = False

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

View File

@@ -23,8 +23,8 @@ Namespace DownloadObjects
Friend Sub New() Friend Sub New()
InitializeComponent() InitializeComponent()
JobsList = New List(Of DownloadProgress) JobsList = New List(Of DownloadProgress)
AddHandler Downloader.OnReconfigured, AddressOf Downloader_OnReconfigured AddHandler Downloader.Reconfigured, AddressOf Downloader_Reconfigured
Downloader_OnReconfigured() Downloader_Reconfigured()
End Sub End Sub
Private Sub ActiveDownloadingProgress_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub ActiveDownloadingProgress_Load(sender As Object, e As EventArgs) Handles Me.Load
MyView = New FormsView(Me) MyView = New FormsView(Me)
@@ -37,7 +37,7 @@ Namespace DownloadObjects
e.Cancel = True e.Cancel = True
Hide() Hide()
End Sub End Sub
Private Sub Downloader_OnReconfigured() Private Sub Downloader_Reconfigured()
Const RowHeight% = 30 Const RowHeight% = 30
Dim a As Action = Sub() Dim a As Action = Sub()
With TP_MAIN With TP_MAIN
@@ -58,7 +58,7 @@ Namespace DownloadObjects
.RowStyles.Add(New RowStyle(SizeType.Absolute, RowHeight)) .RowStyles.Add(New RowStyle(SizeType.Absolute, RowHeight))
.RowCount += 1 .RowCount += 1
JobsList.Add(New DownloadProgress(j)) JobsList.Add(New DownloadProgress(j))
AddHandler JobsList.Last.OnTotalCountChange, AddressOf Jobs_OnTotalCountChange AddHandler JobsList.Last.ProgressMaximumChanged, AddressOf Jobs_ProgressMaximumChanged
.Controls.Add(JobsList.Last.Get, 0, .RowStyles.Count - 1) .Controls.Add(JobsList.Last.Get, 0, .RowStyles.Count - 1)
End With End With
Next Next
@@ -74,11 +74,11 @@ Namespace DownloadObjects
End Sub End Sub
If TP_MAIN.InvokeRequired Then TP_MAIN.Invoke(a) Else a.Invoke If TP_MAIN.InvokeRequired Then TP_MAIN.Invoke(a) Else a.Invoke
End Sub End Sub
Private Sub Jobs_OnTotalCountChange() Private Sub Jobs_ProgressMaximumChanged()
If JobsList.Count > 0 And Not DisableProgressChange Then If JobsList.Count > 0 And Not DisableProgressChange Then
MainProgress.TotalCount = JobsList.Sum(Function(j) CLng(j.Job.Progress.TotalCount)) MainProgress.Maximum = JobsList.Sum(Function(j) CLng(j.Job.Progress.Maximum))
MainProgress.CurrentCounter = Math.Max(JobsList.Sum(Function(j) CLng(j.Job.Progress.CurrentCounter)) - 1, 0) MainProgress.Value = Math.Max(JobsList.Sum(Function(j) CLng(j.Job.Progress.Value)) - 1, 0)
If MainProgress.CurrentCounter > 0 Then MainProgress.Perform() If MainProgress.Value > 0 Then MainProgress.Perform()
End If End If
End Sub End Sub
End Class End Class

View File

@@ -16,10 +16,9 @@ Imports SCrawler.API
Imports SCrawler.API.Base Imports SCrawler.API.Base
Namespace DownloadObjects Namespace DownloadObjects
Friend Class AutoDownloader : Inherits GroupParameters : Implements IEContainerProvider Friend Class AutoDownloader : Inherits GroupParameters : Implements IEContainerProvider
Friend Event UserFind(ByVal Key As String, ByVal Activate As Boolean) Private Shared ReadOnly Property CachePath As SFile
Friend Shared ReadOnly Property CachePath As SFile
Get Get
Return "_Cache\" Return Settings.CachePath
End Get End Get
End Property End Property
Friend Enum Modes As Integer Friend Enum Modes As Integer
@@ -85,12 +84,14 @@ Namespace DownloadObjects
Using Notify As New Notification(Text, Title) With {.Key = Key} Using Notify As New Notification(Text, Title) With {.Key = Key}
Dim uPic As SFile = Nothing Dim uPic As SFile = Nothing
Dim uif As SFile = Nothing Dim uif As SFile = Nothing
Dim uif_orig As SFile = Nothing
Dim uif_compressed As SFile = Nothing Dim uif_compressed As SFile = Nothing
Dim uifKey$ = String.Empty Dim uifKey$ = String.Empty
If AutoDownloaderSource.ShowPictureUser Then uPic = DirectCast(User, UserDataBase).GetUserPictureToastAddress If AutoDownloaderSource.ShowPictureUser Then uPic = DirectCast(User, UserDataBase).GetUserPictureToastAddress
If AutoDownloaderSource.ShowPictureUser AndAlso uPic.Exists Then Notify.Images = {New ToastImage(uPic)} If AutoDownloaderSource.ShowPictureUser AndAlso uPic.Exists Then Notify.Images = {New ToastImage(uPic)}
If AutoDownloaderSource.ShowPictureDownloaded And User.DownloadedPictures(False) > 0 Then If AutoDownloaderSource.ShowPictureDownloaded And User.DownloadedPictures(False) > 0 Then
uif = DirectCast(User, UserDataBase).GetLastImageAddress uif = DirectCast(User, UserDataBase).GetLastImageAddress
uif_orig = uif
If uif.Exists Then If uif.Exists Then
uif_compressed = uif uif_compressed = uif
uif_compressed.Path = CachePath.Path uif_compressed.Path = CachePath.Path
@@ -102,7 +103,7 @@ Namespace DownloadObjects
If uif.Exists Then If uif.Exists Then
Notify.Images = {New ToastImage(uif, IImage.Modes.Inline)} Notify.Images = {New ToastImage(uif, IImage.Modes.Inline)}
uifKey = $"{Key}_{Images.Keys.Count + 1}_{KeyBttPhoto}" uifKey = $"{Key}_{Images.Keys.Count + 1}_{KeyBttPhoto}"
If Not Images.ContainsKey(uifKey) Then Images.Add(uifKey, uif) If Not Images.ContainsKey(uifKey) Then Images.Add(uifKey, uif_orig)
End If End If
End If End If
End If End If
@@ -174,6 +175,7 @@ Namespace DownloadObjects
Private Const Name_ShowNotifications As String = "Notify" Private Const Name_ShowNotifications As String = "Notify"
Private Const Name_ShowPictureDown As String = "ShowDownloadedPicture" Private Const Name_ShowPictureDown As String = "ShowDownloadedPicture"
Private Const Name_ShowPictureUser As String = "ShowUserPicture" Private Const Name_ShowPictureUser As String = "ShowUserPicture"
Private Const Name_ShowSimpleNotification As String = "ShowSimpleNotification"
#End Region #End Region
#Region "Declarations" #Region "Declarations"
Friend Property Source As Scheduler Friend Property Source As Scheduler
@@ -193,6 +195,7 @@ Namespace DownloadObjects
Friend Property ShowNotifications As Boolean = True Friend Property ShowNotifications As Boolean = True
Friend Property ShowPictureDownloaded As Boolean = True Friend Property ShowPictureDownloaded As Boolean = True
Friend Property ShowPictureUser As Boolean = True Friend Property ShowPictureUser As Boolean = True
Friend Property ShowSimpleNotification As Boolean = False
#Region "Date" #Region "Date"
Private ReadOnly LastDownloadDateXML As Date? = Nothing Private ReadOnly LastDownloadDateXML As Date? = Nothing
Private _LastDownloadDate As Date = Now.AddYears(-1) Private _LastDownloadDate As Date = Now.AddYears(-1)
@@ -279,6 +282,7 @@ Namespace DownloadObjects
ShowNotifications = x.Value(Name_ShowNotifications).FromXML(Of Boolean)(True) ShowNotifications = x.Value(Name_ShowNotifications).FromXML(Of Boolean)(True)
ShowPictureDownloaded = x.Value(Name_ShowPictureDown).FromXML(Of Boolean)(True) ShowPictureDownloaded = x.Value(Name_ShowPictureDown).FromXML(Of Boolean)(True)
ShowPictureUser = x.Value(Name_ShowPictureUser).FromXML(Of Boolean)(True) ShowPictureUser = x.Value(Name_ShowPictureUser).FromXML(Of Boolean)(True)
ShowSimpleNotification = x.Value(Name_ShowSimpleNotification).FromXML(Of Boolean)(False)
LastDownloadDateXML = AConvert(Of Date)(x.Value(Name_LastDownloadDate), DateProvider, Nothing) LastDownloadDateXML = AConvert(Of Date)(x.Value(Name_LastDownloadDate), DateProvider, Nothing)
If LastDownloadDateXML.HasValue Then If LastDownloadDateXML.HasValue Then
LastDownloadDate = LastDownloadDateXML.Value LastDownloadDate = LastDownloadDateXML.Value
@@ -321,6 +325,7 @@ Namespace DownloadObjects
New EContainer(Name_ShowNotifications, ShowNotifications.BoolToInteger), New EContainer(Name_ShowNotifications, ShowNotifications.BoolToInteger),
New EContainer(Name_ShowPictureDown, ShowPictureDownloaded.BoolToInteger), New EContainer(Name_ShowPictureDown, ShowPictureDownloaded.BoolToInteger),
New EContainer(Name_ShowPictureUser, ShowPictureUser.BoolToInteger), New EContainer(Name_ShowPictureUser, ShowPictureUser.BoolToInteger),
New EContainer(Name_ShowSimpleNotification, ShowSimpleNotification.BoolToInteger),
New EContainer(Name_LastDownloadDate, CStr(AConvert(Of String)(If(LastDownloadDateXML.HasValue Or _LastDownloadDateChanged, New EContainer(Name_LastDownloadDate, CStr(AConvert(Of String)(If(LastDownloadDateXML.HasValue Or _LastDownloadDateChanged,
CObj(LastDownloadDate), Nothing), DateProvider, String.Empty))) CObj(LastDownloadDate), Nothing), DateProvider, String.Empty)))
} }
@@ -381,12 +386,18 @@ Namespace DownloadObjects
Dim users As New List(Of IUserData) Dim users As New List(Of IUserData)
Dim GName$ Dim GName$
Dim i% Dim i%
Dim DownloadedUsersCount% = 0
Dim l As New ListAddParams(LAP.IgnoreICopier + LAP.NotContainsOnly) Dim l As New ListAddParams(LAP.IgnoreICopier + LAP.NotContainsOnly)
Dim simple As Boolean = ShowSimpleNotification And ShowNotifications
Dim notify As Action = Sub() Dim notify As Action = Sub()
With Downloader.Downloaded With Downloader.Downloaded
If ShowNotifications And .Count > 0 Then .ForEach(Sub(ByVal u As IUserData) If ShowNotifications And .Count > 0 Then .ForEach(Sub(ByVal u As IUserData)
If Keys.Contains(u.Key) Then If Keys.Contains(u.Key) Then
ShowNotification(u) If simple Then
DownloadedUsersCount += 1
Else
ShowNotification(u)
End If
Keys.Remove(u.Key) Keys.Remove(u.Key)
End If End If
End Sub) End Sub)
@@ -426,6 +437,8 @@ Namespace DownloadObjects
While .Working Or .Count > 0 : notify.Invoke() : Thread.Sleep(200) : End While While .Working Or .Count > 0 : notify.Invoke() : Thread.Sleep(200) : End While
.AutoDownloaderWorking = False .AutoDownloaderWorking = False
notify.Invoke notify.Invoke
If simple And DownloadedUsersCount > 0 Then _
MainFrameObj.ShowNotification($"{DownloadedUsersCount} user(s) downloaded with scheduler plan '{Name}'", $"Scheduler plan '{Name}'")
End With End With
End If End If
Catch ex As Exception Catch ex As Exception
@@ -443,14 +456,14 @@ Namespace DownloadObjects
If i >= 0 Then If i >= 0 Then
UserKeys(i).ShowNotification() UserKeys(i).ShowNotification()
Else Else
UserKeys.Add(New NotifiedUser(k, TDownloader.GetUserFromMainCollection(u), Me)) UserKeys.Add(New NotifiedUser(k, Settings.GetUser(u), Me))
UserKeys.Last.ShowNotification() UserKeys.Last.ShowNotification()
End If End If
End Sub End Sub
Friend Function NotificationClicked(ByVal Key As String) As Boolean Friend Function NotificationClicked(ByVal Key As String) As Boolean
Dim i% = UserKeys.IndexOf(Key) Dim i% = UserKeys.IndexOf(Key)
If i >= 0 Then If i >= 0 Then
RaiseEvent UserFind(UserKeys(i).IUserDataKey, UserKeys(i).Open(Key)) MainFrameObj.FocusUser(UserKeys(i).IUserDataKey, UserKeys(i).Open(Key))
Return True Return True
Else Else
Return False Return False

View File

@@ -45,6 +45,7 @@ Namespace DownloadObjects
Me.CH_NOTIFY = New System.Windows.Forms.CheckBox() Me.CH_NOTIFY = New System.Windows.Forms.CheckBox()
Me.CH_SHOW_PIC = New System.Windows.Forms.CheckBox() Me.CH_SHOW_PIC = New System.Windows.Forms.CheckBox()
Me.CH_SHOW_PIC_USER = New System.Windows.Forms.CheckBox() Me.CH_SHOW_PIC_USER = New System.Windows.Forms.CheckBox()
Me.CH_NOTIFY_SIMPLE = New System.Windows.Forms.CheckBox()
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
TP_MODE = New System.Windows.Forms.TableLayoutPanel() TP_MODE = New System.Windows.Forms.TableLayoutPanel()
TP_NOTIFY = New System.Windows.Forms.TableLayoutPanel() TP_NOTIFY = New System.Windows.Forms.TableLayoutPanel()
@@ -119,7 +120,7 @@ Namespace DownloadObjects
Me.TXT_GROUPS.Location = New System.Drawing.Point(4, 140) Me.TXT_GROUPS.Location = New System.Drawing.Point(4, 140)
Me.TXT_GROUPS.Name = "TXT_GROUPS" Me.TXT_GROUPS.Name = "TXT_GROUPS"
Me.TXT_GROUPS.Size = New System.Drawing.Size(468, 22) Me.TXT_GROUPS.Size = New System.Drawing.Size(468, 22)
Me.TXT_GROUPS.TabIndex = 2 Me.TXT_GROUPS.TabIndex = 1
' '
'TP_MODE 'TP_MODE
' '
@@ -220,7 +221,7 @@ Namespace DownloadObjects
Me.TXT_TIMER.Location = New System.Drawing.Point(4, 195) Me.TXT_TIMER.Location = New System.Drawing.Point(4, 195)
Me.TXT_TIMER.Name = "TXT_TIMER" Me.TXT_TIMER.Name = "TXT_TIMER"
Me.TXT_TIMER.Size = New System.Drawing.Size(468, 22) Me.TXT_TIMER.Size = New System.Drawing.Size(468, 22)
Me.TXT_TIMER.TabIndex = 2 Me.TXT_TIMER.TabIndex = 3
' '
'LBL_LAST_TIME_UP 'LBL_LAST_TIME_UP
' '
@@ -230,7 +231,7 @@ Namespace DownloadObjects
Me.LBL_LAST_TIME_UP.Location = New System.Drawing.Point(4, 250) Me.LBL_LAST_TIME_UP.Location = New System.Drawing.Point(4, 250)
Me.LBL_LAST_TIME_UP.Name = "LBL_LAST_TIME_UP" Me.LBL_LAST_TIME_UP.Name = "LBL_LAST_TIME_UP"
Me.LBL_LAST_TIME_UP.Size = New System.Drawing.Size(468, 25) Me.LBL_LAST_TIME_UP.Size = New System.Drawing.Size(468, 25)
Me.LBL_LAST_TIME_UP.TabIndex = 4 Me.LBL_LAST_TIME_UP.TabIndex = 5
Me.LBL_LAST_TIME_UP.Text = "Last download date: " Me.LBL_LAST_TIME_UP.Text = "Last download date: "
Me.LBL_LAST_TIME_UP.TextAlign = System.Drawing.ContentAlignment.TopCenter Me.LBL_LAST_TIME_UP.TextAlign = System.Drawing.ContentAlignment.TopCenter
' '
@@ -251,27 +252,28 @@ Namespace DownloadObjects
Me.NUM_DELAY.NumberMaximum = New Decimal(New Integer() {1440, 0, 0, 0}) Me.NUM_DELAY.NumberMaximum = New Decimal(New Integer() {1440, 0, 0, 0})
Me.NUM_DELAY.NumberUpDownAlign = System.Windows.Forms.LeftRightAlignment.Left Me.NUM_DELAY.NumberUpDownAlign = System.Windows.Forms.LeftRightAlignment.Left
Me.NUM_DELAY.Size = New System.Drawing.Size(468, 22) Me.NUM_DELAY.Size = New System.Drawing.Size(468, 22)
Me.NUM_DELAY.TabIndex = 3 Me.NUM_DELAY.TabIndex = 4
Me.NUM_DELAY.Text = "0" Me.NUM_DELAY.Text = "0"
' '
'TP_NOTIFY 'TP_NOTIFY
' '
TP_NOTIFY.ColumnCount = 3 TP_NOTIFY.ColumnCount = 4
TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!)) TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!)) TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333!)) TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_NOTIFY.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0!))
TP_NOTIFY.Controls.Add(Me.CH_NOTIFY, 0, 0) TP_NOTIFY.Controls.Add(Me.CH_NOTIFY, 0, 0)
TP_NOTIFY.Controls.Add(Me.CH_SHOW_PIC, 1, 0) TP_NOTIFY.Controls.Add(Me.CH_SHOW_PIC, 2, 0)
TP_NOTIFY.Controls.Add(Me.CH_SHOW_PIC_USER, 2, 0) TP_NOTIFY.Controls.Add(Me.CH_SHOW_PIC_USER, 3, 0)
TP_NOTIFY.Controls.Add(Me.CH_NOTIFY_SIMPLE, 1, 0)
TP_NOTIFY.Dock = System.Windows.Forms.DockStyle.Fill TP_NOTIFY.Dock = System.Windows.Forms.DockStyle.Fill
TP_NOTIFY.Location = New System.Drawing.Point(1, 166) TP_NOTIFY.Location = New System.Drawing.Point(1, 166)
TP_NOTIFY.Margin = New System.Windows.Forms.Padding(0) TP_NOTIFY.Margin = New System.Windows.Forms.Padding(0)
TP_NOTIFY.Name = "TP_NOTIFY" TP_NOTIFY.Name = "TP_NOTIFY"
TP_NOTIFY.RowCount = 1 TP_NOTIFY.RowCount = 1
TP_NOTIFY.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) TP_NOTIFY.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_NOTIFY.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_NOTIFY.Size = New System.Drawing.Size(474, 25) TP_NOTIFY.Size = New System.Drawing.Size(474, 25)
TP_NOTIFY.TabIndex = 1 TP_NOTIFY.TabIndex = 2
' '
'CH_NOTIFY 'CH_NOTIFY
' '
@@ -279,7 +281,7 @@ Namespace DownloadObjects
Me.CH_NOTIFY.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_NOTIFY.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_NOTIFY.Location = New System.Drawing.Point(3, 3) Me.CH_NOTIFY.Location = New System.Drawing.Point(3, 3)
Me.CH_NOTIFY.Name = "CH_NOTIFY" Me.CH_NOTIFY.Name = "CH_NOTIFY"
Me.CH_NOTIFY.Size = New System.Drawing.Size(152, 19) Me.CH_NOTIFY.Size = New System.Drawing.Size(112, 19)
Me.CH_NOTIFY.TabIndex = 0 Me.CH_NOTIFY.TabIndex = 0
Me.CH_NOTIFY.Text = "Show notifications" Me.CH_NOTIFY.Text = "Show notifications"
TT_MAIN.SetToolTip(Me.CH_NOTIFY, "Show notification when some data has been downloaded") TT_MAIN.SetToolTip(Me.CH_NOTIFY, "Show notification when some data has been downloaded")
@@ -289,11 +291,11 @@ Namespace DownloadObjects
' '
Me.CH_SHOW_PIC.AutoSize = True Me.CH_SHOW_PIC.AutoSize = True
Me.CH_SHOW_PIC.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_SHOW_PIC.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_SHOW_PIC.Location = New System.Drawing.Point(161, 3) Me.CH_SHOW_PIC.Location = New System.Drawing.Point(239, 3)
Me.CH_SHOW_PIC.Name = "CH_SHOW_PIC" Me.CH_SHOW_PIC.Name = "CH_SHOW_PIC"
Me.CH_SHOW_PIC.Size = New System.Drawing.Size(152, 19) Me.CH_SHOW_PIC.Size = New System.Drawing.Size(112, 19)
Me.CH_SHOW_PIC.TabIndex = 1 Me.CH_SHOW_PIC.TabIndex = 2
Me.CH_SHOW_PIC.Text = "Show download picture" Me.CH_SHOW_PIC.Text = "Image"
TT_MAIN.SetToolTip(Me.CH_SHOW_PIC, "Show downloaded image in notification") TT_MAIN.SetToolTip(Me.CH_SHOW_PIC, "Show downloaded image in notification")
Me.CH_SHOW_PIC.UseVisualStyleBackColor = True Me.CH_SHOW_PIC.UseVisualStyleBackColor = True
' '
@@ -301,14 +303,26 @@ Namespace DownloadObjects
' '
Me.CH_SHOW_PIC_USER.AutoSize = True Me.CH_SHOW_PIC_USER.AutoSize = True
Me.CH_SHOW_PIC_USER.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_SHOW_PIC_USER.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_SHOW_PIC_USER.Location = New System.Drawing.Point(319, 3) Me.CH_SHOW_PIC_USER.Location = New System.Drawing.Point(357, 3)
Me.CH_SHOW_PIC_USER.Name = "CH_SHOW_PIC_USER" Me.CH_SHOW_PIC_USER.Name = "CH_SHOW_PIC_USER"
Me.CH_SHOW_PIC_USER.Size = New System.Drawing.Size(152, 19) Me.CH_SHOW_PIC_USER.Size = New System.Drawing.Size(114, 19)
Me.CH_SHOW_PIC_USER.TabIndex = 2 Me.CH_SHOW_PIC_USER.TabIndex = 3
Me.CH_SHOW_PIC_USER.Text = "Show user picture" Me.CH_SHOW_PIC_USER.Text = "User icon"
TT_MAIN.SetToolTip(Me.CH_SHOW_PIC_USER, "Show user image in notification") TT_MAIN.SetToolTip(Me.CH_SHOW_PIC_USER, "Show user image in notification")
Me.CH_SHOW_PIC_USER.UseVisualStyleBackColor = True Me.CH_SHOW_PIC_USER.UseVisualStyleBackColor = True
' '
'CH_NOTIFY_SIMPLE
'
Me.CH_NOTIFY_SIMPLE.AutoSize = True
Me.CH_NOTIFY_SIMPLE.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_NOTIFY_SIMPLE.Location = New System.Drawing.Point(121, 3)
Me.CH_NOTIFY_SIMPLE.Name = "CH_NOTIFY_SIMPLE"
Me.CH_NOTIFY_SIMPLE.Size = New System.Drawing.Size(112, 19)
Me.CH_NOTIFY_SIMPLE.TabIndex = 1
Me.CH_NOTIFY_SIMPLE.Text = "Simple"
TT_MAIN.SetToolTip(Me.CH_NOTIFY_SIMPLE, resources.GetString("CH_NOTIFY_SIMPLE.ToolTip"))
Me.CH_NOTIFY_SIMPLE.UseVisualStyleBackColor = True
'
'AutoDownloaderEditorForm 'AutoDownloaderEditorForm
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -347,11 +361,12 @@ Namespace DownloadObjects
Private WithEvents OPT_SPEC As RadioButton Private WithEvents OPT_SPEC As RadioButton
Private WithEvents OPT_DISABLED As RadioButton Private WithEvents OPT_DISABLED As RadioButton
Private WithEvents CH_NOTIFY As CheckBox Private WithEvents CH_NOTIFY As CheckBox
Friend WithEvents TXT_TIMER As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents TXT_TIMER As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents OPT_GROUP As RadioButton Private WithEvents OPT_GROUP As RadioButton
Private WithEvents LBL_LAST_TIME_UP As Label Private WithEvents LBL_LAST_TIME_UP As Label
Private WithEvents NUM_DELAY As PersonalUtilities.Forms.Controls.TextBoxExtended Private WithEvents NUM_DELAY As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents CH_SHOW_PIC As CheckBox Private WithEvents CH_SHOW_PIC As CheckBox
Private WithEvents CH_SHOW_PIC_USER As CheckBox Private WithEvents CH_SHOW_PIC_USER As CheckBox
Private WithEvents CH_NOTIFY_SIMPLE As CheckBox
End Class End Class
End Namespace End Namespace

View File

@@ -231,6 +231,11 @@
<metadata name="TP_NOTIFY.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="TP_NOTIFY.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<data name="CH_NOTIFY_SIMPLE.ToolTip" xml:space="preserve">
<value>Show a simple notification instead of a user notification.
This means that if any user data has been downloaded with the plan, a simple notification will be shown with the number of users downloaded.
The 'Image' and 'User icon' parameters will be ignored.</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAwAMDAQAAEABABoBgAAxgAAACAgEAABAAQA6AIAAC4HAAAYGBAAAQAEAOgBAAAWCgAAEBAQAAEA AAABAAwAMDAQAAEABABoBgAAxgAAACAgEAABAAQA6AIAAC4HAAAYGBAAAQAEAOgBAAAWCgAAEBAQAAEA

View File

@@ -52,6 +52,7 @@ Namespace DownloadObjects
If MyGroups.Count > 0 Then TXT_GROUPS.Text = MyGroups.ListToString If MyGroups.Count > 0 Then TXT_GROUPS.Text = MyGroups.ListToString
If Settings.Groups.Count = 0 Then TXT_GROUPS.Clear() : TXT_GROUPS.Enabled = False If Settings.Groups.Count = 0 Then TXT_GROUPS.Clear() : TXT_GROUPS.Enabled = False
CH_NOTIFY.Checked = .ShowNotifications CH_NOTIFY.Checked = .ShowNotifications
CH_NOTIFY_SIMPLE.Checked = .ShowSimpleNotification
CH_SHOW_PIC.Checked = .ShowPictureDownloaded CH_SHOW_PIC.Checked = .ShowPictureDownloaded
CH_SHOW_PIC_USER.Checked = .ShowPictureUser CH_SHOW_PIC_USER.Checked = .ShowPictureUser
TXT_TIMER.Text = .Timer TXT_TIMER.Text = .Timer
@@ -86,6 +87,7 @@ Namespace DownloadObjects
.Groups.Clear() .Groups.Clear()
.Groups.ListAddList(MyGroups) .Groups.ListAddList(MyGroups)
.ShowNotifications = CH_NOTIFY.Checked .ShowNotifications = CH_NOTIFY.Checked
.ShowSimpleNotification = CH_NOTIFY_SIMPLE.Checked
.ShowPictureDownloaded = CH_SHOW_PIC.Checked .ShowPictureDownloaded = CH_SHOW_PIC.Checked
.ShowPictureUser = CH_SHOW_PIC_USER.Checked .ShowPictureUser = CH_SHOW_PIC_USER.Checked
.Timer = AConvert(Of Integer)(TXT_TIMER.Text, AutoDownloader.DefaultTimer) .Timer = AConvert(Of Integer)(TXT_TIMER.Text, AutoDownloader.DefaultTimer)
@@ -120,17 +122,15 @@ Namespace DownloadObjects
Private Sub OPT_GROUP_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_GROUP.CheckedChanged Private Sub OPT_GROUP_CheckedChanged(sender As Object, e As EventArgs) Handles OPT_GROUP.CheckedChanged
ChangeEnabled() ChangeEnabled()
End Sub End Sub
Private Sub CH_NOTIFY_CheckedChanged(sender As Object, e As EventArgs) Handles CH_NOTIFY.CheckedChanged Private Sub ChangeEnabled() Handles CH_NOTIFY.CheckedChanged, CH_NOTIFY_SIMPLE.CheckedChanged
ChangeEnabled()
End Sub
Private Sub ChangeEnabled()
DEF_GROUP.Enabled = OPT_SPEC.Checked DEF_GROUP.Enabled = OPT_SPEC.Checked
TXT_GROUPS.Enabled = OPT_GROUP.Checked TXT_GROUPS.Enabled = OPT_GROUP.Checked
TXT_TIMER.Enabled = Not OPT_DISABLED.Checked TXT_TIMER.Enabled = Not OPT_DISABLED.Checked
NUM_DELAY.Enabled = Not OPT_DISABLED.Checked NUM_DELAY.Enabled = Not OPT_DISABLED.Checked
CH_NOTIFY.Enabled = Not OPT_DISABLED.Checked CH_NOTIFY.Enabled = Not OPT_DISABLED.Checked
CH_SHOW_PIC.Enabled = CH_NOTIFY.Checked And Not OPT_DISABLED.Checked CH_NOTIFY_SIMPLE.Enabled = CH_NOTIFY.Enabled And CH_NOTIFY.Checked
CH_SHOW_PIC_USER.Enabled = CH_NOTIFY.Checked And Not OPT_DISABLED.Checked CH_SHOW_PIC.Enabled = CH_NOTIFY.Checked And Not OPT_DISABLED.Checked And Not CH_NOTIFY_SIMPLE.Checked
CH_SHOW_PIC_USER.Enabled = CH_NOTIFY.Checked And Not OPT_DISABLED.Checked And Not CH_NOTIFY_SIMPLE.Checked
End Sub End Sub
Private Sub NUM_DELAY_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles NUM_DELAY.ActionOnButtonClick Private Sub NUM_DELAY_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles NUM_DELAY.ActionOnButtonClick
If Sender.DefaultButton = ActionButton.DefaultButtons.Clear Then NUM_DELAY.Value = 0 If Sender.DefaultButton = ActionButton.DefaultButtons.Clear Then NUM_DELAY.Value = 0

View File

@@ -0,0 +1,117 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Namespace DownloadObjects
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Friend Class DownloadFeedForm : Inherits System.Windows.Forms.Form
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Dim SEP_1 As System.Windows.Forms.ToolStripSeparator
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(DownloadFeedForm))
Me.ToolbarTOP = New System.Windows.Forms.ToolStrip()
Me.BTT_REFRESH = New System.Windows.Forms.ToolStripButton()
Me.BTT_CLEAR = New System.Windows.Forms.ToolStripButton()
Me.TP_DATA = New System.Windows.Forms.TableLayoutPanel()
SEP_1 = New System.Windows.Forms.ToolStripSeparator()
Me.ToolbarTOP.SuspendLayout()
Me.SuspendLayout()
'
'SEP_1
'
SEP_1.Name = "SEP_1"
SEP_1.Size = New System.Drawing.Size(6, 25)
'
'ToolbarTOP
'
Me.ToolbarTOP.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
Me.ToolbarTOP.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_REFRESH, Me.BTT_CLEAR, SEP_1})
Me.ToolbarTOP.Location = New System.Drawing.Point(0, 0)
Me.ToolbarTOP.Name = "ToolbarTOP"
Me.ToolbarTOP.Size = New System.Drawing.Size(484, 25)
Me.ToolbarTOP.TabIndex = 0
'
'BTT_REFRESH
'
Me.BTT_REFRESH.Image = Global.SCrawler.My.Resources.Resources.Refresh
Me.BTT_REFRESH.ImageTransparentColor = System.Drawing.Color.Magenta
Me.BTT_REFRESH.Name = "BTT_REFRESH"
Me.BTT_REFRESH.Size = New System.Drawing.Size(66, 22)
Me.BTT_REFRESH.Text = "Refresh"
Me.BTT_REFRESH.ToolTipText = "Refresh data list"
'
'BTT_CLEAR
'
Me.BTT_CLEAR.Image = Global.SCrawler.My.Resources.Resources.Delete
Me.BTT_CLEAR.ImageTransparentColor = System.Drawing.Color.Magenta
Me.BTT_CLEAR.Name = "BTT_CLEAR"
Me.BTT_CLEAR.Size = New System.Drawing.Size(54, 22)
Me.BTT_CLEAR.Text = "Clear"
Me.BTT_CLEAR.ToolTipText = "Clear data list"
'
'TP_DATA
'
Me.TP_DATA.AutoScroll = True
Me.TP_DATA.ColumnCount = 1
Me.TP_DATA.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_DATA.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
Me.TP_DATA.Dock = System.Windows.Forms.DockStyle.Fill
Me.TP_DATA.Location = New System.Drawing.Point(0, 25)
Me.TP_DATA.Name = "TP_DATA"
Me.TP_DATA.RowCount = 11
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TP_DATA.Size = New System.Drawing.Size(484, 436)
Me.TP_DATA.TabIndex = 1
'
'DownloadFeedForm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.Window
Me.ClientSize = New System.Drawing.Size(484, 461)
Me.Controls.Add(Me.TP_DATA)
Me.Controls.Add(Me.ToolbarTOP)
Me.ForeColor = System.Drawing.SystemColors.WindowText
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.KeyPreview = True
Me.MinimumSize = New System.Drawing.Size(300, 300)
Me.Name = "DownloadFeedForm"
Me.Text = "Download Feed"
Me.ToolbarTOP.ResumeLayout(False)
Me.ToolbarTOP.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Private WithEvents ToolbarTOP As ToolStrip
Private WithEvents TP_DATA As TableLayoutPanel
Private WithEvents BTT_REFRESH As ToolStripButton
Private WithEvents BTT_CLEAR As ToolStripButton
End Class
End Namespace

View File

@@ -0,0 +1,203 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="SEP_1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="ToolbarTOP.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAABMLAAATCwAAAAAAAAAA
AAAZeOoAGXjqJBl46p4ZeOrtGXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq7Rl4
6p4ZeOokGXjqABl46iQZeOq+GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46r4ZeOokGXjqnhl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46p4ZeOrrGXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GHfq/xh3
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8Yd+r/F3fq/xd36v8Xd+r/GHjq/xl46v8ZeOr/GHjq/xd3
6v8Xd+r/F3fq/xh36v8ZeOr/GXjq/xl46v8ZeOr/GXjq6xl46v4ZeOr/GXjq/xl46v8ZeOr/GHfq/xl4
6v8pguz/KYHr/xl46v8Yd+r/GXjq/xl46v8ZeOr/GXjq/yqC7P8yh+z/Mofs/zKH7P8mf+v/GXjq/xl4
6v8hfev/Mofs/zOH7P8zh+z/L4Xs/xt56v8ZeOr/GXjq/xl46v8ZeOr+GXjq/xl46v8ZeOr/GXjq/xh3
6v8ogev/j731/9Xm+//T5fv/ibr0/yV/6/8Yd+r/GXjq/xl46v8ceur/o8n3/+Pv/P/g7fz/4+78/3qx
8/8Wdur/Fnbq/1id8P/e7Pz/4e38/+Pu/P/A2vn/KoLs/xh36v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/4289f/+/v/////////////9/v//hbf0/xh36v8ZeOr/GHjq/yN+6//J3/r/////////
////////fLLz/xV26v8Vdur/bKjy//7+/////////////9Pl+/8ogev/GHfq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xh36v8ogev/0eT7///////////////////////K4Pr/JH/r/xh46v8Xd+r/N4rt/+Pv
/P////////////v9//9hovH/FXbq/xV26v+CtfT/////////////////xN36/yF96/8YeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GHfq/yeA6//P4/v//////////////////////8jf+v8jfuv/GHjq/xV2
6v9npvH/+/3/////////////6vP9/z+P7v8Xd+r/GXjq/6PJ9/////////////////+rzvf/Gnnq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GHjq/4W39P/8/f/////////////6/P//fLLz/xh3
6v8YeOr/IHzr/7bU+P/////////////////C2/n/In3r/xh36v8mgOv/zOH6/////////////////4e4
9P8Wdur/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8Yd+r/JH7r/4C18//I3/r/x976/3uy
8/8hfev/GHjq/xZ26v9lpfH/9fn+/////////////////32z8/8Wdur/Fnbq/0qU7v/w9v7/////////
///4+/7/Wp7w/xV26v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8YeOr/GHfq/yN+
6/8ifev/F3fq/xh46v8Wdur/QI/u/9jo+//////////////////a6vz/NYnt/xd36v8Xd+r/i7v0////
/////////////9zr/P8yhuz/F3fq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GHjq/xh46v8YeOr/Fnbq/z+O7f/I3/r//////////////////P3//32z8/8Xd+r/F3fq/zCF
7P/V5vv/////////////////pMr3/xp56v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xh46v8Xd+r/FXbq/x976/9jo/H/1+f7//////////////////////+41fj/JoDr/xh3
6v8Xd+r/frPz//3+//////////////b6/v9anvD/Fnbq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8beer/IX3r/zSI7P9jpPH/s9P4//T5/v//////////////////////0uX7/z2N
7f8Xd+r/Fnfq/z2N7f/d6/z/////////////////wNr5/yR+6/8YeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8Yd+r/JoDr/53F9v/G3vr/4e38//n8/v///////////////////////////9Pl
+/9IlO7/Fnfq/xh36v8ifev/rc/4//////////////////b6/v9jo/H/Fnbq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xh36v8thOz/2+r8//////////////////////////////////z9
//+61/n/Po7t/xZ36v8YeOr/G3nq/4m69P/7/P//////////////////r9D4/yF86/8YeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GHfq/y2E7P/b6vz///////////////////////7+
///e7Pz/gLTz/yeA6/8Xd+r/GHfq/xt56v97svP/9Pj+/////////////////+Dt/P9DkO7/Fnfq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8Yd+r/LYTs/9vq/P///////P3//+31
/f/G3vr/gbX0/ziK7f8Xd+r/GHfq/xd36v8hfev/h7j0//T4/v/////////////////0+P7/bKny/xd3
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xh46v8kfuv/e7Hz/4G1
9P9mpfH/Q5Hu/yR+6/8Wdur/F3fq/xh36v8Wdur/OYvt/6rN9//5/P7/////////////////+vz//4q7
9P8ceur/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8Wdur/FXbq/xV26v8Wdur/GHfq/xZ26v8Wdur/K4Ps/3ev8//a6fz///////////////////////r8
//+VwfX/IHzr/xh36v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xZ26v8Vdur/FXbq/xd36v8ifev/QpDu/4K29P/Q4/v/+/3/////////////////////
///1+f7/jLz1/yF96/8Yd+r/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ee+r/T5fv/2Oj8f94sPP/msT2/8Td+v/s9P3//v7/////////////////////
////////4+/8/3Cr8v8ceur/GHfq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GHfq/yyD7P/V5vv//v//////////////////////////////////////
////////+Pv+/7XU+P9Gku7/F3fq/xh46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8Yd+r/LYPs/9rp/P//////////////////////////////
////////+Pv+/8fe+v9pp/H/In7r/xZ26v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xh36v8thOz/2un8////////////////////
///7/f//4+/8/63P+P9io/H/J4Dr/xZ26v8YeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GHfq/yqC7P+/2vn/3Ov8/83i
+v+11Pj/kb71/2Ok8f83iu3/HHrq/xZ26v8Yd+r/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr+GXjq/xl46v8ZeOr/G3nq/y6E
7P8thOz/JX/r/xx66v8Xd+r/FXbq/xd36v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/hl46usZeOr/GXjq/xl4
6v8ZeOr/GHfq/xh36v8YeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOrrGXjqnhl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6p4ZeOokGXjqvhl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOq+GXjqJBl46gAZeOokGXjqnxl46u0ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl46v8ZeOr/GXjq/xl4
6v8ZeOrtGXjqnhl46iQZeOoAgAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAE=
</value>
</data>
</root>

View File

@@ -0,0 +1,374 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.ComponentModel
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Toolbars
Imports PersonalUtilities.Tools
Imports RCI = PersonalUtilities.Forms.Toolbars.RangeSwitcherToolbar.ControlItem
Imports UserMediaD = SCrawler.DownloadObjects.TDownloader.UserMediaD
Namespace DownloadObjects
Friend Class DownloadFeedForm
#Region "Declarations"
Private WithEvents MyDefs As DefaultFormOptions
Private WithEvents MyRange As RangeSwitcherToolbar(Of UserMediaD)
Private ReadOnly DataList As List(Of UserMediaD)
Private WithEvents BTT_DELETE_SELECTED As ToolStripButton
Private WithEvents LBL_FILES As ToolStripLabel
Private DataRows As Integer = 10
Private DataColumns As Integer = 1
Private FeedEndless As Boolean = False
Private ReadOnly FileNotExist As Predicate(Of UserMediaD) = Function(d) Not d.Data.File.Exists
#End Region
#Region "Initializer"
Friend Sub New()
InitializeComponent()
MyDefs = New DefaultFormOptions(Me, Settings.Design)
MyRange = New RangeSwitcherToolbar(Of UserMediaD)(ToolbarTOP)
DataList = New List(Of UserMediaD)
LBL_FILES = New ToolStripLabel With {.Text = String.Empty, .AutoToolTip = False, .ToolTipText = String.Empty}
BTT_DELETE_SELECTED = New ToolStripButton With {
.Text = "Delete selected",
.AutoToolTip = True,
.ToolTipText = "Delete marked files",
.Image = My.Resources.Delete,
.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
}
End Sub
#End Region
#Region "Form handlers"
Private Sub DownloadFeedForm_Load(sender As Object, e As EventArgs) Handles Me.Load
With MyDefs
.MyViewInitialize()
LastWinState = WindowState
With MyRange
.AutoToolTip = True
.ButtonKey(RCI.Previous) = Keys.F3
.ButtonKey(RCI.Next) = Keys.F4
.AddThisToolbar()
End With
ToolbarTOP.Items.AddRange({New ToolStripSeparator, BTT_DELETE_SELECTED, New ToolStripSeparator, LBL_FILES})
UpdateSettings()
RefillList()
.EndLoaderOperations(False)
End With
End Sub
Private Sub DownloadFeedForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
e.Cancel = True
Hide()
End Sub
Private Sub DownloadFeedForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
ClearTable()
MyRange.Dispose()
BTT_CLEAR.Dispose()
DataList.Clear()
LBL_FILES.Dispose()
End Sub
Private Sub DownloadFeedForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F5 Then RefillList() : e.Handled = True
End Sub
#End Region
#Region "Settings"
Friend Sub UpdateSettings()
With Settings
Dim c% = .FeedDataRows * .FeedDataColumns
Dim rangeChanged As Boolean = Not c = DataRows * DataColumns
DataRows = .FeedDataRows
DataColumns = .FeedDataColumns
FeedEndless = .FeedEndless
If rangeChanged Then
ClearTable()
ControlInvoke(TP_DATA, Sub()
With TP_DATA
.RowStyles.Clear()
.RowCount = 0
.ColumnStyles.Clear()
.ColumnCount = 0
Dim i%
Dim p% = IIf(DataColumns = 1, 100, 50)
For i = 0 To DataColumns - 1 : .ColumnStyles.Add(New ColumnStyle(SizeType.Percent, p)) : Next
.ColumnCount = .ColumnStyles.Count
For i = 0 To DataRows : .RowStyles.Add(New RowStyle(SizeType.Absolute, 0)) : Next
.RowCount = .RowStyles.Count
.HorizontalScroll.Visible = False
End With
End Sub)
End If
MyRange.HandlersSuspended = True
MyRange.Limit = c
MyRange.HandlersSuspended = False
If Not MyDefs.Initializing And rangeChanged Then RefillList()
End With
End Sub
#End Region
#Region "Refill"
Friend Sub Downloader_FilesChanged(ByVal Added As Boolean)
ControlInvoke(ToolbarTOP, LBL_FILES, Sub() LBL_FILES.Text = IIf(Added, "New files found", "Some files have been removed"))
LBL_FILES.ControlChangeColor(ToolbarTOP, Added, False)
End Sub
Private Sub RefillList() Handles BTT_REFRESH.Click
DataPopulated = False
Try : Downloader.Files.RemoveAll(FileNotExist) : Catch : End Try
DataList.ListAddList(Downloader.Files, LAP.ClearBeforeAdd, LAP.NotContainsOnly)
MyRange.Source = DataList
ControlInvoke(ToolbarTOP, LBL_FILES, Sub() LBL_FILES.Text = String.Empty)
LBL_FILES.ControlDropColor(ToolbarTOP)
If DataList.Count = 0 Then
ClearTable()
ElseIf Not DataPopulated Then
MyRange_IndexChanged(MyRange, Nothing)
End If
End Sub
Private Sub BTT_CLEAR_Click(sender As Object, e As EventArgs) Handles BTT_CLEAR.Click
Downloader.Files.Clear()
ClearTable()
RefillList()
End Sub
#End Region
#Region "Delete"
Private Sub BTT_DELETE_SELECTED_Click(sender As Object, e As EventArgs) Handles BTT_DELETE_SELECTED.Click
Const MsgTitle$ = "Deleting marked files"
Try
Dim c As IEnumerable(Of FeedMedia) = ControlInvoke(TP_DATA, Function() If(TP_DATA.Controls.Count > 0, TP_DATA.Controls.ToObjectsList.Cast(Of FeedMedia)().Where(Function(f) f.Checked), New FeedMedia() {}))
If c.ListExists Then
If MsgBoxE({$"Are you sure you want to delete {c.Count} file(s)?", MsgTitle}, vbExclamation,,, {"Process", "Cancel"}) = 0 Then
Dim indx% = MyRange.CurrentIndex
Dim d% = 0
ControlInvoke(TP_DATA, Sub()
With TP_DATA
.SuspendLayout()
For Each fm As FeedMedia In c
If fm.DeleteFile(True) Then
d += 1
DataList.RemoveAll(Function(dd) dd.Data.File = fm.File)
TPRemoveControl(fm, False)
End If
Next
.ResumeLayout(True)
End With
End Sub)
If d > 0 Then RefillAfterDelete()
MsgBoxE({$"{d}/{c.Count} file(s) deleted", MsgTitle})
Else
MsgBoxE({"Operation canceled", MsgTitle})
End If
Else
MsgBoxE({"No files selected", MsgTitle}, vbExclamation)
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, MsgTitle)
End Try
End Sub
Private Sub FeedMedia_MediaDeleted(ByVal Sender As FeedMedia)
Try
ControlInvoke(TP_DATA, Sub() TPRemoveControl(Sender, True))
DataList.RemoveAll(Function(dd) dd.Data.File = Sender.File)
RefillAfterDelete()
Catch
End Try
End Sub
Private Sub TPRemoveControl(ByVal CNT As FeedMedia, ByVal Suspend As Boolean)
Try
If Suspend Then TP_DATA.SuspendLayout()
Dim p As TableLayoutPanelCellPosition = TP_DATA.GetCellPosition(CNT)
Dim HeightChanged As Boolean = False
TP_DATA.Controls.Remove(CNT)
CNT.Dispose()
If DataColumns = 1 Then
If p.Column >= 0 And p.Row >= 0 Then TP_DATA.RowStyles(p.Row).Height = 0 : HeightChanged = True
Else
If p.Row.ValueBetween(0, TP_DATA.RowStyles.Count - 1) And p.Column.ValueBetween(0, TP_DATA.ColumnStyles.Count - 1) Then
Dim found As Boolean = False
For i% = 0 To TP_DATA.ColumnStyles.Count - 1
If Not TP_DATA.GetControlFromPosition(i, p.Row) Is Nothing Then found = True : Exit For
Next
If Not found Then TP_DATA.RowStyles(p.Row).Height = 0 : HeightChanged = True
End If
End If
If HeightChanged Then TP_DATA.AutoScroll = False : TP_DATA.AutoScroll = True
Catch
Finally
If Suspend Then TP_DATA.ResumeLayout(True)
End Try
End Sub
Private Sub RefillAfterDelete()
If ControlInvoke(TP_DATA, Function() TP_DATA.Controls.Count) = 0 Then
With MyRange
Dim indx% = .CurrentIndex
.HandlersSuspended = True
.Source = DataList
If .Count > 0 Then
If indx.ValueBetween(0, .Count - 1) Then
.CurrentIndex = indx
ElseIf (indx - 1).ValueBetween(0, .Count - 1) Then
.CurrentIndex = indx - 1
Else
.CurrentIndex = .Count - 1
End If
.HandlersSuspended = False
DirectCast(MyRange.Switcher, RangeSwitcher(Of UserMediaD)).PerformIndexChanged()
End If
.HandlersSuspended = False
End With
End If
End Sub
#End Region
#Region "Range"
Private DataPopulated As Boolean = False
Private Structure TPCELL
Private ReadOnly RowsCount As Integer
Private ReadOnly ColumnsCount As Integer
Friend ReadOnly Row As Integer
Friend ReadOnly Column As Integer
Friend Sub New(ByVal RowsCount As Integer, ByVal ColumnsCount As Integer)
Me.RowsCount = RowsCount
Me.ColumnsCount = ColumnsCount
Row = 0
Column = 0
End Sub
Private Sub New(ByVal RowsCount As Integer, ByVal ColumnsCount As Integer, ByVal Row As Integer, ByVal Column As Integer)
Me.New(RowsCount, ColumnsCount)
Me.Row = Row
Me.Column = Column
End Sub
Friend Function [Next]() As TPCELL
Dim r% = Row
Dim c% = Column + 1
If Not c.ValueBetween(0, ColumnsCount - 1) Then c = 0 : r += 1
Return New TPCELL(RowsCount, ColumnsCount, r, c)
End Function
End Structure
Private RefillInProgress As Boolean = False
Private Sub MyRange_IndexChanged(ByVal Sender As IRangeSwitcherProvider, ByVal e As EventArgs) Handles MyRange.IndexChanged
Try
If Not RefillInProgress AndAlso Sender.CurrentIndex >= 0 Then
RefillInProgress = True
AllowTopScroll = False
ScrollSuspended = True
Dim d As List(Of UserMediaD) = MyRange.Current
Dim d2 As List(Of UserMediaD)
Dim i%
If d.ListExists And d.All(Function(md) FileNotExist(md)) Then
i = Sender.CurrentIndex
Sender.HandlersSuspended = True
RefillList()
If Sender.Count > 0 Then
If i.ValueBetween(0, Sender.Count - 1) Then Sender.CurrentIndex = i
Sender.HandlersSuspended = False
End If
RefillInProgress = False
Sender.HandlersSuspended = False
DirectCast(MyRange.Switcher, RangeSwitcher(Of UserMediaD)).PerformIndexChanged()
Exit Sub
End If
If d.ListExists Then
ClearTable()
If Sender.CurrentIndex > 0 And FeedEndless Then
d2 = DirectCast(MyRange.Switcher, RangeSwitcher(Of UserMediaD)).Item(Sender.CurrentIndex - 1).ListTake(-2, DataColumns, EDP.ReturnValue).ListIfNothing
If d2.Count > 0 Then d.InsertRange(0, d2) : d2.Clear()
End If
Dim w% = GetWidth()
Dim p As New TPCELL(DataRows, DataColumns)
Dim fmList As New List(Of FeedMedia)
d.ForEach(Sub(de) fmList.Add(New FeedMedia(de, w, AddressOf FeedMedia_MediaDeleted)))
If fmList.Count > 0 Then fmList.ListDisposeRemoveAll(Function(fm) fm Is Nothing OrElse fm.HasError)
If fmList.Count > 0 Then
For i = 0 To fmList.Count - 1
ControlInvoke(TP_DATA, Sub() TP_DATA.Controls.Add(fmList(i), p.Column, p.Row))
p = p.Next
Next
End If
ResizeGrid()
fmList.Clear()
d.Clear()
End If
RefillInProgress = False
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[DownloadObjects.DownloadFeedForm.Range.IndexChanged({Sender.CurrentIndex})]")
RefillInProgress = False
Finally
If Not RefillInProgress Then
ControlInvoke(TP_DATA, Sub()
With TP_DATA.VerticalScroll
If Offset = 1 Then .Value = 0 Else .Value = .Maximum
End With
End Sub)
ScrollSuspended = False
DataPopulated = True
End If
End Try
End Sub
#End Region
#Region "Size"
Private LastWinState As FormWindowState = FormWindowState.Normal
Private Function GetWidth() As Integer
Return (TP_DATA.Width - PaddingE.GetOf({Me, TP_DATA}).Horizontal(2)) / DataColumns
End Function
Private Sub DownloadFeedForm_ResizeEnd(sender As Object, e As EventArgs) Handles Me.ResizeEnd
ResizeGrid()
End Sub
Private Sub DownloadFeedForm_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
If Not LastWinState = WindowState And Not If(MyDefs?.Initializing, True) Then LastWinState = WindowState : ResizeGrid()
End Sub
Private Sub ResizeGrid()
ControlInvoke(TP_DATA, Sub()
With TP_DATA
If .Controls.Count > 0 Then
Dim w% = GetWidth()
Dim p As TableLayoutPanelCellPosition
Dim rh As New Dictionary(Of Integer, List(Of Integer))
For Each cnt As FeedMedia In .Controls
cnt.Width = w
p = .GetCellPosition(cnt)
If Not rh.ContainsKey(p.Row) Then rh.Add(p.Row, New List(Of Integer))
rh(p.Row).Add(cnt.Height)
Next
For i% = 0 To .RowStyles.Count - 1 : .RowStyles(i).Height = 0 : Next
If rh.Count > 0 Then
For Each kv In rh
.RowStyles(kv.Key).Height = kv.Value.Max
kv.Value.Clear()
Next
End If
rh.Clear()
.AutoScroll = False
.AutoScroll = True
End If
End With
End Sub)
End Sub
#End Region
#Region "Scroll"
Private AllowTopScroll As Boolean = False
Private ScrollSuspended As Boolean = False
Private Offset As Integer = 1
Private Sub TP_DATA_Paint(sender As Object, e As PaintEventArgs) Handles TP_DATA.Paint
If Not MyDefs.Initializing And Not ScrollSuspended And FeedEndless Then
ControlInvoke(TP_DATA, Sub()
With TP_DATA
Offset = IIf(.VerticalScroll.Value = 0 And AllowTopScroll, -1, 1)
If .VerticalScroll.Value + .VerticalScroll.LargeChange >= .DisplayRectangle.Height Or (.VerticalScroll.Value = 0 And AllowTopScroll) Then
If MyRange.TryMove(Offset) Then MyRange.Move(Offset)
End If
If Not AllowTopScroll And .VerticalScroll.Value > 0 Then AllowTopScroll = True
End With
End Sub)
End If
End Sub
#End Region
Private Sub ClearTable()
ControlInvoke(TP_DATA, Sub()
If TP_DATA.Controls.Count > 0 Then
For Each cnt As Control In TP_DATA.Controls : cnt.Dispose() : Next
TP_DATA.Controls.Clear()
End If
End Sub)
End Sub
End Class
End Namespace

View File

@@ -11,8 +11,8 @@ Imports Download = SCrawler.Plugin.ISiteSettings.Download
Imports TDJob = SCrawler.DownloadObjects.TDownloader.Job Imports TDJob = SCrawler.DownloadObjects.TDownloader.Job
Namespace DownloadObjects Namespace DownloadObjects
Friend Class DownloadProgress : Implements IDisposable Friend Class DownloadProgress : Implements IDisposable
Friend Event OnDownloadDone(ByVal Message As String) Friend Event DownloadDone As NotificationEventHandler
Friend Event OnTotalCountChange() Friend Event ProgressMaximumChanged()
Private ReadOnly TP_MAIN As TableLayoutPanel Private ReadOnly TP_MAIN As TableLayoutPanel
Private ReadOnly TP_CONTROLS As TableLayoutPanel Private ReadOnly TP_CONTROLS As TableLayoutPanel
Private WithEvents BTT_START As Button Private WithEvents BTT_START As Button
@@ -89,10 +89,10 @@ Namespace DownloadObjects
End If End If
With Job With Job
.Progress = New MyProgress(PR_MAIN, LBL_INFO) With {.DropCurrentProgressOnTotalChange = False} .Progress = New MyProgress(PR_MAIN, LBL_INFO) With {.ResetProgressOnMaximumChanges = False}
With .Progress With .Progress
AddHandler .OnProgressChange, AddressOf JobProgress_OnProgressChange AddHandler .ProgressChanged, AddressOf JobProgress_ProgressChanged
AddHandler .OnTotalCountChange, AddressOf JobProgress_OnTotalCountChange AddHandler .MaximumChanged, AddressOf JobProgress_MaximumChanged
End With End With
End With End With
@@ -139,7 +139,7 @@ Namespace DownloadObjects
Job.Progress.InformationTemporary = $"{Job.Host.Name} downloading started" Job.Progress.InformationTemporary = $"{Job.Host.Name} downloading started"
Job.Start() Job.Start()
Instance.Download(Job.Token) Instance.Download(Job.Token)
RaiseEvent OnDownloadDone($"Downloading saved {Job.Host.Name} posts is completed") RaiseEvent DownloadDone($"Downloading saved {Job.Host.Name} posts is completed")
Catch ex As Exception Catch ex As Exception
Job.Progress.InformationTemporary = $"{Job.Host.Name} downloading error" Job.Progress.InformationTemporary = $"{Job.Host.Name} downloading error"
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, {$"{Job.Host.Name} saved posts downloading error", "Saved posts"}) ErrorsDescriber.Execute(EDP.LogMessageValue, ex, {$"{Job.Host.Name} saved posts downloading error", "Saved posts"})
@@ -147,15 +147,15 @@ Namespace DownloadObjects
btte.Invoke(BTT_START, True) btte.Invoke(BTT_START, True)
btte.Invoke(BTT_STOP, False) btte.Invoke(BTT_STOP, False)
Job.Stopped() Job.Stopped()
If Job.Type = Download.SavedPosts Then Job.Progress.TotalCount = 0 : Job.Progress.CurrentCounter = 0 If Job.Type = Download.SavedPosts Then Job.Progress.Maximum = 0 : Job.Progress.Value = 0
End Try End Try
End Sub End Sub
#End Region #End Region
#Region "Progress, Jobs count" #Region "Progress, Jobs count"
Private Sub JobProgress_OnTotalCountChange(ByVal Source As IMyProgress, ByVal Index As Integer) Private Sub JobProgress_MaximumChanged(ByVal Sender As Object, ByVal e As ProgressEventArgs)
RaiseEvent OnTotalCountChange() RaiseEvent ProgressMaximumChanged()
End Sub End Sub
Private Sub JobProgress_OnProgressChange(ByVal Source As IMyProgress, ByVal Index As Integer) Private Sub JobProgress_ProgressChanged(ByVal Sender As Object, ByVal e As ProgressEventArgs)
If Not Job.Type = Download.SavedPosts Then MainProgress.Perform() If Not Job.Type = Download.SavedPosts Then MainProgress.Perform()
End Sub End Sub
#End Region #End Region

View File

@@ -11,7 +11,7 @@ Imports PersonalUtilities.Forms
Imports SCrawler.DownloadObjects Imports SCrawler.DownloadObjects
Imports SCrawler.Plugin.Hosts Imports SCrawler.Plugin.Hosts
Friend Class DownloadSavedPostsForm Friend Class DownloadSavedPostsForm
Friend Event OnDownloadDone As NotificationEventHandler Friend Event DownloadDone As NotificationEventHandler
Private MyView As FormsView Private MyView As FormsView
Private ReadOnly JobsList As List(Of DownloadProgress) Private ReadOnly JobsList As List(Of DownloadProgress)
Friend ReadOnly Property Working As Boolean Friend ReadOnly Property Working As Boolean
@@ -45,7 +45,7 @@ Friend Class DownloadSavedPostsForm
MyView.SetMeSize() MyView.SetMeSize()
If JobsList.Count > 0 Then If JobsList.Count > 0 Then
For Each j As DownloadProgress In JobsList For Each j As DownloadProgress In JobsList
AddHandler j.OnDownloadDone, AddressOf Jobs_OnDownloadDone AddHandler j.DownloadDone, AddressOf Jobs_DownloadDone
TP_MAIN.RowStyles.Add(New RowStyle(SizeType.Absolute, 60)) TP_MAIN.RowStyles.Add(New RowStyle(SizeType.Absolute, 60))
TP_MAIN.RowCount += 1 TP_MAIN.RowCount += 1
TP_MAIN.Controls.Add(j.Get, 0, TP_MAIN.RowStyles.Count - 1) TP_MAIN.Controls.Add(j.Get, 0, TP_MAIN.RowStyles.Count - 1)
@@ -65,8 +65,8 @@ Friend Class DownloadSavedPostsForm
[Stop]() [Stop]()
MyView.Dispose(Settings.Design) MyView.Dispose(Settings.Design)
End Sub End Sub
Private Sub Jobs_OnDownloadDone(ByVal Message As String) Private Sub Jobs_DownloadDone(ByVal Message As String)
RaiseEvent OnDownloadDone(Message) RaiseEvent DownloadDone(Message)
End Sub End Sub
Private Sub BTT_DOWN_ALL_Click(sender As Object, e As EventArgs) Handles BTT_DOWN_ALL.Click Private Sub BTT_DOWN_ALL_Click(sender As Object, e As EventArgs) Handles BTT_DOWN_ALL.Click
Start() Start()

View File

@@ -96,7 +96,7 @@ Namespace DownloadObjects
_TempUsersList.ListAddList(Downloader.Downloaded, LParams) _TempUsersList.ListAddList(Downloader.Downloaded, LParams)
Else Else
_TempUsersList.ListAddList(Settings.Users.SelectMany(Of IUserData) _ _TempUsersList.ListAddList(Settings.Users.SelectMany(Of IUserData) _
(Function(u) If(u.IsCollection, DirectCast(u, API.UserDataBind).Collections, {u})), LParams) (Function(u) If(u.IsCollection, DirectCast(u, API.UserDataBind).Collections, {u})), LParams)
End If End If
If _TempUsersList.Count > 0 Then If _TempUsersList.Count > 0 Then
_TempUsersList.Sort(New UsersDateOrder) _TempUsersList.Sort(New UsersDateOrder)
@@ -166,7 +166,7 @@ Namespace DownloadObjects
Catch Catch
End Try End Try
End Sub End Sub
Friend Sub Downloader_OnDownloadCountChange() Friend Sub Downloader_DownloadCountChange()
If ViewMode = ViewModes.Session Then RefillList() If ViewMode = ViewModes.Session Then RefillList()
End Sub End Sub
Private Sub BTT_UP_Click(sender As Object, e As EventArgs) Handles BTT_UP.Click Private Sub BTT_UP_Click(sender As Object, e As EventArgs) Handles BTT_UP.Click

206
SCrawler/Download/FeedMedia.Designer.vb generated Normal file
View File

@@ -0,0 +1,206 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Namespace DownloadObjects
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Public Class FeedMedia : Inherits System.Windows.Forms.UserControl
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim CONTEXT_SEP_1 As System.Windows.Forms.ToolStripSeparator
Dim CONTEXT_SEP_2 As System.Windows.Forms.ToolStripSeparator
Dim CONTEXT_SEP_3 As System.Windows.Forms.ToolStripSeparator
Dim TP_LBL As System.Windows.Forms.TableLayoutPanel
Me.CH_CHECKED = New System.Windows.Forms.CheckBox()
Me.LBL_INFO = New System.Windows.Forms.Label()
Me.CONTEXT_DATA = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.BTT_CONTEXT_OPEN_MEDIA = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_OPEN_USER = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_OPEN_USER_URL = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_OPEN_USER_POST = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_FIND_USER = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_INFO = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_DELETE = New System.Windows.Forms.ToolStripMenuItem()
Me.TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
CONTEXT_SEP_1 = New System.Windows.Forms.ToolStripSeparator()
CONTEXT_SEP_2 = New System.Windows.Forms.ToolStripSeparator()
CONTEXT_SEP_3 = New System.Windows.Forms.ToolStripSeparator()
TP_LBL = New System.Windows.Forms.TableLayoutPanel()
TP_LBL.SuspendLayout()
Me.CONTEXT_DATA.SuspendLayout()
Me.TP_MAIN.SuspendLayout()
Me.SuspendLayout()
'
'CONTEXT_SEP_1
'
CONTEXT_SEP_1.Name = "CONTEXT_SEP_1"
CONTEXT_SEP_1.Size = New System.Drawing.Size(134, 6)
'
'CONTEXT_SEP_2
'
CONTEXT_SEP_2.Name = "CONTEXT_SEP_2"
CONTEXT_SEP_2.Size = New System.Drawing.Size(134, 6)
'
'CONTEXT_SEP_3
'
CONTEXT_SEP_3.Name = "CONTEXT_SEP_3"
CONTEXT_SEP_3.Size = New System.Drawing.Size(134, 6)
'
'TP_LBL
'
TP_LBL.ColumnCount = 2
TP_LBL.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_LBL.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_LBL.Controls.Add(Me.CH_CHECKED, 0, 0)
TP_LBL.Controls.Add(Me.LBL_INFO, 1, 0)
TP_LBL.Dock = System.Windows.Forms.DockStyle.Fill
TP_LBL.Location = New System.Drawing.Point(0, 0)
TP_LBL.Margin = New System.Windows.Forms.Padding(0)
TP_LBL.Name = "TP_LBL"
TP_LBL.RowCount = 1
TP_LBL.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_LBL.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_LBL.Size = New System.Drawing.Size(146, 25)
TP_LBL.TabIndex = 0
'
'CH_CHECKED
'
Me.CH_CHECKED.AutoSize = True
Me.CH_CHECKED.CheckAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.CH_CHECKED.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_CHECKED.Location = New System.Drawing.Point(3, 3)
Me.CH_CHECKED.Name = "CH_CHECKED"
Me.CH_CHECKED.Size = New System.Drawing.Size(19, 19)
Me.CH_CHECKED.TabIndex = 0
Me.CH_CHECKED.UseVisualStyleBackColor = True
'
'LBL_INFO
'
Me.LBL_INFO.AutoSize = True
Me.LBL_INFO.ContextMenuStrip = Me.CONTEXT_DATA
Me.LBL_INFO.Dock = System.Windows.Forms.DockStyle.Fill
Me.LBL_INFO.Location = New System.Drawing.Point(28, 0)
Me.LBL_INFO.Name = "LBL_INFO"
Me.LBL_INFO.Size = New System.Drawing.Size(115, 25)
Me.LBL_INFO.TabIndex = 1
Me.LBL_INFO.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'CONTEXT_DATA
'
Me.CONTEXT_DATA.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_CONTEXT_OPEN_MEDIA, Me.BTT_CONTEXT_OPEN_USER, CONTEXT_SEP_1, Me.BTT_CONTEXT_OPEN_USER_URL, Me.BTT_CONTEXT_OPEN_USER_POST, CONTEXT_SEP_2, Me.BTT_CONTEXT_FIND_USER, Me.BTT_CONTEXT_INFO, CONTEXT_SEP_3, Me.BTT_CONTEXT_DELETE})
Me.CONTEXT_DATA.Name = "CONTEXT_PIC"
Me.CONTEXT_DATA.Size = New System.Drawing.Size(138, 176)
'
'BTT_CONTEXT_OPEN_MEDIA
'
Me.BTT_CONTEXT_OPEN_MEDIA.Image = Global.SCrawler.My.Resources.Resources.Folder_32
Me.BTT_CONTEXT_OPEN_MEDIA.Name = "BTT_CONTEXT_OPEN_MEDIA"
Me.BTT_CONTEXT_OPEN_MEDIA.Size = New System.Drawing.Size(137, 22)
Me.BTT_CONTEXT_OPEN_MEDIA.Text = "Open"
'
'BTT_CONTEXT_OPEN_USER
'
Me.BTT_CONTEXT_OPEN_USER.Image = Global.SCrawler.My.Resources.Resources.Folder_32
Me.BTT_CONTEXT_OPEN_USER.Name = "BTT_CONTEXT_OPEN_USER"
Me.BTT_CONTEXT_OPEN_USER.Size = New System.Drawing.Size(137, 22)
Me.BTT_CONTEXT_OPEN_USER.Text = "Open user"
'
'BTT_CONTEXT_OPEN_USER_URL
'
Me.BTT_CONTEXT_OPEN_USER_URL.Image = Global.SCrawler.My.Resources.Resources.GlobeBlue_32
Me.BTT_CONTEXT_OPEN_USER_URL.Name = "BTT_CONTEXT_OPEN_USER_URL"
Me.BTT_CONTEXT_OPEN_USER_URL.Size = New System.Drawing.Size(137, 22)
Me.BTT_CONTEXT_OPEN_USER_URL.Text = "Open user"
'
'BTT_CONTEXT_OPEN_USER_POST
'
Me.BTT_CONTEXT_OPEN_USER_POST.Image = Global.SCrawler.My.Resources.Resources.GlobeBlue_32
Me.BTT_CONTEXT_OPEN_USER_POST.Name = "BTT_CONTEXT_OPEN_USER_POST"
Me.BTT_CONTEXT_OPEN_USER_POST.Size = New System.Drawing.Size(137, 22)
Me.BTT_CONTEXT_OPEN_USER_POST.Text = "Open post"
'
'BTT_CONTEXT_FIND_USER
'
Me.BTT_CONTEXT_FIND_USER.Image = Global.SCrawler.My.Resources.Resources.InfoPic_32
Me.BTT_CONTEXT_FIND_USER.Name = "BTT_CONTEXT_FIND_USER"
Me.BTT_CONTEXT_FIND_USER.Size = New System.Drawing.Size(137, 22)
Me.BTT_CONTEXT_FIND_USER.Text = "Find user"
'
'BTT_CONTEXT_INFO
'
Me.BTT_CONTEXT_INFO.Image = Global.SCrawler.My.Resources.Resources.InfoPic_32
Me.BTT_CONTEXT_INFO.Name = "BTT_CONTEXT_INFO"
Me.BTT_CONTEXT_INFO.Size = New System.Drawing.Size(137, 22)
Me.BTT_CONTEXT_INFO.Text = "Information"
'
'BTT_CONTEXT_DELETE
'
Me.BTT_CONTEXT_DELETE.Image = Global.SCrawler.My.Resources.Resources.Delete
Me.BTT_CONTEXT_DELETE.Name = "BTT_CONTEXT_DELETE"
Me.BTT_CONTEXT_DELETE.Size = New System.Drawing.Size(137, 22)
Me.BTT_CONTEXT_DELETE.Text = "Delete"
'
'TP_MAIN
'
Me.TP_MAIN.ColumnCount = 1
Me.TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20.0!))
Me.TP_MAIN.Controls.Add(TP_LBL, 0, 0)
Me.TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
Me.TP_MAIN.Location = New System.Drawing.Point(0, 0)
Me.TP_MAIN.Margin = New System.Windows.Forms.Padding(0)
Me.TP_MAIN.Name = "TP_MAIN"
Me.TP_MAIN.RowCount = 2
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_MAIN.Size = New System.Drawing.Size(146, 146)
Me.TP_MAIN.TabIndex = 0
'
'FeedMedia
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.SystemColors.Window
Me.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Controls.Add(Me.TP_MAIN)
Me.ForeColor = System.Drawing.SystemColors.WindowText
Me.Margin = New System.Windows.Forms.Padding(0)
Me.Name = "FeedMedia"
Me.Size = New System.Drawing.Size(146, 146)
TP_LBL.ResumeLayout(False)
TP_LBL.PerformLayout()
Me.CONTEXT_DATA.ResumeLayout(False)
Me.TP_MAIN.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Private WithEvents TP_MAIN As TableLayoutPanel
Private WithEvents CONTEXT_DATA As ContextMenuStrip
Private WithEvents BTT_CONTEXT_OPEN_MEDIA As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_OPEN_USER_URL As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_OPEN_USER_POST As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_FIND_USER As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_DELETE As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_OPEN_USER As ToolStripMenuItem
Private WithEvents CH_CHECKED As CheckBox
Private WithEvents LBL_INFO As Label
Private WithEvents BTT_CONTEXT_INFO As ToolStripMenuItem
End Class
End Namespace

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="CONTEXT_SEP_1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="CONTEXT_SEP_2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="CONTEXT_SEP_3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_LBL.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="CONTEXT_DATA.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,241 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
'Imports System.Windows.Forms.PropertyGridInternal
Imports System.ComponentModel
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Tools
Imports SCrawler.API.Base
Imports UserMediaD = SCrawler.DownloadObjects.TDownloader.UserMediaD
Namespace DownloadObjects
<ToolboxItem(False), DesignTimeVisible(False)>
Public Class FeedMedia
#Region "Declarations"
Friend Event MediaDeleted(ByVal Sender As Object)
Private Const VideoHeight As Integer = 450
Private WithEvents MyPicture As PictureBox
Private ReadOnly MyImage As ImageRenderer
Private ReadOnly MyVideo As FeedVideo
Friend ReadOnly Property Exists As Boolean
Get
Return Not MyPicture Is Nothing Or Not MyVideo Is Nothing
End Get
End Property
Friend ReadOnly Property HasError As Boolean
Friend ReadOnly File As SFile
Public Shadows Property Width As Integer
Get
Return MyBase.Width
End Get
Set(ByVal w As Integer)
If Size.Width <> w Then
Dim s As New Size(w, If(MyImage Is Nothing, VideoHeight, MyImage.FitToWidthF(w).Height))
Dim objSize As Size = s
objSize.Height += (TP_MAIN.RowStyles(0).Height + PaddingE.GetOf({TP_MAIN}).Vertical(2))
MinimumSize = objSize
MyBase.MaximumSize = objSize
Size = objSize
If Not MyImage Is Nothing Then
With MyPicture
.MinimumSize = Nothing
.MaximumSize = Nothing
.Size = s
.MinimumSize = s
.MaximumSize = s
End With
End If
End If
End Set
End Property
Private ReadOnly UserKey As String
Private ReadOnly Post As UserMedia
Friend ReadOnly Property Checked As Boolean
Get
Return CH_CHECKED.Checked
End Get
End Property
Friend ReadOnly Property Information As String
#End Region
#Region "Initializers"
Public Sub New()
InitializeComponent()
End Sub
Friend Sub New(ByVal Media As UserMediaD, ByVal Width As Integer, ByVal Handler As MediaDeletedEventHandler)
Try
InitializeComponent()
File = Media.Data.File
If Not File.Exists And Media.Data.Type = UserMedia.Types.Video Then File.Path = $"{File.Path.CSFilePS}Video"
If Not File.Exists Then
If Not Media.Data.SpecialFolder.IsEmptyString Then
File.Path = $"{File.Path.CSFilePS}{Media.Data.SpecialFolder}".CSFileP
If Not File.Exists And Media.Data.Type = UserMedia.Types.Video Then File.Path = $"{File.Path.CSFilePS}Video"
End If
End If
If File.Exists Then
Information = $"Type: {Media.Data.Type}"
Information.StringAppendLine($"File: {File.File}")
Information.StringAppendLine($"Address: {File}")
Information.StringAppendLine($"Downloaded: {Media.Date.ToStringDate(ADateTime.Formats.BaseDateTime)}")
If Media.Data.Post.Date.HasValue Then Information.StringAppendLine($"Posted: {Media.Data.Post.Date.Value.ToStringDate(ADateTime.Formats.BaseDateTime)}")
Dim info$ = $"[{Media.Data.Type}] - "
Dim h%
Dim s As Size
Post = Media.Data
Select Case Media.Data.Type
Case UserMedia.Types.Picture, UserMedia.Types.GIF
MyImage = New ImageRenderer(File)
s = MyImage.FitToWidthF(Width)
h = s.Height
MyPicture = New PictureBox With {
.SizeMode = PictureBoxSizeMode.Zoom,
.Image = MyImage,
.InitialImage = .Image,
.Dock = DockStyle.None,
.Anchor = AnchorStyles.Left + AnchorStyles.Top,
.Size = s,
.MinimumSize = s,
.MaximumSize = s,
.Tag = File,
.Margin = New Padding(0),
.Padding = New Padding(0),
.ContextMenuStrip = CONTEXT_DATA
}
TP_MAIN.Controls.Add(MyPicture, 0, 1)
BTT_CONTEXT_OPEN_MEDIA.Text &= " picture"
BTT_CONTEXT_DELETE.Text &= " picture"
Case UserMedia.Types.Video
MyVideo = New FeedVideo(File) With {.Tag = File, .Dock = DockStyle.Fill, .ContextMenuStrip = CONTEXT_DATA}
TP_MAIN.Controls.Add(MyVideo, 0, 1)
BTT_CONTEXT_OPEN_MEDIA.Text &= " video"
BTT_CONTEXT_DELETE.Text &= " video"
h = VideoHeight
Case Else : Throw New ArgumentNullException With {.HelpLink = 1}
End Select
If Not Media.User Is Nothing Then
With Media.User
UserKey = .Key
Information &= vbNewLine.StringDup(2)
If .IncludedInCollection Then Information.StringAppendLine($"User collection: { .CollectionName}")
Information.StringAppendLine($"User site: { .Site}")
Information.StringAppendLine($"User name: {IIf(Not .FriendlyName.IsEmptyString And Not .IncludedInCollection, .FriendlyName, .Name)}")
If .Site = API.Instagram.InstagramSite Then BTT_CONTEXT_OPEN_USER_POST.Visible = False
If .IncludedInCollection Then info &= $"[{ .CollectionName}]: "
info &= $"{ .Site} - {IIf(Not .FriendlyName.IsEmptyString And Not .IncludedInCollection, .FriendlyName, .Name)}"
End With
End If
If Settings.FeedAddSessionToCaption Then info = $"[{Media.Session}] {info}"
If Settings.FeedAddDateToCaption Then info &= $" ({Media.Date.ToStringDate(ADateTime.Formats.BaseDateTime)})"
LBL_INFO.Text = info
s = New Size(Width, h + TP_MAIN.RowStyles(0).Height + PaddingE.GetOf({TP_MAIN}).Vertical(2))
Size = s
MinimumSize = s
MaximumSize = s
If Not Handler Is Nothing Then AddHandler Me.MediaDeleted, Handler
Else
Throw New ArgumentNullException With {.HelpLink = 1}
End If
Catch aex As ArgumentNullException When aex.HelpLink = 1
HasError = True
Catch tex As Threading.ThreadStateException
HasError = True
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[DownloadObjects.FeedMedia({File})]")
HasError = True
End Try
End Sub
#End Region
#Region "Dispose"
Private Sub FeedImage_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
If Not MyImage Is Nothing Then MyImage.Dispose()
If Not MyPicture Is Nothing Then MyPicture.Dispose()
If Not MyVideo Is Nothing Then MyVideo.Dispose()
End Sub
#End Region
#Region "LBL"
Private Sub LBL_INFO_MouseClick(sender As Object, e As MouseEventArgs) Handles LBL_INFO.MouseClick
If e.Button = MouseButtons.Left Then ControlInvoke(CH_CHECKED, Sub() CH_CHECKED.Checked = Not CH_CHECKED.Checked)
End Sub
Private Sub LBL_INFO_DoubleClick(sender As Object, e As EventArgs) Handles LBL_INFO.DoubleClick
If Not UserKey.IsEmptyString Then
Dim u As IUserData = Settings.GetUser(UserKey)
If Not u Is Nothing Then u.OpenFolder()
End If
End Sub
#End Region
#Region "Picture / Video objects"
Private Sub MyPicture_DoubleClick(sender As Object, e As EventArgs) Handles MyPicture.DoubleClick
Try : Process.Start(File) : Catch : End Try
End Sub
#End Region
#Region "Context"
Private Sub BTT_CONTEXT_OPEN_MEDIA_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_OPEN_MEDIA.Click
File.Open(, EDP.None)
End Sub
Private Sub BTT_CONTEXT_OPEN_USER_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_OPEN_USER.Click
If Not UserKey.IsEmptyString Then
Dim u As IUserData = Settings.GetUser(UserKey)
If Not u Is Nothing Then u.OpenFolder()
End If
End Sub
Private Sub BTT_CONTEXT_OPEN_USER_URL_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_OPEN_USER_URL.Click
If Not UserKey.IsEmptyString Then
Dim u As IUserData = Settings.GetUser(UserKey)
If Not u Is Nothing Then u.OpenSite()
End If
End Sub
Private Sub BTT_CONTEXT_OPEN_USER_POST_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_OPEN_USER_POST.Click
Try
If Not UserKey.IsEmptyString And Not Post.Post.ID.IsEmptyString Then
Dim u As IUserData = Settings.GetUser(UserKey)
If Not u Is Nothing Then
Dim url$ = UserDataBase.GetPostUrl(u, Post)
If Not url.IsEmptyString Then
Try : Process.Start(url) : Catch : End Try
End If
End If
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, $"[FeedMedia.OpenPost({UserKey}, {Post.Post.ID})]")
End Try
End Sub
Private Sub BTT_CONTEXT_FIND_USER_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_FIND_USER.Click
If Not UserKey.IsEmptyString Then MainFrameObj.FocusUser(UserKey, True)
End Sub
Private Sub BTT_CONTEXT_INFO_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_INFO.Click
MsgBoxE({Information, "Post information"})
End Sub
Private Sub BTT_CONTEXT_DELETE_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_DELETE.Click
DeleteFile(False)
End Sub
Friend Function DeleteFile(ByVal Silent As Boolean) As Boolean
Const msgTitle$ = "Deleting a file"
Try
If Silent OrElse MsgBoxE({$"Are you sure you want to delete the [{File.File}] file?{vbCr}{File}", msgTitle}, vbExclamation,,, {"Process", "Cancel"}) = 0 Then
If Not MyVideo Is Nothing Then MyVideo.Stop()
If File.Delete(SFO.File, Settings.DeleteMode, EDP.ThrowException) Then
If Not Silent Then RaiseEvent MediaDeleted(Me) : MsgBoxE({"File deleted", msgTitle})
LBL_INFO.Height = 0
Height = 0
Return True
End If
End If
Return False
Catch ex As Exception
Dim e As New ErrorsDescriber(EDP.LogMessageValue) With {.ShowMainMsg = Not Silent, .ShowExMsg = .ShowMainMsg}
Return ErrorsDescriber.Execute(e, ex, $"[FeedMedia.DeleteFile({File})]", False)
End Try
End Function
#End Region
End Class
End Namespace

182
SCrawler/Download/FeedVideo.Designer.vb generated Normal file
View File

@@ -0,0 +1,182 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Namespace DownloadObjects
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Public Class FeedVideo : Inherits System.Windows.Forms.UserControl
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Dim TP_MAIN As System.Windows.Forms.TableLayoutPanel
Dim TP_BUTTONS As System.Windows.Forms.TableLayoutPanel
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FeedVideo))
Me.MyVideo = New LibVLCSharp.WinForms.VideoView()
Me.TR_POSITION = New System.Windows.Forms.TrackBar()
Me.TR_VOLUME = New System.Windows.Forms.TrackBar()
Me.LBL_TIME = New System.Windows.Forms.Label()
Me.BTT_PLAY = New System.Windows.Forms.Button()
Me.BTT_PAUSE = New System.Windows.Forms.Button()
Me.BTT_STOP = New System.Windows.Forms.Button()
TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
TP_BUTTONS = New System.Windows.Forms.TableLayoutPanel()
TP_MAIN.SuspendLayout()
CType(Me.MyVideo, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TR_POSITION, System.ComponentModel.ISupportInitialize).BeginInit()
TP_BUTTONS.SuspendLayout()
CType(Me.TR_VOLUME, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'TP_MAIN
'
TP_MAIN.ColumnCount = 1
TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_MAIN.Controls.Add(Me.MyVideo, 0, 0)
TP_MAIN.Controls.Add(Me.TR_POSITION, 0, 1)
TP_MAIN.Controls.Add(TP_BUTTONS, 0, 2)
TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
TP_MAIN.Location = New System.Drawing.Point(0, 0)
TP_MAIN.Margin = New System.Windows.Forms.Padding(0)
TP_MAIN.Name = "TP_MAIN"
TP_MAIN.RowCount = 3
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
TP_MAIN.Size = New System.Drawing.Size(180, 160)
TP_MAIN.TabIndex = 0
'
'MyVideo
'
Me.MyVideo.BackColor = System.Drawing.Color.Black
Me.MyVideo.Dock = System.Windows.Forms.DockStyle.Fill
Me.MyVideo.Location = New System.Drawing.Point(1, 1)
Me.MyVideo.Margin = New System.Windows.Forms.Padding(1)
Me.MyVideo.MediaPlayer = Nothing
Me.MyVideo.Name = "MyVideo"
Me.MyVideo.Size = New System.Drawing.Size(178, 105)
Me.MyVideo.TabIndex = 0
'
'TR_POSITION
'
Me.TR_POSITION.Dock = System.Windows.Forms.DockStyle.Fill
Me.TR_POSITION.Location = New System.Drawing.Point(3, 110)
Me.TR_POSITION.Name = "TR_POSITION"
Me.TR_POSITION.Size = New System.Drawing.Size(174, 19)
Me.TR_POSITION.TabIndex = 1
'
'TP_BUTTONS
'
TP_BUTTONS.ColumnCount = 5
TP_BUTTONS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_BUTTONS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_BUTTONS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_BUTTONS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_BUTTONS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100.0!))
TP_BUTTONS.Controls.Add(Me.BTT_PLAY, 0, 0)
TP_BUTTONS.Controls.Add(Me.BTT_PAUSE, 1, 0)
TP_BUTTONS.Controls.Add(Me.BTT_STOP, 2, 0)
TP_BUTTONS.Controls.Add(Me.TR_VOLUME, 4, 0)
TP_BUTTONS.Controls.Add(Me.LBL_TIME, 3, 0)
TP_BUTTONS.Dock = System.Windows.Forms.DockStyle.Fill
TP_BUTTONS.Location = New System.Drawing.Point(1, 133)
TP_BUTTONS.Margin = New System.Windows.Forms.Padding(1)
TP_BUTTONS.Name = "TP_BUTTONS"
TP_BUTTONS.RowCount = 1
TP_BUTTONS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_BUTTONS.Size = New System.Drawing.Size(178, 26)
TP_BUTTONS.TabIndex = 2
'
'TR_VOLUME
'
Me.TR_VOLUME.Dock = System.Windows.Forms.DockStyle.Fill
Me.TR_VOLUME.Location = New System.Drawing.Point(81, 3)
Me.TR_VOLUME.Name = "TR_VOLUME"
Me.TR_VOLUME.Size = New System.Drawing.Size(94, 20)
Me.TR_VOLUME.TabIndex = 3
'
'LBL_TIME
'
Me.LBL_TIME.AutoSize = True
Me.LBL_TIME.Dock = System.Windows.Forms.DockStyle.Fill
Me.LBL_TIME.Location = New System.Drawing.Point(78, 0)
Me.LBL_TIME.Name = "LBL_TIME"
Me.LBL_TIME.Size = New System.Drawing.Size(1, 26)
Me.LBL_TIME.TabIndex = 4
Me.LBL_TIME.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'BTT_PLAY
'
Me.BTT_PLAY.BackgroundImage = Global.SCrawler.My.Resources.Resources.StartPic_01_Green_16
Me.BTT_PLAY.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.BTT_PLAY.Dock = System.Windows.Forms.DockStyle.Fill
Me.BTT_PLAY.Location = New System.Drawing.Point(1, 1)
Me.BTT_PLAY.Margin = New System.Windows.Forms.Padding(1)
Me.BTT_PLAY.Name = "BTT_PLAY"
Me.BTT_PLAY.Size = New System.Drawing.Size(23, 24)
Me.BTT_PLAY.TabIndex = 0
Me.BTT_PLAY.UseVisualStyleBackColor = True
'
'BTT_PAUSE
'
Me.BTT_PAUSE.BackgroundImage = Global.SCrawler.My.Resources.Resources.Pause_Blue_16
Me.BTT_PAUSE.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.BTT_PAUSE.Dock = System.Windows.Forms.DockStyle.Fill
Me.BTT_PAUSE.Location = New System.Drawing.Point(26, 1)
Me.BTT_PAUSE.Margin = New System.Windows.Forms.Padding(1)
Me.BTT_PAUSE.Name = "BTT_PAUSE"
Me.BTT_PAUSE.Size = New System.Drawing.Size(23, 24)
Me.BTT_PAUSE.TabIndex = 1
Me.BTT_PAUSE.UseVisualStyleBackColor = True
'
'BTT_STOP
'
Me.BTT_STOP.BackgroundImage = CType(resources.GetObject("BTT_STOP.BackgroundImage"), System.Drawing.Image)
Me.BTT_STOP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.BTT_STOP.Dock = System.Windows.Forms.DockStyle.Fill
Me.BTT_STOP.Location = New System.Drawing.Point(51, 1)
Me.BTT_STOP.Margin = New System.Windows.Forms.Padding(1)
Me.BTT_STOP.Name = "BTT_STOP"
Me.BTT_STOP.Size = New System.Drawing.Size(23, 24)
Me.BTT_STOP.TabIndex = 2
Me.BTT_STOP.UseVisualStyleBackColor = True
'
'FeedVideo
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(TP_MAIN)
Me.Name = "FeedVideo"
Me.Size = New System.Drawing.Size(180, 160)
TP_MAIN.ResumeLayout(False)
TP_MAIN.PerformLayout()
CType(Me.MyVideo, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TR_POSITION, System.ComponentModel.ISupportInitialize).EndInit()
TP_BUTTONS.ResumeLayout(False)
TP_BUTTONS.PerformLayout()
CType(Me.TR_VOLUME, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Private WithEvents MyVideo As LibVLCSharp.WinForms.VideoView
Private WithEvents TR_POSITION As TrackBar
Private WithEvents BTT_PLAY As Button
Private WithEvents BTT_PAUSE As Button
Private WithEvents BTT_STOP As Button
Private WithEvents TR_VOLUME As TrackBar
Private WithEvents LBL_TIME As Label
End Class
End Namespace

View File

@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="TP_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_BUTTONS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="BTT_STOP.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAGLSURBVFhH7Vc7TsNAEPUNaDhAxAl8EaT0UKRFoqdNTcsp
qHIEHyGn4CNAiihwu7w3mTFrZeI466Ch4Emv8O7Mm9nd8X6qsWjbtgaXYAOmPWQfbWp1mw6ILcA16AUc
In0WKnM84DwDu9F+vb6kzcN9eru6TM8XZ+npvOqRbeyjDW3NTzVmKjsOcJiDGwpQ7P3meifgIdInS4Ra
c5UfBgw55eL4uXp0RzuW9KWG6VFbw/iAAUcuxh93t65oCalluoyh4fpAB9dcpv2UwY1ZEoyxWxNolILj
lHkCp2C2HI2G3QINsu4smilrfojUzgrzpx7wIf/5vmovhafFGJrA2oJzh5PMPAeyFJ4Wmc1CzQS4dcoG
4hmTpfC0SMbSBJZd8XEX84zJUnhaJGNpAg0TkI+h4iuFp0UylsXtEvAMjaXwtIz/Cfy9BCKLMPw3DN+I
YrdiPQ/iDiMCHxHHcf9mhIa4CwmBxtgrGYGOuEupAQZx13IDDOMeJgY4xD3NcsB5yuP0uFEPAWK/8Dyv
qm/Ki638CNApKAAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -0,0 +1,114 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports LibVLCSharp
Imports System.ComponentModel
Imports PersonalUtilities.Tools
Imports PersonalUtilities.Tools.WEB
Imports VLCState = LibVLCSharp.Shared.VLCState
Namespace DownloadObjects
<ToolboxItem(False), DesignTimeVisible(False)>
Public Class FeedVideo
Private WithEvents MediaPlayer As [Shared].MediaPlayer
Private ReadOnly TimeChange As Action = Sub()
Dim v# = DivideWithZeroChecking(MediaPlayer.Time, MediaPlayer.Length) * 10
If v > 10 Then TR_POSITION.Value = 10 Else TR_POSITION.Value = v
End Sub
Private ReadOnly TimeChangeLabel As Action = Sub()
If MediaPlayer.Time >= 0 Then
Dim t As TimeSpan = TimeSpan.FromMilliseconds(MediaPlayer.Time)
If Not VideoLength.HasValue Then
VideoLength = TimeSpan.FromMilliseconds(MediaPlayer.Length)
VideoLengthStr = VideoLength.Value.ToStringTime(FeedVideoLengthProvider)
End If
LBL_TIME.Text = $"{t.ToStringTime(FeedVideoLengthProvider)}/{VideoLengthStr}"
End If
End Sub
Private ReadOnly MyImage As ImageRenderer
Private VideoLength As TimeSpan?
Private VideoLengthStr As String
Public Sub New()
InitializeComponent()
End Sub
Friend Sub New(ByVal File As SFile)
InitializeComponent()
Dim debugLogs As Boolean = False
#If DEBUG Then
debugLogs = True
#End If
MediaPlayer = New [Shared].MediaPlayer(New [Shared].Media(New [Shared].LibVLC(enableDebugLogs:=debugLogs), New Uri(File.ToString)))
MyVideo.MediaPlayer = MediaPlayer
TR_VOLUME.Value = MediaPlayer.Volume / 10
If Settings.UseM3U8 Then
Dim f As SFile = $"{Settings.CachePath.PathWithSeparator}FeedSnapshots\{File.GetHashCode}.png"
If Not f.Exists Then f = FFMPEG.TakeSnapshot(File, f, Settings.FfmpegFile, TimeSpan.FromSeconds(1))
If f.Exists Then
MyImage = New ImageRenderer(f, EDP.None)
If Not MyImage.HasError Then
MyVideo.BackgroundImage = MyImage
MyVideo.BackgroundImageLayout = ImageLayout.Zoom
End If
End If
End If
UpdateButtons()
End Sub
Private Sub FeedVideo_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
If Not MediaPlayer Is Nothing Then MediaPlayer.Dispose()
If Not MyImage Is Nothing Then MyImage.Dispose()
End Sub
Private Sub BTT_PLAY_Click(sender As Object, e As EventArgs) Handles BTT_PLAY.Click
Try
Select Case MediaPlayer.State
Case VLCState.NothingSpecial, VLCState.Stopped, VLCState.Paused : MediaPlayer.Play()
Case VLCState.Ended : MediaPlayer.Stop() : MediaPlayer.Play()
End Select
Catch
Finally
UpdateButtons()
End Try
End Sub
Private Sub BTT_PAUSE_Click(sender As Object, e As EventArgs) Handles BTT_PAUSE.Click
Try : MediaPlayer.Pause() : Catch : End Try
UpdateButtons()
End Sub
Friend Sub [Stop]() Handles BTT_STOP.Click
Try : MediaPlayer.Stop() : Catch : End Try
UpdateButtons()
End Sub
Private Sub MediaPlayer_TimeChanged(sender As Object, e As [Shared].MediaPlayerTimeChangedEventArgs) Handles MediaPlayer.TimeChanged
If TR_POSITION.InvokeRequired Then TR_POSITION.Invoke(TimeChange) Else TimeChange.Invoke
If LBL_TIME.InvokeRequired Then LBL_TIME.Invoke(TimeChangeLabel) Else TimeChangeLabel.Invoke
End Sub
Private Sub TR_POSITION_MouseUp(sender As Object, e As MouseEventArgs) Handles TR_POSITION.MouseUp
Try : MediaPlayer.Time = (MediaPlayer.Length / 100) * (TR_POSITION.Value * 10) : Catch : End Try
End Sub
Private Sub TR_VOLUME_MouseUp(sender As Object, e As MouseEventArgs) Handles TR_VOLUME.MouseUp
Try : MediaPlayer.Volume = TR_VOLUME.Value * 10 : Catch : End Try
End Sub
Private Sub MediaPlayer_Stopped(sender As Object, e As EventArgs) Handles MediaPlayer.Stopped
Dim a As Action = Sub() TR_POSITION.Value = TR_POSITION.Maximum
If TR_POSITION.InvokeRequired Then TR_POSITION.Invoke(a) Else a.Invoke
UpdateButtons()
End Sub
Private Sub UpdateButtons() Handles MediaPlayer.Playing, MediaPlayer.Paused, MediaPlayer.Opening
Try
Dim _play As Boolean = False, _pause As Boolean = False, _stop As Boolean = False
Select Case MediaPlayer.State
Case VLCState.NothingSpecial, VLCState.Stopped : _play = True
Case VLCState.Paused : _play = True : _stop = True
Case VLCState.Ended : _play = True
Case VLCState.Playing : _pause = True : _stop = True
End Select
ControlInvoke(BTT_PLAY, Sub() BTT_PLAY.Enabled = _play)
ControlInvoke(BTT_PAUSE, Sub() BTT_PAUSE.Enabled = _pause)
ControlInvoke(BTT_STOP, Sub() BTT_STOP.Enabled = _stop)
Catch
End Try
End Sub
End Class
End Namespace

View File

@@ -48,16 +48,16 @@ Namespace DownloadObjects.Groups
} }
BTT_DELETE = New ToolStripMenuItem With { BTT_DELETE = New ToolStripMenuItem With {
.Image = PersonalUtilities.My.Resources.DeletePic_02_Red_24, .Image = PersonalUtilities.My.Resources.DeletePic_02_Red_24,
.BackColor = ColorBttDeleteBack, .BackColor = MyColor.DeleteBack,
.ForeColor = ColorBttDeleteFore, .ForeColor = MyColor.DeleteFore,
.Text = "Delete", .Text = "Delete",
.ToolTipText = String.Empty, .ToolTipText = String.Empty,
.AutoToolTip = False .AutoToolTip = False
} }
BTT_EDIT = New ToolStripMenuItem With { BTT_EDIT = New ToolStripMenuItem With {
.Image = PersonalUtilities.My.Resources.PencilPic_01_48, .Image = PersonalUtilities.My.Resources.PencilPic_01_48,
.BackColor = ColorBttEditBack, .BackColor = MyColor.EditBack,
.ForeColor = ColorBttEditFore, .ForeColor = MyColor.EditFore,
.Text = "Edit", .Text = "Edit",
.ToolTipText = String.Empty, .ToolTipText = String.Empty,
.AutoToolTip = False .AutoToolTip = False

View File

@@ -0,0 +1,175 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Namespace DownloadObjects
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Friend Class MissingPostsForm : Inherits System.Windows.Forms.Form
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
Dim CONTEXT_SEP_1 As System.Windows.Forms.ToolStripSeparator
Dim CONTEXT_SEP_2 As System.Windows.Forms.ToolStripSeparator
Dim CONTEXT_SEP_3 As System.Windows.Forms.ToolStripSeparator
Me.LIST_DATA = New System.Windows.Forms.ListView()
Me.CONTEXT_OPERATIONS = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.BTT_DOWN = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_OPEN_POST = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_OPEN_USER = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_FIND_USER = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_DELETE = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_SHOW_POST_INFO = New System.Windows.Forms.ToolStripMenuItem()
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
CONTEXT_SEP_1 = New System.Windows.Forms.ToolStripSeparator()
CONTEXT_SEP_2 = New System.Windows.Forms.ToolStripSeparator()
CONTEXT_SEP_3 = New System.Windows.Forms.ToolStripSeparator()
CONTAINER_MAIN.ContentPanel.SuspendLayout()
CONTAINER_MAIN.SuspendLayout()
Me.CONTEXT_OPERATIONS.SuspendLayout()
Me.SuspendLayout()
'
'CONTAINER_MAIN
'
CONTAINER_MAIN.BottomToolStripPanelVisible = False
'
'CONTAINER_MAIN.ContentPanel
'
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.LIST_DATA)
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(284, 236)
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
CONTAINER_MAIN.LeftToolStripPanelVisible = False
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
CONTAINER_MAIN.RightToolStripPanelVisible = False
CONTAINER_MAIN.Size = New System.Drawing.Size(284, 261)
CONTAINER_MAIN.TabIndex = 0
'
'LIST_DATA
'
Me.LIST_DATA.Activation = System.Windows.Forms.ItemActivation.OneClick
Me.LIST_DATA.ContextMenuStrip = Me.CONTEXT_OPERATIONS
Me.LIST_DATA.Dock = System.Windows.Forms.DockStyle.Fill
Me.LIST_DATA.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None
Me.LIST_DATA.HideSelection = False
Me.LIST_DATA.Location = New System.Drawing.Point(0, 0)
Me.LIST_DATA.Name = "LIST_DATA"
Me.LIST_DATA.Size = New System.Drawing.Size(284, 236)
Me.LIST_DATA.TabIndex = 0
Me.LIST_DATA.TileSize = New System.Drawing.Size(168, 15)
Me.LIST_DATA.UseCompatibleStateImageBehavior = False
Me.LIST_DATA.View = System.Windows.Forms.View.Tile
'
'CONTEXT_SEP_1
'
CONTEXT_SEP_1.Name = "CONTEXT_SEP_1"
CONTEXT_SEP_1.Size = New System.Drawing.Size(178, 6)
'
'CONTEXT_SEP_2
'
CONTEXT_SEP_2.Name = "CONTEXT_SEP_2"
CONTEXT_SEP_2.Size = New System.Drawing.Size(178, 6)
'
'CONTEXT_SEP_3
'
CONTEXT_SEP_3.Name = "CONTEXT_SEP_3"
CONTEXT_SEP_3.Size = New System.Drawing.Size(178, 6)
'
'CONTEXT_OPERATIONS
'
Me.CONTEXT_OPERATIONS.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_DOWN, CONTEXT_SEP_1, Me.BTT_OPEN_POST, Me.BTT_OPEN_USER, Me.BTT_CONTEXT_SHOW_POST_INFO, CONTEXT_SEP_2, Me.BTT_FIND_USER, CONTEXT_SEP_3, Me.BTT_DELETE})
Me.CONTEXT_OPERATIONS.Name = "CONTEXT_OPERATIONS"
Me.CONTEXT_OPERATIONS.Size = New System.Drawing.Size(181, 176)
'
'BTT_DOWN
'
Me.BTT_DOWN.AutoToolTip = True
Me.BTT_DOWN.Image = Global.SCrawler.My.Resources.Resources.StartPic_01_Green_16
Me.BTT_DOWN.Name = "BTT_DOWN"
Me.BTT_DOWN.Size = New System.Drawing.Size(181, 22)
Me.BTT_DOWN.Text = "Download"
Me.BTT_DOWN.ToolTipText = "Try downloading the selected posts again"
'
'BTT_OPEN_POST
'
Me.BTT_OPEN_POST.Image = Global.SCrawler.My.Resources.Resources.GlobeBlue_32
Me.BTT_OPEN_POST.Name = "BTT_OPEN_POST"
Me.BTT_OPEN_POST.Size = New System.Drawing.Size(181, 22)
Me.BTT_OPEN_POST.Text = "Open post"
'
'BTT_OPEN_USER
'
Me.BTT_OPEN_USER.Image = Global.SCrawler.My.Resources.Resources.Folder_32
Me.BTT_OPEN_USER.Name = "BTT_OPEN_USER"
Me.BTT_OPEN_USER.Size = New System.Drawing.Size(181, 22)
Me.BTT_OPEN_USER.Text = "Open user folder"
'
'BTT_FIND_USER
'
Me.BTT_FIND_USER.Image = Global.SCrawler.My.Resources.Resources.InfoPic_32
Me.BTT_FIND_USER.Name = "BTT_FIND_USER"
Me.BTT_FIND_USER.Size = New System.Drawing.Size(181, 22)
Me.BTT_FIND_USER.Text = "Find user"
'
'BTT_DELETE
'
Me.BTT_DELETE.AutoToolTip = True
Me.BTT_DELETE.Image = Global.SCrawler.My.Resources.Resources.Delete
Me.BTT_DELETE.Name = "BTT_DELETE"
Me.BTT_DELETE.Size = New System.Drawing.Size(181, 22)
Me.BTT_DELETE.Text = "Delete post"
Me.BTT_DELETE.ToolTipText = "Remove selected posts from user data"
'
'BTT_CONTEXT_SHOW_POST_INFO
'
Me.BTT_CONTEXT_SHOW_POST_INFO.AutoToolTip = True
Me.BTT_CONTEXT_SHOW_POST_INFO.Image = Global.SCrawler.My.Resources.Resources.InfoPic_32
Me.BTT_CONTEXT_SHOW_POST_INFO.Name = "BTT_CONTEXT_SHOW_POST_INFO"
Me.BTT_CONTEXT_SHOW_POST_INFO.Size = New System.Drawing.Size(180, 22)
Me.BTT_CONTEXT_SHOW_POST_INFO.Text = "Show post info"
Me.BTT_CONTEXT_SHOW_POST_INFO.ToolTipText = "Show information about the missing post"
'
'MissingPostsForm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 261)
Me.Controls.Add(CONTAINER_MAIN)
Me.KeyPreview = True
Me.MinimumSize = New System.Drawing.Size(300, 300)
Me.Name = "MissingPostsForm"
Me.ShowIcon = False
Me.Text = "Missing posts"
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
CONTAINER_MAIN.ResumeLayout(False)
CONTAINER_MAIN.PerformLayout()
Me.CONTEXT_OPERATIONS.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Private WithEvents LIST_DATA As ListView
Private WithEvents CONTEXT_OPERATIONS As ContextMenuStrip
Private WithEvents BTT_DOWN As ToolStripMenuItem
Private WithEvents BTT_OPEN_POST As ToolStripMenuItem
Private WithEvents BTT_OPEN_USER As ToolStripMenuItem
Private WithEvents BTT_FIND_USER As ToolStripMenuItem
Private WithEvents BTT_DELETE As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_SHOW_POST_INFO As ToolStripMenuItem
End Class
End Namespace

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="CONTEXT_OPERATIONS.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="CONTEXT_SEP_1.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="CONTEXT_SEP_2.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="CONTEXT_SEP_3.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@@ -0,0 +1,296 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports System.ComponentModel
Imports PersonalUtilities.Functions.Messaging
Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Toolbars
Imports SCrawler.API.Base
Namespace DownloadObjects
Friend Class MissingPostsForm
#Region "Declarations"
Private WithEvents MyDefs As DefaultFormOptions
Private ReadOnly MUsers As List(Of IUserData)
Private WithEvents BTT_DOWN_ALL As ToolStripButton
Private WithEvents BTT_INFO As ToolStripButton
#End Region
#Region "Initializer"
Friend Sub New()
InitializeComponent()
MUsers = New List(Of IUserData)
MyDefs = New DefaultFormOptions(Me, Settings.Design)
BTT_DOWN_ALL = New ToolStripButton With {
.Text = "Download ALL",
.ToolTipText = String.Empty,
.AutoToolTip = False,
.Image = My.Resources.StartPic_01_Green_16,
.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
}
BTT_INFO = New ToolStripButton With {
.Text = "Info",
.ToolTipText = "Show information about the missing post (F1)",
.AutoToolTip = True,
.Image = My.Resources.InfoPic_32,
.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
}
End Sub
#End Region
#Region "Form handlers"
Private Sub MissingPostsForm_Load(sender As Object, e As EventArgs) Handles Me.Load
With MyDefs
.MyViewInitialize()
.AddEditToolbarPlus({EditToolbar.ControlItem.Separator, BTT_DOWN_ALL, BTT_INFO})
.EndLoaderOperations(False)
End With
RefillList()
End Sub
Private Sub MissingPostsForm_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
e.Cancel = True
Hide()
End Sub
Private Sub MissingPostsForm_Disposed(sender As Object, e As EventArgs) Handles Me.Disposed
MUsers.Clear()
End Sub
Private Sub MissingPostsForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.F1 Then ShowPostInformation() : e.Handled = True
End Sub
#End Region
#Region "RefillList"
Private Overloads Sub RefillList() Handles MyDefs.ButtonUpdateClick
RefillList(True)
End Sub
Friend Overloads Sub RefillList(ByVal User As IUserData)
If MUsers.Count = 0 OrElse Not MUsers.Contains(User) Then MUsers.Add(User) : RefillList(False)
End Sub
Friend Overloads Sub RefillList(ByVal Reload As Boolean)
Try
If Reload Then MUsers.Clear()
LIST_DATA.Items.Clear()
LIST_DATA.Groups.Clear()
If Reload And Settings.Users.Count > 0 Then
MUsers.ListAddList(Settings.Users.SelectMany(Function(ByVal user As IUserData) As IEnumerable(Of IUserData)
DirectCast(user, UserDataBase).LoadContentInformation()
If user.IsCollection Then
With DirectCast(user, API.UserDataBind)
If .Count > 0 Then Return .Where(Function(u) DirectCast(u, UserDataBase).ContentMissingExists)
End With
ElseIf DirectCast(user, UserDataBase).ContentMissingExists Then
Return {user}
End If
Return New IUserData() {}
End Function), LAP.IgnoreICopier)
End If
If MUsers.Count > 0 Then
Dim gName$ = String.Empty
Dim g As ListViewGroup = Nothing
Dim i% = -1
Dim cm As List(Of UserMedia)
For Each uu As UserDataBase In MUsers
i += 1
cm = uu.ContentMissing
If cm.Count > 0 Then
gName = String.Empty
If uu.IncludedInCollection Then gName = $"{uu.CollectionName} - "
gName &= $"{uu.User.Name} ({uu.Site})"
ControlInvoke(LIST_DATA, Sub()
LIST_DATA.Groups.Add(New ListViewGroup(gName) With {.Tag = uu.LVIKey})
g = LIST_DATA.Groups(LIST_DATA.Groups.Count - 1)
End Sub)
For i% = 0 To cm.Count - 1 : ControlInvoke(LIST_DATA, Sub() LIST_DATA.Items.Add(New ListViewItem(cm(i).Post.ID, g))) : Next
End If
Next
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[DownloadObjects.MissingPostsForm.RefillList]")
End Try
End Sub
#End Region
#Region "Post actions"
Private Sub BTT_DOWN_Click(sender As Object, e As EventArgs) Handles BTT_DOWN.Click
'Try
' If LIST_DATA.SelectedItems.Count > 0 Then
' Dim users As List(Of IUserData) = LIST_DATA.SelectedItems.ToObjectsList.ListCast(Of ListViewItem)().
' Select(Function(d) Settings.GetUser(CStr(d.Group.Tag))).ListWithRemove(Function(d) d Is Nothing)
' If users.ListExists Then
' If MsgBoxE({"The following users will be added to the download queue:" & vbCr & vbCr &
' users.Select(Function(u) u.ToString).ListToString(vbNewLine), "Download users"},,,, {"Process", "Cancel"}) = 0 Then
' users.ForEach(Sub(u) u.DownloadMissingOnly = True)
' Downloader.AddRange(users)
' users.Clear()
' End If
' End If
' Else
' MsgBoxE("No selected posts")
' End If
'Catch ex As Exception
' ErrorsDescriber.Execute(EDP.SendInLog, ex, "[DownloadObjects.MissingPostsForm.Download]")
'End Try
End Sub
Private Sub BTT_OPEN_POST_Click(sender As Object, e As EventArgs) Handles BTT_OPEN_POST.Click
Try
If LIST_DATA.SelectedItems.Count > 0 Then
If LIST_DATA.SelectedItems.Count = 1 OrElse
MsgBoxE({$"Are you sure you want to open {LIST_DATA.SelectedItems.Count} posts?", "Open multiple posts"}, vbExclamation + vbYesNo) = vbYes Then
Dim data As List(Of ListViewItem) = LIST_DATA.SelectedItems.ToObjectsList.ListCast(Of ListViewItem)
If data.ListExists Then
Dim uKey$, url$
Dim u As IUserData = Nothing
Dim i%
Dim cm As List(Of UserMedia)
For Each _d In data
uKey = _d.Group.Tag
If u Is Nothing OrElse Not u.Key = uKey Then u = Settings.GetUser(uKey)
If Not u Is Nothing Then
i = -1
With DirectCast(u, UserDataBase)
cm = .ContentMissing
If cm.Count > 0 Then i = cm.FindIndex(Function(c) c.Post.ID = _d.Text)
If i >= 0 Then
url = UserDataBase.GetPostUrl(u, cm(i))
If Not url.IsEmptyString Then
Try : Process.Start(url) : Catch : End Try
End If
End If
End With
End If
Next
End If
End If
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[DownloadObjects.MissingPostsForm.OpenPost]")
End Try
End Sub
Private Sub BTT_OPEN_USER_Click(sender As Object, e As EventArgs) Handles BTT_OPEN_USER.Click
Try
If LIST_DATA.SelectedItems.Count > 0 Then
Dim users As List(Of IUserData) = LIST_DATA.SelectedItems.ToObjectsList.ListCast(Of ListViewItem)().
Select(Function(d) Settings.GetUser(CStr(d.Group.Tag))).ListWithRemove(Function(d) d Is Nothing)
If users.ListExists Then users.ForEach(Sub(u) u.OpenFolder())
Else
MsgBoxE("No selected posts")
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[DownloadObjects.MissingPostsForm.OpenUser]")
End Try
End Sub
Private Sub ShowPostInformation() Handles BTT_INFO.Click, BTT_CONTEXT_SHOW_POST_INFO.Click, LIST_DATA.DoubleClick
Try
If LIST_DATA.SelectedItems.Count > 0 Then
Dim data As ListViewItem = LIST_DATA.SelectedItems.ToObjectsList.ListCast(Of ListViewItem)().First
Dim uKey$, url$
Dim u As IUserData = Nothing
Dim i%
Dim cm As List(Of UserMedia)
Dim m As UserMedia
uKey = data.Group.Tag
If Not uKey.IsEmptyString Then u = Settings.GetUser(uKey)
If Not u Is Nothing Then
i = -1
With DirectCast(u, UserDataBase)
cm = .ContentMissing
If cm.Count > 0 Then i = cm.FindIndex(Function(c) c.Post.ID = data.Text)
If i >= 0 Then
m = cm(i)
url = UserDataBase.GetPostUrl(u, m)
Dim msg As New MMessage("", "Post information") With {.Editable = True}
Dim b As New List(Of MsgBoxButton)
If Not url.IsEmptyString Then b.Add(New MsgBoxButton("Open") With {.IsDialogResultButton = False,
.ToolTip = "Open post in browser",
.KeyCode = Keys.F1,
.CallBack = Sub(result, message, button)
Try : Process.Start(url) : Catch : End Try
End Sub})
b.Add(New MsgBoxButton("OK"))
With msg
.Buttons = b
.DefaultButton = If(b.Count = 2, 1, 0)
.CancelButton = .DefaultButton
.Text = $"Type: {m.Type}"
.Text.StringAppendLine($"Address: {url}")
If m.Post.Date.HasValue Then .Text.StringAppendLine($"Date: {m.Post.Date.Value.ToStringDate(ADateTime.Formats.BaseDateTime)}")
.Text &= vbNewLine.StringDup(2)
If u.IncludedInCollection Then .Text.StringAppendLine($"User collection: {u.CollectionName}")
.Text.StringAppendLine($"User site: {u.Site}")
.Text.StringAppendLine($"User name: {IIf(Not u.FriendlyName.IsEmptyString And Not u.IncludedInCollection, u.FriendlyName, u.Name)}")
End With
MsgBoxE(msg)
b.Clear()
cm.Clear()
End If
End With
End If
Else
MsgBoxE("No selected posts")
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[DownloadObjects.MissingPostsForm.ShowPostInformation]")
End Try
End Sub
Private Sub BTT_FIND_USER_Click(sender As Object, e As EventArgs) Handles BTT_FIND_USER.Click
Try
If LIST_DATA.SelectedItems.Count > 0 Then
Dim user As IUserData = LIST_DATA.SelectedItems.ToObjectsList.ListCast(Of ListViewItem)().
Select(Function(d) Settings.GetUser(CStr(d.Group.Tag))).ListWithRemove(Function(d) d Is Nothing).DefaultIfEmpty(Nothing).First
If Not user Is Nothing Then MainFrameObj.FocusUser(user.Key, True)
Else
MsgBoxE("No selected posts")
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, $"[DownloadObjects.MissingPostsForm.FindUser]")
End Try
End Sub
Private Sub DeletePost() Handles MyDefs.ButtonDeleteClickE, BTT_DELETE.Click
Const MsgTitle$ = "Remove missing posts"
Dim UsersToUpdate As New List(Of UserDataBase)
Try
Dim data As List(Of ListViewItem) = LIST_DATA.SelectedItems.ToObjectsList.ListCast(Of ListViewItem)
If data.ListExists Then
Dim lp As New ListAddParams(LAP.NotContainsOnly)
Dim usersCount% = ListAddList(Nothing, data.Select(Function(d) d.Group.Name), LAP.NotContainsOnly).ListIfNothing.Count
If MsgBoxE({"Are you sure you want to delete the selected missing posts?" & vbCr &
$"Number of affected users: {usersCount}." & vbCr &
$"Number of posts to be deleted: {data.Count}.", MsgTitle}, vbExclamation,,, {"Process", "Cancel"}) = 0 Then
Dim uKey$
Dim u As UserDataBase = Nothing
Dim cm As List(Of UserMedia)
Dim i%
For Each _d In data
uKey = _d.Group.Tag
If u Is Nothing OrElse Not u.LVIKey = uKey Then u = Settings.GetUser(uKey)
If Not u Is Nothing Then
i = -1
cm = u.ContentMissing
If cm.Count > 0 Then i = cm.FindIndex(Function(c) c.Post.ID = _d.Text)
If i >= 0 Then u.RemoveMedia(cm(i), UserMedia.States.Missing) : UsersToUpdate.ListAddValue(u, lp)
End If
Next
MsgBoxE({"The selected posts have been successfully deleted", MsgTitle})
Else
MsgBoxE({"Operation canceled", MsgTitle})
End If
Else
MsgBoxE({"No selected posts", MsgTitle})
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[DownloadObjects.MissingPostsForm.DeletePost]")
Finally
UpdateUsers(UsersToUpdate)
UsersToUpdate.Clear()
End Try
End Sub
Private Sub UpdateUsers(ByVal UserList As List(Of UserDataBase))
Try
If UserList.ListExists Then UserList.ForEach(Sub(u) u.UpdateContentInformation())
Catch ex As Exception
ErrorsDescriber.Execute(EDP.SendInLog, ex, "[DownloadObjects.MissingPostsForm.UpdateUsers]")
End Try
End Sub
#End Region
End Class
End Namespace

View File

@@ -13,10 +13,6 @@ Imports System.Threading
Namespace DownloadObjects Namespace DownloadObjects
Friend Class Scheduler : Implements IEnumerable(Of AutoDownloader), IMyEnumerator(Of AutoDownloader), IDisposable Friend Class Scheduler : Implements IEnumerable(Of AutoDownloader), IMyEnumerator(Of AutoDownloader), IDisposable
Friend Const Name_Plan As String = "Plan" Friend Const Name_Plan As String = "Plan"
Friend Event UserFind As AutoDownloader.UserFindEventHandler
Private Sub OnUserFind(ByVal Key As String, ByVal Activate As Boolean)
RaiseEvent UserFind(Key, Activate)
End Sub
Private ReadOnly Plans As List(Of AutoDownloader) Private ReadOnly Plans As List(Of AutoDownloader)
Private ReadOnly File As SFile = $"Settings\AutoDownload.xml" Private ReadOnly File As SFile = $"Settings\AutoDownload.xml"
Private ReadOnly PlanWorking As Predicate(Of AutoDownloader) = Function(Plan) Plan.Working Private ReadOnly PlanWorking As Predicate(Of AutoDownloader) = Function(Plan) Plan.Working
@@ -36,10 +32,7 @@ Namespace DownloadObjects
End If End If
End Using End Using
End If End If
If Plans.Count > 0 Then Plans.ForEach(Sub(p) If Plans.Count > 0 Then Plans.ForEach(Sub(p) p.Source = Me)
p.Source = Me
AddHandler p.UserFind, AddressOf OnUserFind
End Sub)
End Sub End Sub
Default Friend ReadOnly Property Item(ByVal Index As Integer) As AutoDownloader Implements IMyEnumerator(Of AutoDownloader).MyEnumeratorObject Default Friend ReadOnly Property Item(ByVal Index As Integer) As AutoDownloader Implements IMyEnumerator(Of AutoDownloader).MyEnumeratorObject
Get Get
@@ -56,7 +49,6 @@ Namespace DownloadObjects
End Function End Function
Friend Sub Add(ByVal Plan As AutoDownloader) Friend Sub Add(ByVal Plan As AutoDownloader)
Plan.Source = Me Plan.Source = Me
AddHandler Plan.UserFind, AddressOf OnUserFind
Plans.Add(Plan) Plans.Add(Plan)
Update() Update()
End Sub End Sub

View File

@@ -53,7 +53,7 @@ Namespace DownloadObjects
ErrorsDescriber.Execute(EDP.SendInLog, ex) ErrorsDescriber.Execute(EDP.SendInLog, ex)
End Try End Try
End Sub End Sub
Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonAddClick Private Sub MyDefs_ButtonAddClick(ByVal Sender As Object, ByVal e As EditToolbarEventArgs) Handles MyDefs.ButtonAddClick
Dim a As New AutoDownloader(True) Dim a As New AutoDownloader(True)
Using f As New AutoDownloaderEditorForm(a) Using f As New AutoDownloaderEditorForm(a)
f.ShowDialog() f.ShowDialog()
@@ -74,7 +74,7 @@ Namespace DownloadObjects
End If End If
End Sub End Sub
Private _DeleteInProgress As Boolean = False Private _DeleteInProgress As Boolean = False
Private Async Sub MyDefs_ButtonDeleteClickE(ByVal Sender As Object, ByVal e As EditToolbar.EditToolbarEventArgs) Handles MyDefs.ButtonDeleteClickE Private Async Sub MyDefs_ButtonDeleteClickE(ByVal Sender As Object, ByVal e As EditToolbarEventArgs) Handles MyDefs.ButtonDeleteClickE
If Not _DeleteInProgress Then If Not _DeleteInProgress Then
If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then If _LatestSelected.ValueBetween(0, LIST_PLANS.Items.Count - 1) Then
_DeleteInProgress = True _DeleteInProgress = True

View File

@@ -8,21 +8,52 @@
' but WITHOUT ANY WARRANTY ' but WITHOUT ANY WARRANTY
Imports System.Threading Imports System.Threading
Imports PersonalUtilities.Tools Imports PersonalUtilities.Tools
Imports SCrawler.API
Imports SCrawler.API.Base Imports SCrawler.API.Base
Imports SCrawler.Plugin.Hosts Imports SCrawler.Plugin.Hosts
Imports Download = SCrawler.Plugin.ISiteSettings.Download Imports Download = SCrawler.Plugin.ISiteSettings.Download
Imports EOptions = PersonalUtilities.Forms.Toolbars.IMyProgress.EnableOptions
Namespace DownloadObjects Namespace DownloadObjects
Friend Class TDownloader : Implements IDisposable Friend Class TDownloader : Implements IDisposable
#Region "Events" #Region "Events"
Friend Event OnJobsChange(ByVal JobsCount As Integer) Friend Event JobsChange(ByVal JobsCount As Integer)
Friend Event OnDownloadCountChange() Friend Event DownloadCountChange()
Friend Event OnDownloading(ByVal Value As Boolean) Friend Event Downloading(ByVal Value As Boolean)
Friend Event SendNotification As NotificationEventHandler Friend Event SendNotification As NotificationEventHandler
Friend Event OnReconfigured() Friend Event Reconfigured()
Friend Event FeedFilesChanged(ByVal Added As Boolean)
#End Region #End Region
#Region "Declarations" #Region "Declarations"
#Region "Files"
Friend Structure UserMediaD : Implements IComparable(Of UserMediaD), IEquatable(Of UserMediaD)
Friend ReadOnly User As IUserData
Friend ReadOnly Data As UserMedia
Friend ReadOnly [Date] As Date
Friend ReadOnly Session As Integer
Friend Sub New(ByVal Data As UserMedia, ByVal User As IUserData, ByVal Session As Integer)
Me.Data = Data
Me.User = User
[Date] = Now
Me.Session = Session
End Sub
Private Function CompareTo(ByVal Other As UserMediaD) As Integer Implements IComparable(Of UserMediaD).CompareTo
If Not Session = Other.Session Then
Return Session.CompareTo(Other.Session) * -1
ElseIf Not If(User?.GetHashCode, 0) = If(Other.User?.GetHashCode, 0) Then
Return If(User?.GetHashCode, 0).CompareTo(If(Other.User?.GetHashCode, 0))
Else
Return [Date].Ticks.CompareTo(Other.Date.Ticks) * -1
End If
End Function
Private Overloads Function Equals(ByVal Other As UserMediaD) As Boolean Implements IEquatable(Of UserMediaD).Equals
Return Data.File = Other.Data.File
End Function
Public Overloads Overrides Function Equals(ByVal Obj As Object) As Boolean
Return Equals(DirectCast(Obj, UserMedia))
End Function
End Structure
Friend ReadOnly Property Files As List(Of UserMediaD)
Friend Property FilesChanged As Boolean = False
Private ReadOnly FilesLP As New ListAddParams(LAP.NotContainsOnly)
#End Region
Friend ReadOnly Property Downloaded As List(Of IUserData) Friend ReadOnly Property Downloaded As List(Of IUserData)
Private ReadOnly NProv As IFormatProvider Private ReadOnly NProv As IFormatProvider
#End Region #End Region
@@ -49,7 +80,7 @@ Namespace DownloadObjects
End Set End Set
End Property End Property
Friend Sub InvokeDownloadsChangeEvent() Friend Sub InvokeDownloadsChangeEvent()
RaiseEvent OnDownloadCountChange() RaiseEvent DownloadCountChange()
End Sub End Sub
#End Region #End Region
#Region "Jobs" #Region "Jobs"
@@ -163,6 +194,7 @@ Namespace DownloadObjects
#End Region #End Region
#Region "Initializer" #Region "Initializer"
Friend Sub New() Friend Sub New()
Files = New List(Of UserMediaD)
Downloaded = New List(Of IUserData) Downloaded = New List(Of IUserData)
NProv = New ANumbers With {.FormatOptions = ANumbers.Options.GroupIntegral} NProv = New ANumbers With {.FormatOptions = ANumbers.Options.GroupIntegral}
Pool = New List(Of Job) Pool = New List(Of Job)
@@ -183,27 +215,32 @@ Namespace DownloadObjects
End If End If
Next Next
End If End If
RaiseEvent OnReconfigured() RaiseEvent Reconfigured()
End If End If
End Sub End Sub
#End Region #End Region
#Region "Thread" #Region "Thread"
Private CheckerThread As Thread Private CheckerThread As Thread
Private MissingPostsDetected As Boolean = False
Private Session As Integer = 0
Private Sub [Start]() Private Sub [Start]()
If Not AutoDownloaderWorking AndAlso MyProgressForm.ReadyToOpen AndAlso Pool.LongCount(Function(p) p.Count > 0) > 1 Then MyProgressForm.Show() : MainFrameObj.Focus() If Not AutoDownloaderWorking AndAlso MyProgressForm.ReadyToOpen AndAlso Pool.LongCount(Function(p) p.Count > 0) > 1 Then MyProgressForm.Show() : MainFrameObj.Focus()
If Not If(CheckerThread?.IsAlive, False) Then If Not If(CheckerThread?.IsAlive, False) Then
MainProgress.Enabled = True MainProgress.Visible = True
If Not AutoDownloaderWorking AndAlso InfoForm.ReadyToOpen Then InfoForm.Show() : MainFrameObj.Focus() If Not AutoDownloaderWorking AndAlso InfoForm.ReadyToOpen Then InfoForm.Show() : MainFrameObj.Focus()
MissingPostsDetected = False
Session += 1
CheckerThread = New Thread(New ThreadStart(AddressOf JobsChecker)) CheckerThread = New Thread(New ThreadStart(AddressOf JobsChecker))
CheckerThread.SetApartmentState(ApartmentState.MTA) CheckerThread.SetApartmentState(ApartmentState.MTA)
CheckerThread.Start() CheckerThread.Start()
End If End If
End Sub End Sub
Private Sub JobsChecker() Private Sub JobsChecker()
RaiseEvent OnDownloading(True) Dim fBefore% = Files.Count
RaiseEvent Downloading(True)
Try Try
MainProgress.TotalCount = 0 MainProgress.Maximum = 0
MainProgress.CurrentCounter = 0 MainProgress.Value = 0
MyProgressForm.DisableProgressChange = False MyProgressForm.DisableProgressChange = False
Do While Pool.Exists(Function(p) p.Count > 0 Or p.Working) Do While Pool.Exists(Function(p) p.Count > 0 Or p.Working)
For Each j As Job In Pool For Each j As Job In Pool
@@ -214,16 +251,23 @@ Namespace DownloadObjects
Catch Catch
Finally Finally
With MainProgress With MainProgress
.TotalCount = 0 .Maximum = 0
.CurrentCounter = 0 .Value = 0
.InformationTemporary = "All data downloaded" .InformationTemporary = "All data downloaded"
.Enabled(EOptions.ProgressBar) = False .Visible(, False) = False
End With End With
MyProgressForm.DisableProgressChange = True MyProgressForm.DisableProgressChange = True
If Pool.Count > 0 Then Pool.ForEach(Sub(p) If Not p.Progress Is Nothing Then p.Progress.TotalCount = 0) If Pool.Count > 0 Then Pool.ForEach(Sub(p) If Not p.Progress Is Nothing Then p.Progress.Maximum = 0)
ExecuteCommand(Settings.DownloadsCompleteCommand) ExecuteCommand(Settings.DownloadsCompleteCommand)
UpdateJobsLabel() UpdateJobsLabel()
RaiseEvent OnDownloading(False) If MissingPostsDetected And Settings.AddMissingToLog Then
MyMainLOG = "Some posts didn't download. You can see them in the 'Missing posts' form."
MainFrameObj.UpdateLogButton()
End If
Files.Sort()
FilesChanged = Not fBefore = Files.Count
RaiseEvent Downloading(False)
If FilesChanged Then RaiseEvent FeedFilesChanged(True)
End Try End Try
End Sub End Sub
Private Sub StartDownloading(ByRef _Job As Job) Private Sub StartDownloading(ByRef _Job As Job)
@@ -236,9 +280,9 @@ Namespace DownloadObjects
End Function End Function
Try Try
_Job.Start() _Job.Start()
_Job.Progress.TotalCount = 0 _Job.Progress.Maximum = 0
_Job.Progress.CurrentCounter = 0 _Job.Progress.Value = 0
_Job.Progress.Enabled = True _Job.Progress.Visible = True
Dim SiteChecked As Boolean = False Dim SiteChecked As Boolean = False
Do While _Job.Count > 0 Do While _Job.Count > 0
_Job.ThrowIfCancellationRequested() _Job.ThrowIfCancellationRequested()
@@ -263,7 +307,7 @@ Namespace DownloadObjects
If Pool.Count > 0 Then Pool.ForEach(Sub(j) If j.Working Then j.Stop()) If Pool.Count > 0 Then Pool.ForEach(Sub(j) If j.Working Then j.Stop())
End Sub End Sub
Private Sub UpdateJobsLabel() Private Sub UpdateJobsLabel()
RaiseEvent OnJobsChange(Count) RaiseEvent JobsChange(Count)
End Sub End Sub
Private Sub DownloadData(ByRef _Job As Job, ByVal Token As CancellationToken) Private Sub DownloadData(ByRef _Job As Job, ByVal Token As CancellationToken)
Try Try
@@ -291,7 +335,7 @@ Namespace DownloadObjects
Next Next
If t.Count > 0 Or Keys.Count > 0 Then If t.Count > 0 Or Keys.Count > 0 Then
With _Job.Progress With _Job.Progress
.Enabled(EOptions.All) = True .Visible = True
.Information = IIf(_Job.IsSeparated, $"{_Job.Name} d", "D") .Information = IIf(_Job.IsSeparated, $"{_Job.Name} d", "D")
.Information &= $"ownloading {t.Count.NumToString(nf, NProv)}/{_Job.Items.Count.NumToString(nf, NProv)} profiles' data" .Information &= $"ownloading {t.Count.NumToString(nf, NProv)}/{_Job.Items.Count.NumToString(nf, NProv)} profiles' data"
.InformationTemporary = .Information .InformationTemporary = .Information
@@ -303,9 +347,13 @@ Namespace DownloadObjects
i = _Job.Items.FindIndex(Function(ii) ii.Key = k) i = _Job.Items.FindIndex(Function(ii) ii.Key = k)
If i >= 0 Then If i >= 0 Then
With _Job.Items(i) With _Job.Items(i)
If DirectCast(.Self, UserDataBase).ContentMissingExists Then MissingPostsDetected = True
host.AfterDownload(_Job.Items(i), Download.Main) host.AfterDownload(_Job.Items(i), Download.Main)
If Not .Disposed AndAlso Not .IsCollection AndAlso .DownloadedTotal(False) > 0 Then If Not .Disposed AndAlso Not .IsCollection AndAlso .DownloadedTotal(False) > 0 Then
If Not Downloaded.Contains(.Self) Then Downloaded.Add(GetUserFromMainCollection(.Self)) If Not Downloaded.Contains(.Self) Then Downloaded.Add(Settings.GetUser(.Self))
With DirectCast(.Self, UserDataBase)
If .LatestData.Count > 0 Then Files.ListAddList(.LatestData.Select(Function(d) New UserMediaD(d, .Self, Session)), FilesLP)
End With
dcc = True dcc = True
End If End If
End With End With
@@ -316,7 +364,7 @@ Namespace DownloadObjects
Keys.Clear() Keys.Clear()
_Job.Items.RemoveAll(Function(ii) ii.Disposed) _Job.Items.RemoveAll(Function(ii) ii.Disposed)
If dcc Then Downloaded.RemoveAll(Function(u) u Is Nothing) If dcc Then Downloaded.RemoveAll(Function(u) u Is Nothing)
If dcc And Downloaded.Count > 0 Then RaiseEvent OnDownloadCountChange() If dcc And Downloaded.Count > 0 Then RaiseEvent DownloadCountChange()
t.Clear() t.Clear()
End If End If
End If End If
@@ -332,30 +380,6 @@ Namespace DownloadObjects
End Sub)) End Sub))
End Try End Try
End Sub End Sub
Friend Shared Function GetUserFromMainCollection(ByVal User As IUserData) As IUserData
Dim uSimple As Predicate(Of IUserData) = Function(u) u.Equals(DirectCast(User, UserDataBase))
Dim uCol As Predicate(Of IUserData) = Function(ByVal u As IUserData) As Boolean
If u.IsCollection Then
Return DirectCast(u, UserDataBind).Collections.Exists(uSimple)
Else
Return False
End If
End Function
Dim uu As Predicate(Of IUserData)
If User.IncludedInCollection Then uu = uCol Else uu = uSimple
Dim i% = Settings.Users.FindIndex(uu)
If i >= 0 Then
If Settings.Users(i).IsCollection Then
With DirectCast(Settings.Users(i), UserDataBind)
i = .Collections.FindIndex(uSimple)
If i >= 0 Then Return .Collections(i)
End With
Else
Return Settings.Users(i)
End If
End If
Return Nothing
End Function
#End Region #End Region
#Region "Add" #Region "Add"
Private Sub AddItem(ByVal Item As IUserData, ByVal _UpdateJobsLabel As Boolean) Private Sub AddItem(ByVal Item As IUserData, ByVal _UpdateJobsLabel As Boolean)
@@ -395,7 +419,8 @@ Namespace DownloadObjects
Return False Return False
End Function End Function
Friend Sub UserRemove(ByVal _Item As IUserData) Friend Sub UserRemove(ByVal _Item As IUserData)
If Downloaded.Count > 0 AndAlso Downloaded.Contains(_Item) Then Downloaded.Remove(_Item) : RaiseEvent OnDownloadCountChange() If Downloaded.Count > 0 AndAlso Downloaded.Contains(_Item) Then Downloaded.Remove(_Item) : RaiseEvent DownloadCountChange()
If Files.Count > 0 AndAlso Files.RemoveAll(Function(f) Not f.User Is Nothing AndAlso f.User.Equals(_Item)) > 0 Then RaiseEvent FeedFilesChanged(False)
End Sub End Sub
#End Region #End Region
#Region "IDisposable Support" #Region "IDisposable Support"
@@ -405,6 +430,7 @@ Namespace DownloadObjects
If disposing Then If disposing Then
[Stop]() [Stop]()
Pool.ListClearDispose Pool.ListClearDispose
Files.Clear()
Downloaded.Clear() Downloaded.Clear()
End If End If
disposedValue = True disposedValue = True

View File

@@ -109,23 +109,23 @@ Namespace DownloadObjects
StartDownloading() StartDownloading()
End Sub End Sub
Private Sub BTT_STOP_Click(sender As Object, e As EventArgs) Handles BTT_STOP.Click Private Sub BTT_STOP_Click(sender As Object, e As EventArgs) Handles BTT_STOP.Click
SetControlValueInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = False) ControlInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = False)
MyJob.Stop() MyJob.Stop()
End Sub End Sub
#End Region #End Region
#Region "Downloading" #Region "Downloading"
Private Sub StartDownloading() Private Sub StartDownloading()
If Not MyJob.Working And MyJob.Count > 0 Then If Not MyJob.Working And MyJob.Count > 0 Then
SetControlValueInvoke(ToolbarTOP, BTT_DOWN, Sub() BTT_DOWN.Enabled = False) ControlInvoke(ToolbarTOP, BTT_DOWN, Sub() BTT_DOWN.Enabled = False)
SetControlValueInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = True) ControlInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = True)
MyJob.Start(AddressOf DownloadVideos, Threading.ApartmentState.STA) MyJob.Start(AddressOf DownloadVideos, Threading.ApartmentState.STA)
End If End If
End Sub End Sub
Private Sub DownloadVideos() Private Sub DownloadVideos()
MyJob.Start() MyJob.Start()
If MyJob.Count > 0 Then If MyJob.Count > 0 Then
MyJob.Progress.TotalCount = MyJob.Count MyJob.Progress.Maximum = MyJob.Count
MyJob.Progress.Enabled = True MyJob.Progress.Visible = True
Dim IsFirst As Boolean = True Dim IsFirst As Boolean = True
For i% = MyJob.Count - 1 To 0 Step -1 For i% = MyJob.Count - 1 To 0 Step -1
If MyJob.IsCancellationRequested Then Exit For If MyJob.IsCancellationRequested Then Exit For
@@ -135,10 +135,10 @@ Namespace DownloadObjects
Next Next
MyJob.Progress.Done() MyJob.Progress.Done()
RefillList() RefillList()
MyJob.Progress.Enabled = False MyJob.Progress.Visible = False
End If End If
SetControlValueInvoke(ToolbarTOP, BTT_DOWN, Sub() BTT_DOWN.Enabled = True) ControlInvoke(ToolbarTOP, BTT_DOWN, Sub() BTT_DOWN.Enabled = True)
SetControlValueInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = False) ControlInvoke(ToolbarTOP, BTT_STOP, Sub() BTT_STOP.Enabled = False)
MyJob.Stopped() MyJob.Stopped()
End Sub End Sub
#End Region #End Region

View File

@@ -15,9 +15,9 @@
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
Dim ActionButton3 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton1 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(CollectionEditorForm)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(CollectionEditorForm))
Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Me.CMB_COLLECTIONS = New PersonalUtilities.Forms.Controls.ComboBoxExtended() Me.CMB_COLLECTIONS = New PersonalUtilities.Forms.Controls.ComboBoxExtended()
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
CONTAINER_MAIN.ContentPanel.SuspendLayout() CONTAINER_MAIN.ContentPanel.SuspendLayout()
@@ -44,14 +44,14 @@
' '
'CMB_COLLECTIONS 'CMB_COLLECTIONS
' '
ActionButton3.BackgroundImage = CType(resources.GetObject("ActionButton3.BackgroundImage"), System.Drawing.Image) ActionButton1.BackgroundImage = CType(resources.GetObject("ActionButton1.BackgroundImage"), System.Drawing.Image)
ActionButton3.Name = "Add" ActionButton1.Name = "Add"
ActionButton3.ToolTipText = "Add new collection" ActionButton1.ToolTipText = "Add new collection"
ActionButton4.BackgroundImage = CType(resources.GetObject("ActionButton4.BackgroundImage"), System.Drawing.Image) ActionButton2.BackgroundImage = CType(resources.GetObject("ActionButton2.BackgroundImage"), System.Drawing.Image)
ActionButton4.Name = "ArrowDown" ActionButton2.Name = "ArrowDown"
ActionButton4.Visible = False ActionButton2.Visible = False
Me.CMB_COLLECTIONS.Buttons.Add(ActionButton3) Me.CMB_COLLECTIONS.Buttons.Add(ActionButton1)
Me.CMB_COLLECTIONS.Buttons.Add(ActionButton4) Me.CMB_COLLECTIONS.Buttons.Add(ActionButton2)
Me.CMB_COLLECTIONS.Dock = System.Windows.Forms.DockStyle.Fill Me.CMB_COLLECTIONS.Dock = System.Windows.Forms.DockStyle.Fill
Me.CMB_COLLECTIONS.ListDropDownStyle = PersonalUtilities.Forms.Controls.ComboBoxExtended.ListMode.Simple Me.CMB_COLLECTIONS.ListDropDownStyle = PersonalUtilities.Forms.Controls.ComboBoxExtended.ListMode.Simple
Me.CMB_COLLECTIONS.Location = New System.Drawing.Point(2, 0) Me.CMB_COLLECTIONS.Location = New System.Drawing.Point(2, 0)

View File

@@ -121,7 +121,7 @@
<value>False</value> <value>False</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="ActionButton3.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ActionButton1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6 iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsTAAALEwEAmpwYAAADmUlE JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsTAAALEwEAmpwYAAADmUlE
@@ -143,7 +143,7 @@
0AUyNxOP1DOwcaG/8I+/LRB+At7psBnyDBG0AAAAAElFTkSuQmCC 0AUyNxOP1DOwcaG/8I+/LRB+At7psBnyDBG0AAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="ActionButton4.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ActionButton2.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAE65JREFUeF7t iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAE65JREFUeF7t
3X2sJWddB/DdLi2lQG2hdOHuvfM887J7Cxca4ELTQMDWKigIFpBAEAgi9g+CJpJo9Q8NJhgBiYZIYspL 3X2sJWddB/DdLi2lQG2hdOHuvfM887J7Cxca4ELTQMDWKigIFpBAEAgi9g+CJpJo9Q8NJhgBiYZIYspL

View File

@@ -27,6 +27,7 @@ Namespace Editors
With MyDefs With MyDefs
.MyViewInitialize() .MyViewInitialize()
.AddOkCancelToolbar() .AddOkCancelToolbar()
Collections.ListAddList(Settings.LastCollections)
Collections.ListAddList((From c In Settings.Users Where c.IsCollection Select c.CollectionName), LAP.NotContainsOnly, EDP.ThrowException) Collections.ListAddList((From c In Settings.Users Where c.IsCollection Select c.CollectionName), LAP.NotContainsOnly, EDP.ThrowException)
If Collections.ListExists Then Collections.Sort() : CMB_COLLECTIONS.Items.AddRange(From c In Collections Select New ListItem(c)) If Collections.ListExists Then Collections.Sort() : CMB_COLLECTIONS.Items.AddRange(From c In Collections Select New ListItem(c))
If Not Collection.IsEmptyString And Collections.Contains(Collection) Then CMB_COLLECTIONS.SelectedIndex = Collections.IndexOf(Collection) If Not Collection.IsEmptyString And Collections.Contains(Collection) Then CMB_COLLECTIONS.SelectedIndex = Collections.IndexOf(Collection)
@@ -46,6 +47,10 @@ Namespace Editors
Private Sub MyDefs_ButtonOkClick() Handles MyDefs.ButtonOkClick Private Sub MyDefs_ButtonOkClick() Handles MyDefs.ButtonOkClick
If CMB_COLLECTIONS.SelectedIndex >= 0 Then If CMB_COLLECTIONS.SelectedIndex >= 0 Then
Collection = CMB_COLLECTIONS.Value.ToString Collection = CMB_COLLECTIONS.Value.ToString
With Settings.LastCollections
If .Contains(Collection) Then .Remove(Collection)
If .Count = 0 Then .Add(Collection) Else .Insert(0, Collection)
End With
MyDefs.CloseForm() MyDefs.CloseForm()
Else Else
MsgBoxE("Collection not selected", MsgBoxStyle.Exclamation) MsgBoxE("Collection not selected", MsgBoxStyle.Exclamation)

View File

@@ -44,6 +44,10 @@
Dim TP_DOWNLOADING As System.Windows.Forms.TableLayoutPanel Dim TP_DOWNLOADING As System.Windows.Forms.TableLayoutPanel
Dim ActionButton9 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton9 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim ActionButton10 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton10 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim TP_MISSING_DATA As System.Windows.Forms.TableLayoutPanel
Dim TAB_FEED As System.Windows.Forms.TabPage
Dim TP_FEED As System.Windows.Forms.TableLayoutPanel
Dim TP_FEED_IMG_COUNT As System.Windows.Forms.TableLayoutPanel
Me.TXT_GLOBAL_PATH = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_GLOBAL_PATH = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_IMAGE_LARGE = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_IMAGE_LARGE = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_IMAGE_SMALL = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_IMAGE_SMALL = New PersonalUtilities.Forms.Controls.TextBoxExtended()
@@ -72,6 +76,8 @@
Me.CH_UDESCR_UP = New System.Windows.Forms.CheckBox() Me.CH_UDESCR_UP = New System.Windows.Forms.CheckBox()
Me.CH_DOWN_OPEN_INFO_SUSPEND = New System.Windows.Forms.CheckBox() Me.CH_DOWN_OPEN_INFO_SUSPEND = New System.Windows.Forms.CheckBox()
Me.CH_DOWN_OPEN_PROGRESS_SUSPEND = New System.Windows.Forms.CheckBox() Me.CH_DOWN_OPEN_PROGRESS_SUSPEND = New System.Windows.Forms.CheckBox()
Me.CH_ADD_MISSING_TO_LOG = New System.Windows.Forms.CheckBox()
Me.CH_ADD_MISSING_ERROS_TO_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()
@@ -86,6 +92,11 @@
Me.CH_DOWN_OPEN_PROGRESS = New System.Windows.Forms.CheckBox() Me.CH_DOWN_OPEN_PROGRESS = New System.Windows.Forms.CheckBox()
Me.TXT_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_DOWN_COMPLETE_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_DOWN_COMPLETE_SCRIPT = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_FEED_ROWS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_FEED_COLUMNS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.CH_FEED_ENDLESS = New System.Windows.Forms.CheckBox()
Me.CH_FEED_ADD_SESSION = New System.Windows.Forms.CheckBox()
Me.CH_FEED_ADD_DATE = New System.Windows.Forms.CheckBox()
Me.TAB_MAIN = New System.Windows.Forms.TabControl() Me.TAB_MAIN = New System.Windows.Forms.TabControl()
Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() Me.CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
TP_BASIS = New System.Windows.Forms.TableLayoutPanel() TP_BASIS = New System.Windows.Forms.TableLayoutPanel()
@@ -106,6 +117,10 @@
TP_OPEN_PROGRESS = New System.Windows.Forms.TableLayoutPanel() TP_OPEN_PROGRESS = New System.Windows.Forms.TableLayoutPanel()
TAB_DOWN = New System.Windows.Forms.TabPage() TAB_DOWN = New System.Windows.Forms.TabPage()
TP_DOWNLOADING = New System.Windows.Forms.TableLayoutPanel() TP_DOWNLOADING = New System.Windows.Forms.TableLayoutPanel()
TP_MISSING_DATA = New System.Windows.Forms.TableLayoutPanel()
TAB_FEED = New System.Windows.Forms.TabPage()
TP_FEED = New System.Windows.Forms.TableLayoutPanel()
TP_FEED_IMG_COUNT = New System.Windows.Forms.TableLayoutPanel()
TP_BASIS.SuspendLayout() TP_BASIS.SuspendLayout()
CType(Me.TXT_GLOBAL_PATH, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_GLOBAL_PATH, System.ComponentModel.ISupportInitialize).BeginInit()
TP_IMAGES.SuspendLayout() TP_IMAGES.SuspendLayout()
@@ -136,6 +151,12 @@
TP_DOWNLOADING.SuspendLayout() TP_DOWNLOADING.SuspendLayout()
CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).BeginInit()
TP_MISSING_DATA.SuspendLayout()
TAB_FEED.SuspendLayout()
TP_FEED.SuspendLayout()
TP_FEED_IMG_COUNT.SuspendLayout()
CType(Me.TXT_FEED_ROWS, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TXT_FEED_COLUMNS, System.ComponentModel.ISupportInitialize).BeginInit()
Me.TAB_MAIN.SuspendLayout() Me.TAB_MAIN.SuspendLayout()
Me.CONTAINER_MAIN.ContentPanel.SuspendLayout() Me.CONTAINER_MAIN.ContentPanel.SuspendLayout()
Me.CONTAINER_MAIN.SuspendLayout() Me.CONTAINER_MAIN.SuspendLayout()
@@ -606,6 +627,30 @@
TT_MAIN.SetToolTip(Me.CH_DOWN_OPEN_PROGRESS_SUSPEND, "Do not open the form automatically if it was once closed") TT_MAIN.SetToolTip(Me.CH_DOWN_OPEN_PROGRESS_SUSPEND, "Do not open the form automatically if it was once closed")
Me.CH_DOWN_OPEN_PROGRESS_SUSPEND.UseVisualStyleBackColor = True Me.CH_DOWN_OPEN_PROGRESS_SUSPEND.UseVisualStyleBackColor = True
' '
'CH_ADD_MISSING_TO_LOG
'
Me.CH_ADD_MISSING_TO_LOG.AutoSize = True
Me.CH_ADD_MISSING_TO_LOG.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_ADD_MISSING_TO_LOG.Location = New System.Drawing.Point(4, 4)
Me.CH_ADD_MISSING_TO_LOG.Name = "CH_ADD_MISSING_TO_LOG"
Me.CH_ADD_MISSING_TO_LOG.Size = New System.Drawing.Size(279, 17)
Me.CH_ADD_MISSING_TO_LOG.TabIndex = 0
Me.CH_ADD_MISSING_TO_LOG.Text = "Add 'missing' information to log"
TT_MAIN.SetToolTip(Me.CH_ADD_MISSING_TO_LOG, resources.GetString("CH_ADD_MISSING_TO_LOG.ToolTip"))
Me.CH_ADD_MISSING_TO_LOG.UseVisualStyleBackColor = True
'
'CH_ADD_MISSING_ERROS_TO_LOG
'
Me.CH_ADD_MISSING_ERROS_TO_LOG.AutoSize = True
Me.CH_ADD_MISSING_ERROS_TO_LOG.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_ADD_MISSING_ERROS_TO_LOG.Location = New System.Drawing.Point(290, 4)
Me.CH_ADD_MISSING_ERROS_TO_LOG.Name = "CH_ADD_MISSING_ERROS_TO_LOG"
Me.CH_ADD_MISSING_ERROS_TO_LOG.Size = New System.Drawing.Size(280, 17)
Me.CH_ADD_MISSING_ERROS_TO_LOG.TabIndex = 1
Me.CH_ADD_MISSING_ERROS_TO_LOG.Text = "Add 'missing' errors to log"
TT_MAIN.SetToolTip(Me.CH_ADD_MISSING_ERROS_TO_LOG, resources.GetString("CH_ADD_MISSING_ERROS_TO_LOG.ToolTip"))
Me.CH_ADD_MISSING_ERROS_TO_LOG.UseVisualStyleBackColor = True
'
'TP_CHANNELS_IMGS 'TP_CHANNELS_IMGS
' '
TP_CHANNELS_IMGS.ColumnCount = 2 TP_CHANNELS_IMGS.ColumnCount = 2
@@ -962,15 +1007,17 @@
TP_DOWNLOADING.Controls.Add(Me.TXT_SCRIPT, 0, 3) TP_DOWNLOADING.Controls.Add(Me.TXT_SCRIPT, 0, 3)
TP_DOWNLOADING.Controls.Add(Me.CH_UDESCR_UP, 0, 0) TP_DOWNLOADING.Controls.Add(Me.CH_UDESCR_UP, 0, 0)
TP_DOWNLOADING.Controls.Add(Me.TXT_DOWN_COMPLETE_SCRIPT, 0, 4) TP_DOWNLOADING.Controls.Add(Me.TXT_DOWN_COMPLETE_SCRIPT, 0, 4)
TP_DOWNLOADING.Controls.Add(TP_MISSING_DATA, 0, 5)
TP_DOWNLOADING.Dock = System.Windows.Forms.DockStyle.Fill TP_DOWNLOADING.Dock = System.Windows.Forms.DockStyle.Fill
TP_DOWNLOADING.Location = New System.Drawing.Point(0, 0) TP_DOWNLOADING.Location = New System.Drawing.Point(0, 0)
TP_DOWNLOADING.Name = "TP_DOWNLOADING" TP_DOWNLOADING.Name = "TP_DOWNLOADING"
TP_DOWNLOADING.RowCount = 6 TP_DOWNLOADING.RowCount = 7
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) TP_DOWNLOADING.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_DOWNLOADING.Size = New System.Drawing.Size(576, 284) TP_DOWNLOADING.Size = New System.Drawing.Size(576, 284)
TP_DOWNLOADING.TabIndex = 0 TP_DOWNLOADING.TabIndex = 0
@@ -1012,6 +1059,136 @@
Me.TXT_DOWN_COMPLETE_SCRIPT.Size = New System.Drawing.Size(568, 22) Me.TXT_DOWN_COMPLETE_SCRIPT.Size = New System.Drawing.Size(568, 22)
Me.TXT_DOWN_COMPLETE_SCRIPT.TabIndex = 4 Me.TXT_DOWN_COMPLETE_SCRIPT.TabIndex = 4
' '
'TP_MISSING_DATA
'
TP_MISSING_DATA.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
TP_MISSING_DATA.ColumnCount = 2
TP_MISSING_DATA.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
TP_MISSING_DATA.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
TP_MISSING_DATA.Controls.Add(Me.CH_ADD_MISSING_TO_LOG, 0, 0)
TP_MISSING_DATA.Controls.Add(Me.CH_ADD_MISSING_ERROS_TO_LOG, 1, 0)
TP_MISSING_DATA.Dock = System.Windows.Forms.DockStyle.Fill
TP_MISSING_DATA.Location = New System.Drawing.Point(1, 147)
TP_MISSING_DATA.Margin = New System.Windows.Forms.Padding(0)
TP_MISSING_DATA.Name = "TP_MISSING_DATA"
TP_MISSING_DATA.RowCount = 1
TP_MISSING_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_MISSING_DATA.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24.0!))
TP_MISSING_DATA.Size = New System.Drawing.Size(574, 25)
TP_MISSING_DATA.TabIndex = 5
'
'TAB_FEED
'
TAB_FEED.Controls.Add(TP_FEED)
TAB_FEED.Location = New System.Drawing.Point(4, 22)
TAB_FEED.Name = "TAB_FEED"
TAB_FEED.Size = New System.Drawing.Size(576, 284)
TAB_FEED.TabIndex = 7
TAB_FEED.Text = "Feed"
'
'TP_FEED
'
TP_FEED.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
TP_FEED.ColumnCount = 1
TP_FEED.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_FEED.Controls.Add(TP_FEED_IMG_COUNT, 0, 0)
TP_FEED.Controls.Add(Me.CH_FEED_ENDLESS, 0, 1)
TP_FEED.Controls.Add(Me.CH_FEED_ADD_SESSION, 0, 2)
TP_FEED.Controls.Add(Me.CH_FEED_ADD_DATE, 0, 3)
TP_FEED.Dock = System.Windows.Forms.DockStyle.Fill
TP_FEED.Location = New System.Drawing.Point(0, 0)
TP_FEED.Name = "TP_FEED"
TP_FEED.RowCount = 5
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!))
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.Size = New System.Drawing.Size(576, 284)
TP_FEED.TabIndex = 0
'
'TP_FEED_IMG_COUNT
'
TP_FEED_IMG_COUNT.ColumnCount = 2
TP_FEED_IMG_COUNT.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
TP_FEED_IMG_COUNT.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
TP_FEED_IMG_COUNT.Controls.Add(Me.TXT_FEED_ROWS, 0, 0)
TP_FEED_IMG_COUNT.Controls.Add(Me.TXT_FEED_COLUMNS, 1, 0)
TP_FEED_IMG_COUNT.Dock = System.Windows.Forms.DockStyle.Fill
TP_FEED_IMG_COUNT.Location = New System.Drawing.Point(1, 1)
TP_FEED_IMG_COUNT.Margin = New System.Windows.Forms.Padding(0)
TP_FEED_IMG_COUNT.Name = "TP_FEED_IMG_COUNT"
TP_FEED_IMG_COUNT.RowCount = 1
TP_FEED_IMG_COUNT.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_FEED_IMG_COUNT.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
TP_FEED_IMG_COUNT.Size = New System.Drawing.Size(574, 28)
TP_FEED_IMG_COUNT.TabIndex = 0
'
'TXT_FEED_ROWS
'
Me.TXT_FEED_ROWS.CaptionText = "Feed rows"
Me.TXT_FEED_ROWS.CaptionToolTipEnabled = True
Me.TXT_FEED_ROWS.CaptionToolTipText = "How many lines of images should be shown in the feed form"
Me.TXT_FEED_ROWS.ControlMode = PersonalUtilities.Forms.Controls.TextBoxExtended.ControlModes.NumericUpDown
Me.TXT_FEED_ROWS.Dock = System.Windows.Forms.DockStyle.Fill
Me.TXT_FEED_ROWS.Location = New System.Drawing.Point(3, 3)
Me.TXT_FEED_ROWS.Name = "TXT_FEED_ROWS"
Me.TXT_FEED_ROWS.NumberMaximum = New Decimal(New Integer() {50, 0, 0, 0})
Me.TXT_FEED_ROWS.NumberMinimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.TXT_FEED_ROWS.Size = New System.Drawing.Size(281, 22)
Me.TXT_FEED_ROWS.TabIndex = 0
Me.TXT_FEED_ROWS.Text = "1"
Me.TXT_FEED_ROWS.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center
'
'TXT_FEED_COLUMNS
'
Me.TXT_FEED_COLUMNS.CaptionText = "Feed columns"
Me.TXT_FEED_COLUMNS.CaptionToolTipEnabled = True
Me.TXT_FEED_COLUMNS.CaptionToolTipText = "How many columns of images should be shown in the feed form"
Me.TXT_FEED_COLUMNS.ControlMode = PersonalUtilities.Forms.Controls.TextBoxExtended.ControlModes.NumericUpDown
Me.TXT_FEED_COLUMNS.Dock = System.Windows.Forms.DockStyle.Fill
Me.TXT_FEED_COLUMNS.Location = New System.Drawing.Point(290, 3)
Me.TXT_FEED_COLUMNS.Name = "TXT_FEED_COLUMNS"
Me.TXT_FEED_COLUMNS.NumberMaximum = New Decimal(New Integer() {20, 0, 0, 0})
Me.TXT_FEED_COLUMNS.NumberMinimum = New Decimal(New Integer() {1, 0, 0, 0})
Me.TXT_FEED_COLUMNS.Size = New System.Drawing.Size(281, 22)
Me.TXT_FEED_COLUMNS.TabIndex = 1
Me.TXT_FEED_COLUMNS.Text = "1"
Me.TXT_FEED_COLUMNS.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center
'
'CH_FEED_ENDLESS
'
Me.CH_FEED_ENDLESS.AutoSize = True
Me.CH_FEED_ENDLESS.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FEED_ENDLESS.Location = New System.Drawing.Point(4, 33)
Me.CH_FEED_ENDLESS.Name = "CH_FEED_ENDLESS"
Me.CH_FEED_ENDLESS.Size = New System.Drawing.Size(568, 19)
Me.CH_FEED_ENDLESS.TabIndex = 1
Me.CH_FEED_ENDLESS.Text = "Endless feed"
Me.CH_FEED_ENDLESS.UseVisualStyleBackColor = True
'
'CH_FEED_ADD_SESSION
'
Me.CH_FEED_ADD_SESSION.AutoSize = True
Me.CH_FEED_ADD_SESSION.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FEED_ADD_SESSION.Location = New System.Drawing.Point(4, 59)
Me.CH_FEED_ADD_SESSION.Name = "CH_FEED_ADD_SESSION"
Me.CH_FEED_ADD_SESSION.Size = New System.Drawing.Size(568, 19)
Me.CH_FEED_ADD_SESSION.TabIndex = 2
Me.CH_FEED_ADD_SESSION.Text = "Add the session number to the post title"
Me.CH_FEED_ADD_SESSION.UseVisualStyleBackColor = True
'
'CH_FEED_ADD_DATE
'
Me.CH_FEED_ADD_DATE.AutoSize = True
Me.CH_FEED_ADD_DATE.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_FEED_ADD_DATE.Location = New System.Drawing.Point(4, 85)
Me.CH_FEED_ADD_DATE.Name = "CH_FEED_ADD_DATE"
Me.CH_FEED_ADD_DATE.Size = New System.Drawing.Size(568, 19)
Me.CH_FEED_ADD_DATE.TabIndex = 3
Me.CH_FEED_ADD_DATE.Text = "Add the date to the post title"
Me.CH_FEED_ADD_DATE.UseVisualStyleBackColor = True
'
'TAB_MAIN 'TAB_MAIN
' '
Me.TAB_MAIN.Controls.Add(TAB_BASIS) Me.TAB_MAIN.Controls.Add(TAB_BASIS)
@@ -1019,6 +1196,7 @@
Me.TAB_MAIN.Controls.Add(TAB_DEFAULTS) Me.TAB_MAIN.Controls.Add(TAB_DEFAULTS)
Me.TAB_MAIN.Controls.Add(TAB_DOWN) Me.TAB_MAIN.Controls.Add(TAB_DOWN)
Me.TAB_MAIN.Controls.Add(TAB_DEFS_CHANNELS) Me.TAB_MAIN.Controls.Add(TAB_DEFS_CHANNELS)
Me.TAB_MAIN.Controls.Add(TAB_FEED)
Me.TAB_MAIN.Dock = System.Windows.Forms.DockStyle.Fill Me.TAB_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
Me.TAB_MAIN.Location = New System.Drawing.Point(0, 0) Me.TAB_MAIN.Location = New System.Drawing.Point(0, 0)
Me.TAB_MAIN.Name = "TAB_MAIN" Me.TAB_MAIN.Name = "TAB_MAIN"
@@ -1098,6 +1276,14 @@
TP_DOWNLOADING.PerformLayout() TP_DOWNLOADING.PerformLayout()
CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_DOWN_COMPLETE_SCRIPT, System.ComponentModel.ISupportInitialize).EndInit()
TP_MISSING_DATA.ResumeLayout(False)
TP_MISSING_DATA.PerformLayout()
TAB_FEED.ResumeLayout(False)
TP_FEED.ResumeLayout(False)
TP_FEED.PerformLayout()
TP_FEED_IMG_COUNT.ResumeLayout(False)
CType(Me.TXT_FEED_ROWS, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TXT_FEED_COLUMNS, System.ComponentModel.ISupportInitialize).EndInit()
Me.TAB_MAIN.ResumeLayout(False) Me.TAB_MAIN.ResumeLayout(False)
Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False) Me.CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
Me.CONTAINER_MAIN.ResumeLayout(False) Me.CONTAINER_MAIN.ResumeLayout(False)
@@ -1150,5 +1336,12 @@
Private WithEvents CH_DOWN_OPEN_INFO_SUSPEND As CheckBox Private WithEvents CH_DOWN_OPEN_INFO_SUSPEND As CheckBox
Private WithEvents CH_DOWN_OPEN_PROGRESS_SUSPEND As CheckBox Private WithEvents CH_DOWN_OPEN_PROGRESS_SUSPEND As CheckBox
Private WithEvents CH_DOWN_IMAGES_NATIVE As CheckBox Private WithEvents CH_DOWN_IMAGES_NATIVE As CheckBox
Private WithEvents CH_ADD_MISSING_TO_LOG As CheckBox
Private WithEvents CH_ADD_MISSING_ERROS_TO_LOG As CheckBox
Private WithEvents TXT_FEED_ROWS As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents TXT_FEED_COLUMNS As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents CH_FEED_ENDLESS As CheckBox
Private WithEvents CH_FEED_ADD_SESSION As CheckBox
Private WithEvents CH_FEED_ADD_DATE As CheckBox
End Class End Class
End Namespace End Namespace

View File

@@ -210,6 +210,16 @@
<value>This is a global setting for newly added users only. <value>This is a global setting for newly added users only.
This parameter specifies how the video will be stored in the users' download path. This parameter specifies how the video will be stored in the users' download path.
If checked, videos will be stored in separate folder; otherwise, videos will be stored along with images.</value> If checked, videos will be stored in separate folder; otherwise, videos will be stored along with images.</value>
</data>
<data name="CH_ADD_MISSING_TO_LOG.ToolTip" xml:space="preserve">
<value>Add information about missing posts (that were not downloaded) to the log.
That means that text like "Missing posts exist" will be added to the log.
You can find more detailed information about the missing posts in the form that opens by right-clicking on the 'Info' button in the main window.</value>
</data>
<data name="CH_ADD_MISSING_ERROS_TO_LOG.ToolTip" xml:space="preserve">
<value>Add error information about missing posts (that were not downloaded) to the log.
That means that the error text about the not downloaded post will be added to the log.
You can find more detailed information about the missing posts in the form that opens by right-clicking on the 'Info' button in the main window.</value>
</data> </data>
<metadata name="TP_CHANNELS_IMGS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="TP_CHANNELS_IMGS.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
@@ -282,6 +292,18 @@ If checked, videos will be stored in separate folder; otherwise, videos will be
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="TP_MISSING_DATA.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TAB_FEED.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_FEED.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TP_FEED_IMG_COUNT.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAA8AAAAQAAEABAAwOgAA9gAAADAwEAABAAQAaAYAACg7AAAgIBAAAQAEAOgCAACQQQAAGBgQAAEA AAABAA8AAAAQAAEABAAwOgAA9gAAADAwEAABAAQAaAYAACg7AAAgIBAAAQAEAOgCAACQQQAAGBgQAAEA

View File

@@ -8,9 +8,11 @@
' but WITHOUT ANY WARRANTY ' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
Imports ADB = PersonalUtilities.Forms.Controls.Base.ActionButton.DefaultButtons
Namespace Editors Namespace Editors
Friend Class GlobalSettingsForm Friend Class GlobalSettingsForm
Private WithEvents MyDefs As DefaultFormOptions Private WithEvents MyDefs As DefaultFormOptions
Friend Property FeedParametersChanged As Boolean = False
Friend Sub New() Friend Sub New()
InitializeComponent() InitializeComponent()
MyDefs = New DefaultFormOptions(Me, Settings.Design) MyDefs = New DefaultFormOptions(Me, Settings.Design)
@@ -58,6 +60,8 @@ Namespace Editors
TXT_SCRIPT.Text = .ScriptData.Value TXT_SCRIPT.Text = .ScriptData.Value
TXT_DOWN_COMPLETE_SCRIPT.Text = .DownloadsCompleteCommand TXT_DOWN_COMPLETE_SCRIPT.Text = .DownloadsCompleteCommand
TXT_DOWN_COMPLETE_SCRIPT.Checked = .DownloadsCompleteCommand.Attribute TXT_DOWN_COMPLETE_SCRIPT.Checked = .DownloadsCompleteCommand.Attribute
CH_ADD_MISSING_TO_LOG.Checked = .AddMissingToLog
CH_ADD_MISSING_ERROS_TO_LOG.Checked = .AddMissingErrorsToLog
'Downloading: file names 'Downloading: file names
CH_FILE_NAME_CHANGE.Checked = Not .FileReplaceNameByDate.Value = FileNameReplaceMode.None CH_FILE_NAME_CHANGE.Checked = Not .FileReplaceNameByDate.Value = FileNameReplaceMode.None
OPT_FILE_NAME_REPLACE.Checked = .FileReplaceNameByDate.Value = FileNameReplaceMode.Replace OPT_FILE_NAME_REPLACE.Checked = .FileReplaceNameByDate.Value = FileNameReplaceMode.Replace
@@ -75,6 +79,12 @@ Namespace Editors
CH_COPY_CHANNEL_USER_IMAGE_ALL.Checked = .ChannelsAddUserImagesFromAllChannels CH_COPY_CHANNEL_USER_IMAGE_ALL.Checked = .ChannelsAddUserImagesFromAllChannels
CH_COPY_CHANNEL_USER_IMAGE_ALL.Enabled = CH_COPY_CHANNEL_USER_IMAGE.Checked CH_COPY_CHANNEL_USER_IMAGE_ALL.Enabled = CH_COPY_CHANNEL_USER_IMAGE.Checked
CH_CHANNELS_USERS_TEMP.Checked = .ChannelsDefaultTemporary CH_CHANNELS_USERS_TEMP.Checked = .ChannelsDefaultTemporary
'Feed
TXT_FEED_ROWS.Value = .FeedDataRows.Value
TXT_FEED_COLUMNS.Value = .FeedDataColumns.Value
CH_FEED_ENDLESS.Checked = .FeedEndless
CH_FEED_ADD_SESSION.Checked = .FeedAddSessionToCaption
CH_FEED_ADD_DATE.Checked = .FeedAddDateToCaption
End With End With
.MyFieldsChecker = New FieldsChecker .MyFieldsChecker = New FieldsChecker
With .MyFieldsCheckerE With .MyFieldsCheckerE
@@ -158,6 +168,8 @@ Namespace Editors
.ScriptData.Attribute.Value = TXT_SCRIPT.Checked .ScriptData.Attribute.Value = TXT_SCRIPT.Checked
.DownloadsCompleteCommand.Value = TXT_DOWN_COMPLETE_SCRIPT.Text .DownloadsCompleteCommand.Value = TXT_DOWN_COMPLETE_SCRIPT.Text
.DownloadsCompleteCommand.Attribute.Value = TXT_DOWN_COMPLETE_SCRIPT.Checked .DownloadsCompleteCommand.Attribute.Value = TXT_DOWN_COMPLETE_SCRIPT.Checked
.AddMissingToLog.Value = CH_ADD_MISSING_TO_LOG.Checked
.AddMissingErrorsToLog.Value = CH_ADD_MISSING_ERROS_TO_LOG.Checked
'Downloading: file names 'Downloading: file names
If CH_FILE_NAME_CHANGE.Checked Then If CH_FILE_NAME_CHANGE.Checked Then
.FileReplaceNameByDate.Value = If(OPT_FILE_NAME_REPLACE.Checked, FileNameReplaceMode.Replace, FileNameReplaceMode.Add) .FileReplaceNameByDate.Value = If(OPT_FILE_NAME_REPLACE.Checked, FileNameReplaceMode.Replace, FileNameReplaceMode.Add)
@@ -177,6 +189,13 @@ Namespace Editors
.FromChannelCopyImageToUser.Value = CH_COPY_CHANNEL_USER_IMAGE.Checked .FromChannelCopyImageToUser.Value = CH_COPY_CHANNEL_USER_IMAGE.Checked
.ChannelsAddUserImagesFromAllChannels.Value = CH_COPY_CHANNEL_USER_IMAGE_ALL.Checked .ChannelsAddUserImagesFromAllChannels.Value = CH_COPY_CHANNEL_USER_IMAGE_ALL.Checked
.ChannelsDefaultTemporary.Value = CH_CHANNELS_USERS_TEMP.Checked .ChannelsDefaultTemporary.Value = CH_CHANNELS_USERS_TEMP.Checked
'Feed
.FeedDataRows.Value = CInt(TXT_FEED_ROWS.Value)
.FeedDataColumns.Value = CInt(TXT_FEED_COLUMNS.Value)
.FeedEndless.Value = CH_FEED_ENDLESS.Checked
.FeedAddSessionToCaption.Value = CH_FEED_ADD_SESSION.Checked
.FeedAddDateToCaption.Value = CH_FEED_ADD_DATE.Checked
FeedParametersChanged = .FeedDataRows.ChangesDetected Or .FeedDataColumns.ChangesDetected Or .FeedEndless.ChangesDetected
.EndUpdate() .EndUpdate()
End With End With
@@ -184,16 +203,16 @@ Namespace Editors
End If End If
End Sub End Sub
Private Sub TXT_GLOBAL_PATH_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_GLOBAL_PATH.ActionOnButtonClick Private Sub TXT_GLOBAL_PATH_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_GLOBAL_PATH.ActionOnButtonClick
If Sender.DefaultButton = ActionButton.DefaultButtons.Open Then If Sender.DefaultButton = ADB.Open Then
Dim f As SFile = SFile.SelectPath(Settings.GlobalPath.Value) Dim f As SFile = SFile.SelectPath(Settings.GlobalPath.Value)
If Not f.IsEmptyString Then TXT_GLOBAL_PATH.Text = f If Not f.IsEmptyString Then TXT_GLOBAL_PATH.Text = f
End If End If
End Sub End Sub
Private Sub TXT_MAX_JOBS_USERS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_MAX_JOBS_USERS.ActionOnButtonClick Private Sub TXT_MAX_JOBS_USERS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_MAX_JOBS_USERS.ActionOnButtonClick
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_USERS.Value = SettingsCLS.DefaultMaxDownloadingTasks If Sender.DefaultButton = ADB.Refresh Then TXT_MAX_JOBS_USERS.Value = SettingsCLS.DefaultMaxDownloadingTasks
End Sub End Sub
Private Sub TXT_MAX_JOBS_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_MAX_JOBS_CHANNELS.ActionOnButtonClick Private Sub TXT_MAX_JOBS_CHANNELS_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_MAX_JOBS_CHANNELS.ActionOnButtonClick
If Sender.DefaultButton = ActionButton.DefaultButtons.Refresh Then TXT_MAX_JOBS_CHANNELS.Value = SettingsCLS.DefaultMaxDownloadingTasks If Sender.DefaultButton = ADB.Refresh Then TXT_MAX_JOBS_CHANNELS.Value = SettingsCLS.DefaultMaxDownloadingTasks
End Sub End Sub
Private Sub CH_FILE_NAME_CHANGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FILE_NAME_CHANGE.CheckedChanged Private Sub CH_FILE_NAME_CHANGE_CheckedChanged(sender As Object, e As EventArgs) Handles CH_FILE_NAME_CHANGE.CheckedChanged
ChangeFileNameChangersEnabling() ChangeFileNameChangersEnabling()

View File

@@ -15,6 +15,7 @@
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container() Me.components = New System.ComponentModel.Container()
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
Dim ActionButton1 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton1 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(SiteEditorForm)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(SiteEditorForm))
Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton2 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
@@ -22,7 +23,6 @@
Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton4 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim ActionButton5 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton5 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim ActionButton6 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton() Dim ActionButton6 As PersonalUtilities.Forms.Controls.Base.ActionButton = New PersonalUtilities.Forms.Controls.Base.ActionButton()
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
Me.TP_MAIN = New System.Windows.Forms.TableLayoutPanel() Me.TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
Me.TXT_PATH = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_PATH = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.TXT_COOKIES = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_COOKIES = New PersonalUtilities.Forms.Controls.TextBoxExtended()
@@ -30,34 +30,53 @@
Me.TXT_PATH_SAVED_POSTS = New PersonalUtilities.Forms.Controls.TextBoxExtended() Me.TXT_PATH_SAVED_POSTS = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.CH_GET_USER_MEDIA_ONLY = New System.Windows.Forms.CheckBox() Me.CH_GET_USER_MEDIA_ONLY = New System.Windows.Forms.CheckBox()
Me.TT_MAIN = New System.Windows.Forms.ToolTip(Me.components) Me.TT_MAIN = New System.Windows.Forms.ToolTip(Me.components)
Me.CH_DOWNLOAD_SITE_DATA = New System.Windows.Forms.CheckBox()
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
CONTAINER_MAIN.ContentPanel.SuspendLayout()
CONTAINER_MAIN.SuspendLayout()
Me.TP_MAIN.SuspendLayout() Me.TP_MAIN.SuspendLayout()
CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).BeginInit()
CONTAINER_MAIN.ContentPanel.SuspendLayout()
CONTAINER_MAIN.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'CONTAINER_MAIN
'
'
'CONTAINER_MAIN.ContentPanel
'
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.TP_MAIN)
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(544, 218)
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
CONTAINER_MAIN.LeftToolStripPanelVisible = False
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
CONTAINER_MAIN.Name = "CONTAINER_MAIN"
CONTAINER_MAIN.RightToolStripPanelVisible = False
CONTAINER_MAIN.Size = New System.Drawing.Size(544, 243)
CONTAINER_MAIN.TabIndex = 0
CONTAINER_MAIN.TopToolStripPanelVisible = False
'
'TP_MAIN 'TP_MAIN
' '
Me.TP_MAIN.ColumnCount = 1 Me.TP_MAIN.ColumnCount = 1
Me.TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) Me.TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_MAIN.Controls.Add(Me.TXT_PATH, 0, 0) Me.TP_MAIN.Controls.Add(Me.TXT_PATH, 0, 0)
Me.TP_MAIN.Controls.Add(Me.TXT_COOKIES, 0, 2) Me.TP_MAIN.Controls.Add(Me.TXT_COOKIES, 0, 2)
Me.TP_MAIN.Controls.Add(Me.TP_SITE_PROPS, 0, 4) Me.TP_MAIN.Controls.Add(Me.TP_SITE_PROPS, 0, 5)
Me.TP_MAIN.Controls.Add(Me.TXT_PATH_SAVED_POSTS, 0, 1) Me.TP_MAIN.Controls.Add(Me.TXT_PATH_SAVED_POSTS, 0, 1)
Me.TP_MAIN.Controls.Add(Me.CH_GET_USER_MEDIA_ONLY, 0, 3) Me.TP_MAIN.Controls.Add(Me.CH_GET_USER_MEDIA_ONLY, 0, 4)
Me.TP_MAIN.Controls.Add(Me.CH_DOWNLOAD_SITE_DATA, 0, 3)
Me.TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill Me.TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
Me.TP_MAIN.Location = New System.Drawing.Point(0, 0) Me.TP_MAIN.Location = New System.Drawing.Point(0, 0)
Me.TP_MAIN.Name = "TP_MAIN" Me.TP_MAIN.Name = "TP_MAIN"
Me.TP_MAIN.RowCount = 5 Me.TP_MAIN.RowCount = 6
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!)) Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 28.0!))
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) Me.TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_MAIN.Size = New System.Drawing.Size(544, 219) Me.TP_MAIN.Size = New System.Drawing.Size(544, 218)
Me.TP_MAIN.TabIndex = 0 Me.TP_MAIN.TabIndex = 0
' '
'TXT_PATH 'TXT_PATH
@@ -101,15 +120,15 @@
Me.TP_SITE_PROPS.ColumnCount = 1 Me.TP_SITE_PROPS.ColumnCount = 1
Me.TP_SITE_PROPS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) Me.TP_SITE_PROPS.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_SITE_PROPS.Dock = System.Windows.Forms.DockStyle.Fill Me.TP_SITE_PROPS.Dock = System.Windows.Forms.DockStyle.Fill
Me.TP_SITE_PROPS.Location = New System.Drawing.Point(3, 112) Me.TP_SITE_PROPS.Location = New System.Drawing.Point(3, 137)
Me.TP_SITE_PROPS.Name = "TP_SITE_PROPS" Me.TP_SITE_PROPS.Name = "TP_SITE_PROPS"
Me.TP_SITE_PROPS.RowCount = 4 Me.TP_SITE_PROPS.RowCount = 4
Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!)) Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25.0!))
Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!)) Me.TP_SITE_PROPS.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TP_SITE_PROPS.Size = New System.Drawing.Size(538, 104) Me.TP_SITE_PROPS.Size = New System.Drawing.Size(538, 78)
Me.TP_SITE_PROPS.TabIndex = 4 Me.TP_SITE_PROPS.TabIndex = 5
' '
'TXT_PATH_SAVED_POSTS 'TXT_PATH_SAVED_POSTS
' '
@@ -130,54 +149,52 @@
' '
Me.CH_GET_USER_MEDIA_ONLY.AutoSize = True Me.CH_GET_USER_MEDIA_ONLY.AutoSize = True
Me.CH_GET_USER_MEDIA_ONLY.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_GET_USER_MEDIA_ONLY.Dock = System.Windows.Forms.DockStyle.Fill
Me.CH_GET_USER_MEDIA_ONLY.Location = New System.Drawing.Point(3, 87) Me.CH_GET_USER_MEDIA_ONLY.Location = New System.Drawing.Point(3, 112)
Me.CH_GET_USER_MEDIA_ONLY.Name = "CH_GET_USER_MEDIA_ONLY" Me.CH_GET_USER_MEDIA_ONLY.Name = "CH_GET_USER_MEDIA_ONLY"
Me.CH_GET_USER_MEDIA_ONLY.Padding = New System.Windows.Forms.Padding(100, 0, 0, 0) Me.CH_GET_USER_MEDIA_ONLY.Padding = New System.Windows.Forms.Padding(100, 0, 0, 0)
Me.CH_GET_USER_MEDIA_ONLY.Size = New System.Drawing.Size(538, 19) Me.CH_GET_USER_MEDIA_ONLY.Size = New System.Drawing.Size(538, 19)
Me.CH_GET_USER_MEDIA_ONLY.TabIndex = 3 Me.CH_GET_USER_MEDIA_ONLY.TabIndex = 4
Me.CH_GET_USER_MEDIA_ONLY.Text = "Get user media only" Me.CH_GET_USER_MEDIA_ONLY.Text = "Get user media only"
Me.CH_GET_USER_MEDIA_ONLY.UseVisualStyleBackColor = True Me.CH_GET_USER_MEDIA_ONLY.UseVisualStyleBackColor = True
' '
'CONTAINER_MAIN 'CH_DOWNLOAD_SITE_DATA
' '
' Me.CH_DOWNLOAD_SITE_DATA.AutoSize = True
'CONTAINER_MAIN.ContentPanel Me.CH_DOWNLOAD_SITE_DATA.Dock = System.Windows.Forms.DockStyle.Fill
' Me.CH_DOWNLOAD_SITE_DATA.Location = New System.Drawing.Point(3, 87)
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.TP_MAIN) Me.CH_DOWNLOAD_SITE_DATA.Name = "CH_DOWNLOAD_SITE_DATA"
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(544, 219) Me.CH_DOWNLOAD_SITE_DATA.Padding = New System.Windows.Forms.Padding(100, 0, 0, 0)
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill Me.CH_DOWNLOAD_SITE_DATA.Size = New System.Drawing.Size(538, 19)
CONTAINER_MAIN.LeftToolStripPanelVisible = False Me.CH_DOWNLOAD_SITE_DATA.TabIndex = 3
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0) Me.CH_DOWNLOAD_SITE_DATA.Text = "Download site data"
CONTAINER_MAIN.Name = "CONTAINER_MAIN" Me.TT_MAIN.SetToolTip(Me.CH_DOWNLOAD_SITE_DATA, "If disabled, this site's data will not be downloaded." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "You can disable downloadin" &
CONTAINER_MAIN.RightToolStripPanelVisible = False "g data from the site if you need it.")
CONTAINER_MAIN.Size = New System.Drawing.Size(544, 219) Me.CH_DOWNLOAD_SITE_DATA.UseVisualStyleBackColor = True
CONTAINER_MAIN.TabIndex = 0
CONTAINER_MAIN.TopToolStripPanelVisible = False
' '
'SiteEditorForm 'SiteEditorForm
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(544, 219) Me.ClientSize = New System.Drawing.Size(544, 243)
Me.Controls.Add(CONTAINER_MAIN) Me.Controls.Add(CONTAINER_MAIN)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.KeyPreview = True Me.KeyPreview = True
Me.MaximizeBox = False Me.MaximizeBox = False
Me.MaximumSize = New System.Drawing.Size(560, 258) Me.MaximumSize = New System.Drawing.Size(560, 282)
Me.MinimizeBox = False Me.MinimizeBox = False
Me.MinimumSize = New System.Drawing.Size(560, 258) Me.MinimumSize = New System.Drawing.Size(560, 282)
Me.Name = "SiteEditorForm" Me.Name = "SiteEditorForm"
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.Text = "Site" Me.Text = "Site"
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
CONTAINER_MAIN.ResumeLayout(False)
CONTAINER_MAIN.PerformLayout()
Me.TP_MAIN.ResumeLayout(False) Me.TP_MAIN.ResumeLayout(False)
Me.TP_MAIN.PerformLayout() Me.TP_MAIN.PerformLayout()
CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_PATH, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_COOKIES, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.TXT_PATH_SAVED_POSTS, System.ComponentModel.ISupportInitialize).EndInit()
CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
CONTAINER_MAIN.ResumeLayout(False)
CONTAINER_MAIN.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub
@@ -188,5 +205,6 @@
Private WithEvents TP_SITE_PROPS As SiteDefaults Private WithEvents TP_SITE_PROPS As SiteDefaults
Private WithEvents CH_GET_USER_MEDIA_ONLY As CheckBox Private WithEvents CH_GET_USER_MEDIA_ONLY As CheckBox
Private WithEvents TT_MAIN As ToolTip Private WithEvents TT_MAIN As ToolTip
Private WithEvents CH_DOWNLOAD_SITE_DATA As CheckBox
End Class End Class
End Namespace End Namespace

View File

@@ -117,6 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="ActionButton1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="ActionButton1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
@@ -222,9 +225,6 @@
AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC AFuc5QFgn6ClHh5iOQVAKNixyucB8NY0vG9JOzzyhrdq5IRgAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="TT_MAIN.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="TT_MAIN.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>

View File

@@ -11,6 +11,7 @@ Imports PersonalUtilities.Forms.Controls
Imports PersonalUtilities.Forms.Controls.Base Imports PersonalUtilities.Forms.Controls.Base
Imports PersonalUtilities.Tools.WEB Imports PersonalUtilities.Tools.WEB
Imports CookieControl = PersonalUtilities.Tools.WEB.CookieListForm.CookieControl Imports CookieControl = PersonalUtilities.Tools.WEB.CookieListForm.CookieControl
Imports ADB = PersonalUtilities.Forms.Controls.Base.ActionButton.DefaultButtons
Imports SCrawler.Plugin Imports SCrawler.Plugin
Imports SCrawler.Plugin.Hosts Imports SCrawler.Plugin.Hosts
Namespace Editors Namespace Editors
@@ -63,7 +64,8 @@ Namespace Editors
TXT_PATH.Text = .Path(False) TXT_PATH.Text = .Path(False)
TXT_PATH_SAVED_POSTS.Text = .SavedPostsPath(False) TXT_PATH_SAVED_POSTS.Text = .SavedPostsPath(False)
CH_GET_USER_MEDIA_ONLY.Checked = .GetUserMediaOnly.Value CH_DOWNLOAD_SITE_DATA.Checked = .DownloadSiteData
CH_GET_USER_MEDIA_ONLY.Checked = .GetUserMediaOnly
SiteDefaultsFunctions.SetChecker(TP_SITE_PROPS, Host) SiteDefaultsFunctions.SetChecker(TP_SITE_PROPS, Host)
@@ -131,6 +133,7 @@ Namespace Editors
TXT_PATH.CaptionWidth = offset TXT_PATH.CaptionWidth = offset
TXT_PATH_SAVED_POSTS.CaptionWidth = offset TXT_PATH_SAVED_POSTS.CaptionWidth = offset
TXT_COOKIES.CaptionWidth = offset TXT_COOKIES.CaptionWidth = offset
CH_DOWNLOAD_SITE_DATA.Padding = New PaddingE(CH_DOWNLOAD_SITE_DATA.Padding) With {.Left = offset}
CH_GET_USER_MEDIA_ONLY.Padding = New PaddingE(CH_GET_USER_MEDIA_ONLY.Padding) With {.Left = offset} CH_GET_USER_MEDIA_ONLY.Padding = New PaddingE(CH_GET_USER_MEDIA_ONLY.Padding) With {.Left = offset}
If c > 0 Or Not Host.IsMyClass Then If c > 0 Or Not Host.IsMyClass Then
Dim ss As New Size(Size.Width, Size.Height + h + c) Dim ss As New Size(Size.Width, Size.Height + h + c)
@@ -183,6 +186,7 @@ Namespace Editors
SiteDefaultsFunctions.SetPropByChecker(TP_SITE_PROPS, Host) SiteDefaultsFunctions.SetPropByChecker(TP_SITE_PROPS, Host)
If TXT_PATH.IsEmptyString Then .Path = Nothing Else .Path = TXT_PATH.Text If TXT_PATH.IsEmptyString Then .Path = Nothing Else .Path = TXT_PATH.Text
.SavedPostsPath = TXT_PATH_SAVED_POSTS.Text .SavedPostsPath = TXT_PATH_SAVED_POSTS.Text
.DownloadSiteData.Value = CH_DOWNLOAD_SITE_DATA.Checked
.GetUserMediaOnly.Value = CH_GET_USER_MEDIA_ONLY.Checked .GetUserMediaOnly.Value = CH_GET_USER_MEDIA_ONLY.Checked
If .PropList.Count > 0 Then .PropList.ForEach(Sub(p) If Not p.Options Is Nothing Then p.UpdateValueByControl()) If .PropList.Count > 0 Then .PropList.ForEach(Sub(p) If Not p.Options Is Nothing Then p.UpdateValueByControl())
@@ -203,14 +207,14 @@ Namespace Editors
ChangePath(Sender, Host.SavedPostsPath(False), TXT_PATH_SAVED_POSTS) ChangePath(Sender, Host.SavedPostsPath(False), TXT_PATH_SAVED_POSTS)
End Sub End Sub
Private Sub ChangePath(ByVal Sender As ActionButton, ByVal PathValue As SFile, ByRef CNT As TextBoxExtended) Private Sub ChangePath(ByVal Sender As ActionButton, ByVal PathValue As SFile, ByRef CNT As TextBoxExtended)
If Sender.DefaultButton = ActionButton.DefaultButtons.Open Then If Sender.DefaultButton = ADB.Open Then
Dim f As SFile = SFile.SelectPath(PathValue) Dim f As SFile = SFile.SelectPath(PathValue)
If Not f.IsEmptyString Then CNT.Text = f If Not f.IsEmptyString Then CNT.Text = f
End If End If
End Sub End Sub
Private Sub TXT_COOKIES_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_COOKIES.ActionOnButtonClick Private Sub TXT_COOKIES_ActionOnButtonClick(ByVal Sender As ActionButton, ByVal e As EventArgs) Handles TXT_COOKIES.ActionOnButtonClick
Select Case Sender.DefaultButton Select Case Sender.DefaultButton
Case ActionButton.DefaultButtons.Edit Case ADB.Edit
If Not Host.Responser Is Nothing Then If Not Host.Responser Is Nothing Then
Using f As New CookieListForm(Host.Responser) With { Using f As New CookieListForm(Host.Responser) With {
.MyDesignXML = Settings.Design, .MyDesignXML = Settings.Design,
@@ -220,7 +224,7 @@ Namespace Editors
End Using End Using
SetCookieText() SetCookieText()
End If End If
Case ActionButton.DefaultButtons.Clear Case ADB.Clear
If Not Host.Responser Is Nothing Then If Not Host.Responser Is Nothing Then
With Host.Responser With Host.Responser
If Not .Cookies Is Nothing Then .Cookies.Dispose() If Not .Cookies Is Nothing Then .Cookies.Dispose()

View File

@@ -0,0 +1,28 @@
' Copyright (C) 2022 Andy
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU General Public License as published by
' the Free Software Foundation, either version 3 of the License, or
' (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY
Imports PersonalUtilities.Tools.WEB
Namespace EncryptCookies
Friend Module EncryptFunction
Friend CookiesEncrypted As Boolean = False
Friend Sub ValidateCookiesEncrypt(ByRef Responser As Response)
If Not Responser Is Nothing Then
Dim b As Boolean = False
With Responser
If Not .Cookies Is Nothing Then
With .Cookies
If .EncryptKey.IsEmptyString Then .EncryptKey = SettingsCLS.CookieEncryptKey : b = .Count > 0
End With
End If
If .CookiesEncryptKey.IsEmptyString Then .CookiesEncryptKey = SettingsCLS.CookieEncryptKey : b = True
If b Then .SaveSettings()
End With
End If
End Sub
End Module
End Namespace

View File

@@ -22,10 +22,16 @@ Partial Friend Class FDatePickerForm : Inherits System.Windows.Forms.Form
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer Dim CONTAINER_MAIN As System.Windows.Forms.ToolStripContainer
Me.DT = New System.Windows.Forms.DateTimePicker() Dim TP_MAIN As System.Windows.Forms.TableLayoutPanel
Me.DT_FROM = New PersonalUtilities.Forms.Controls.TextBoxExtended()
Me.DT_TO = New PersonalUtilities.Forms.Controls.TextBoxExtended()
CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer() CONTAINER_MAIN = New System.Windows.Forms.ToolStripContainer()
TP_MAIN = New System.Windows.Forms.TableLayoutPanel()
CONTAINER_MAIN.ContentPanel.SuspendLayout() CONTAINER_MAIN.ContentPanel.SuspendLayout()
CONTAINER_MAIN.SuspendLayout() CONTAINER_MAIN.SuspendLayout()
TP_MAIN.SuspendLayout()
CType(Me.DT_FROM, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DT_TO, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
'CONTAINER_MAIN 'CONTAINER_MAIN
@@ -33,38 +39,73 @@ Partial Friend Class FDatePickerForm : Inherits System.Windows.Forms.Form
' '
'CONTAINER_MAIN.ContentPanel 'CONTAINER_MAIN.ContentPanel
' '
CONTAINER_MAIN.ContentPanel.Controls.Add(Me.DT) CONTAINER_MAIN.ContentPanel.Controls.Add(TP_MAIN)
CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(209, 47) CONTAINER_MAIN.ContentPanel.Size = New System.Drawing.Size(395, 28)
CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill CONTAINER_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
CONTAINER_MAIN.LeftToolStripPanelVisible = False CONTAINER_MAIN.LeftToolStripPanelVisible = False
CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0) CONTAINER_MAIN.Location = New System.Drawing.Point(0, 0)
CONTAINER_MAIN.Name = "CONTAINER_MAIN" CONTAINER_MAIN.Name = "CONTAINER_MAIN"
CONTAINER_MAIN.RightToolStripPanelVisible = False CONTAINER_MAIN.RightToolStripPanelVisible = False
CONTAINER_MAIN.Size = New System.Drawing.Size(209, 47) CONTAINER_MAIN.Size = New System.Drawing.Size(395, 53)
CONTAINER_MAIN.TabIndex = 0 CONTAINER_MAIN.TabIndex = 0
CONTAINER_MAIN.TopToolStripPanelVisible = False CONTAINER_MAIN.TopToolStripPanelVisible = False
' '
'DT 'TP_MAIN
' '
Me.DT.Dock = System.Windows.Forms.DockStyle.Fill TP_MAIN.ColumnCount = 2
Me.DT.Location = New System.Drawing.Point(0, 0) TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.DT.Name = "DT" TP_MAIN.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!))
Me.DT.ShowCheckBox = True TP_MAIN.Controls.Add(Me.DT_FROM, 0, 0)
Me.DT.Size = New System.Drawing.Size(209, 20) TP_MAIN.Controls.Add(Me.DT_TO, 1, 0)
Me.DT.TabIndex = 0 TP_MAIN.Dock = System.Windows.Forms.DockStyle.Fill
TP_MAIN.Location = New System.Drawing.Point(0, 0)
TP_MAIN.Name = "TP_MAIN"
TP_MAIN.RowCount = 1
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
TP_MAIN.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 53.0!))
TP_MAIN.Size = New System.Drawing.Size(395, 28)
TP_MAIN.TabIndex = 1
'
'DT_FROM
'
Me.DT_FROM.CaptionMode = PersonalUtilities.Forms.Controls.Base.ICaptionControl.Modes.CheckBox
Me.DT_FROM.CaptionText = "From"
Me.DT_FROM.CaptionWidth = 50.0R
Me.DT_FROM.ControlMode = PersonalUtilities.Forms.Controls.TextBoxExtended.ControlModes.DateTimePicker
Me.DT_FROM.Dock = System.Windows.Forms.DockStyle.Fill
Me.DT_FROM.Location = New System.Drawing.Point(3, 3)
Me.DT_FROM.Name = "DT_FROM"
Me.DT_FROM.Size = New System.Drawing.Size(191, 22)
Me.DT_FROM.TabIndex = 0
Me.DT_FROM.Text = "17.09.2022 2:13:36"
Me.DT_FROM.TextBoxWidthMinimal = 50
'
'DT_TO
'
Me.DT_TO.CaptionMode = PersonalUtilities.Forms.Controls.Base.ICaptionControl.Modes.CheckBox
Me.DT_TO.CaptionText = "To"
Me.DT_TO.CaptionWidth = 50.0R
Me.DT_TO.ControlMode = PersonalUtilities.Forms.Controls.TextBoxExtended.ControlModes.DateTimePicker
Me.DT_TO.Dock = System.Windows.Forms.DockStyle.Fill
Me.DT_TO.Location = New System.Drawing.Point(200, 3)
Me.DT_TO.Name = "DT_TO"
Me.DT_TO.Size = New System.Drawing.Size(192, 22)
Me.DT_TO.TabIndex = 1
Me.DT_TO.Text = "17.09.2022 2:13:40"
Me.DT_TO.TextBoxWidthMinimal = 50
' '
'FDatePickerForm 'FDatePickerForm
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(209, 47) Me.ClientSize = New System.Drawing.Size(395, 53)
Me.Controls.Add(CONTAINER_MAIN) Me.Controls.Add(CONTAINER_MAIN)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.KeyPreview = True Me.KeyPreview = True
Me.MaximizeBox = False Me.MaximizeBox = False
Me.MaximumSize = New System.Drawing.Size(225, 86) Me.MaximumSize = New System.Drawing.Size(411, 92)
Me.MinimizeBox = False Me.MinimizeBox = False
Me.MinimumSize = New System.Drawing.Size(225, 86) Me.MinimumSize = New System.Drawing.Size(411, 92)
Me.Name = "FDatePickerForm" Me.Name = "FDatePickerForm"
Me.ShowIcon = False Me.ShowIcon = False
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
@@ -73,8 +114,13 @@ Partial Friend Class FDatePickerForm : Inherits System.Windows.Forms.Form
CONTAINER_MAIN.ContentPanel.ResumeLayout(False) CONTAINER_MAIN.ContentPanel.ResumeLayout(False)
CONTAINER_MAIN.ResumeLayout(False) CONTAINER_MAIN.ResumeLayout(False)
CONTAINER_MAIN.PerformLayout() CONTAINER_MAIN.PerformLayout()
TP_MAIN.ResumeLayout(False)
CType(Me.DT_FROM, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.DT_TO, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub
Private WithEvents DT As DateTimePicker
Private WithEvents DT_FROM As PersonalUtilities.Forms.Controls.TextBoxExtended
Private WithEvents DT_TO As PersonalUtilities.Forms.Controls.TextBoxExtended
End Class End Class

View File

@@ -120,4 +120,7 @@
<metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="CONTAINER_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value> <value>False</value>
</metadata> </metadata>
<metadata name="TP_MAIN.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root> </root>

View File

@@ -9,27 +9,28 @@
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Friend Class FDatePickerForm Friend Class FDatePickerForm
Private ReadOnly MyDefs As DefaultFormOptions Private ReadOnly MyDefs As DefaultFormOptions
Friend ReadOnly Property SelectedDate As Date? Friend ReadOnly Property DateFrom As Date?
Get Get
If DT.Checked Then Return DT.Value.Date Else Return Nothing If DT_FROM.Checked Then Return CDate(DT_FROM.Value).Date Else Return Nothing
End Get End Get
End Property End Property
Private ReadOnly _InitialValue As Date? Friend ReadOnly Property DateTo As Date?
Friend Sub New(ByVal d As Date?) Get
If DT_TO.Checked Then Return CDate(DT_TO.Value).Date Else Return Nothing
End Get
End Property
Friend Sub New(ByVal DateFrom As Date?, ByVal DateTo As Date?)
InitializeComponent() InitializeComponent()
_InitialValue = d
MyDefs = New DefaultFormOptions(Me, Settings.Design) MyDefs = New DefaultFormOptions(Me, Settings.Design)
If DateFrom.HasValue Then DT_FROM.Value = DateFrom.Value
If DateTo.HasValue Then DT_TO.Value = DateTo.Value
DT_FROM.Checked = DateFrom.HasValue
DT_TO.Checked = DateTo.HasValue
End Sub End Sub
Private Sub FDatePickerForm_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub FDatePickerForm_Load(sender As Object, e As EventArgs) Handles Me.Load
With MyDefs With MyDefs
.MyViewInitialize(True) .MyViewInitialize(True)
.AddOkCancelToolbar(True) .AddOkCancelToolbar(True)
If _InitialValue.HasValue Then
DT.Checked = True
DT.Value = _InitialValue.Value.Date
Else
DT.Checked = False
End If
.DelegateClosingChecker = False .DelegateClosingChecker = False
.EndLoaderOperations() .EndLoaderOperations()
MyDefs.MyOkCancel.EnableOK = True MyDefs.MyOkCancel.EnableOK = True

View File

@@ -176,9 +176,7 @@ Friend Class ListImagesLoader
Try Try
Dim t As New List(Of Task) Dim t As New List(Of Task)
Dim l As New List(Of UserOption) Dim l As New List(Of UserOption)
For Each u As IUserData In Settings.Users t.AddRange(From u As IUserData In Settings.Users Where u.FitToAddParams Select Task.Run(Sub() l.Add(New UserOption(u, MyList, True))))
If u.FitToAddParams Then t.Add(Task.Run(Sub() l.Add(New UserOption(u, MyList, True))))
Next
If t.Count > 0 Then Task.WaitAll(t.ToArray) If t.Count > 0 Then Task.WaitAll(t.ToArray)
If l.Count > 0 Then If l.Count > 0 Then
For i% = 0 To l.Count - 1 For i% = 0 To l.Count - 1

View File

@@ -40,6 +40,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Me.BTT_DELETE_USER = New System.Windows.Forms.ToolStripButton() Me.BTT_DELETE_USER = New System.Windows.Forms.ToolStripButton()
Me.BTT_REFRESH = New System.Windows.Forms.ToolStripButton() Me.BTT_REFRESH = New System.Windows.Forms.ToolStripButton()
Me.BTT_SHOW_INFO = New System.Windows.Forms.ToolStripButton() Me.BTT_SHOW_INFO = New System.Windows.Forms.ToolStripButton()
Me.BTT_FEED = New System.Windows.Forms.ToolStripButton()
Me.BTT_CHANNELS = New System.Windows.Forms.ToolStripButton() Me.BTT_CHANNELS = New System.Windows.Forms.ToolStripButton()
Me.BTT_DOWN_SAVED = New System.Windows.Forms.ToolStripButton() Me.BTT_DOWN_SAVED = New System.Windows.Forms.ToolStripButton()
Me.BTT_DOWN_SELECTED = New System.Windows.Forms.ToolStripButton() Me.BTT_DOWN_SELECTED = New System.Windows.Forms.ToolStripButton()
@@ -71,7 +72,8 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Me.BTT_SHOW_EXCLUDED_LABELS = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_SHOW_EXCLUDED_LABELS = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_SHOW_EXCLUDED_LABELS_IGNORE = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_SHOW_EXCLUDED_LABELS_IGNORE = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_SHOW_SHOW_GROUPS = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_SHOW_SHOW_GROUPS = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_SHOW_LIMIT_DATES = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_SHOW_LIMIT_DATES_NOT = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_SHOW_LIMIT_DATES_IN = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_LOG = New System.Windows.Forms.ToolStripButton() Me.BTT_LOG = New System.Windows.Forms.ToolStripButton()
Me.BTT_VERSION_INFO = New System.Windows.Forms.ToolStripButton() Me.BTT_VERSION_INFO = New System.Windows.Forms.ToolStripButton()
Me.BTT_DONATE = New System.Windows.Forms.ToolStripButton() Me.BTT_DONATE = New System.Windows.Forms.ToolStripButton()
@@ -88,6 +90,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Me.BTT_CONTEXT_DOWN_DATE_LIMIT = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_DOWN_DATE_LIMIT = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_EDIT = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_EDIT = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_DELETE = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_DELETE = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_COPY_TO_FOLDER = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_FAV = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_FAV = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_TEMP = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_TEMP = New System.Windows.Forms.ToolStripMenuItem()
Me.BTT_CONTEXT_READY = New System.Windows.Forms.ToolStripMenuItem() Me.BTT_CONTEXT_READY = New System.Windows.Forms.ToolStripMenuItem()
@@ -215,11 +218,12 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
' '
'MENU_SETTINGS 'MENU_SETTINGS
' '
Me.MENU_SETTINGS.AutoToolTip = False Me.MENU_SETTINGS.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.MENU_SETTINGS.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {MENU_SETTINGS_SEP_1, Me.BTT_SETTINGS}) Me.MENU_SETTINGS.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {MENU_SETTINGS_SEP_1, Me.BTT_SETTINGS})
Me.MENU_SETTINGS.Image = Global.SCrawler.My.Resources.Resources.SettingsPic_16
Me.MENU_SETTINGS.ImageTransparentColor = System.Drawing.Color.Magenta Me.MENU_SETTINGS.ImageTransparentColor = System.Drawing.Color.Magenta
Me.MENU_SETTINGS.Name = "MENU_SETTINGS" Me.MENU_SETTINGS.Name = "MENU_SETTINGS"
Me.MENU_SETTINGS.Size = New System.Drawing.Size(62, 22) Me.MENU_SETTINGS.Size = New System.Drawing.Size(29, 22)
Me.MENU_SETTINGS.Text = "Settings" Me.MENU_SETTINGS.Text = "Settings"
' '
'BTT_SETTINGS 'BTT_SETTINGS
@@ -232,7 +236,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
'Toolbar_TOP 'Toolbar_TOP
' '
Me.Toolbar_TOP.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden Me.Toolbar_TOP.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
Me.Toolbar_TOP.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MENU_SETTINGS, SEP_1, Me.BTT_ADD_USER, Me.BTT_EDIT_USER, Me.BTT_DELETE_USER, Me.BTT_REFRESH, Me.BTT_SHOW_INFO, Me.BTT_CHANNELS, Me.BTT_DOWN_SAVED, SEP_2, Me.BTT_DOWN_SELECTED, Me.MENU_DOWN_ALL, Me.BTT_DOWN_VIDEO, Me.BTT_DOWN_STOP, SEP_3, Me.MENU_VIEW, SEP_4, Me.BTT_LOG, Me.BTT_VERSION_INFO, Me.BTT_DONATE}) Me.Toolbar_TOP.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MENU_SETTINGS, SEP_1, Me.BTT_ADD_USER, Me.BTT_EDIT_USER, Me.BTT_DELETE_USER, Me.BTT_REFRESH, Me.BTT_SHOW_INFO, Me.BTT_FEED, Me.BTT_CHANNELS, Me.BTT_DOWN_SAVED, SEP_2, Me.BTT_DOWN_SELECTED, Me.MENU_DOWN_ALL, Me.BTT_DOWN_VIDEO, Me.BTT_DOWN_STOP, SEP_3, Me.MENU_VIEW, SEP_4, Me.BTT_LOG, Me.BTT_VERSION_INFO, Me.BTT_DONATE})
Me.Toolbar_TOP.Location = New System.Drawing.Point(0, 0) Me.Toolbar_TOP.Location = New System.Drawing.Point(0, 0)
Me.Toolbar_TOP.Name = "Toolbar_TOP" Me.Toolbar_TOP.Name = "Toolbar_TOP"
Me.Toolbar_TOP.Size = New System.Drawing.Size(934, 25) Me.Toolbar_TOP.Size = New System.Drawing.Size(934, 25)
@@ -267,12 +271,12 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
' '
'BTT_REFRESH 'BTT_REFRESH
' '
Me.BTT_REFRESH.AutoToolTip = False
Me.BTT_REFRESH.Image = Global.SCrawler.My.Resources.Resources.Refresh Me.BTT_REFRESH.Image = Global.SCrawler.My.Resources.Resources.Refresh
Me.BTT_REFRESH.ImageTransparentColor = System.Drawing.Color.Magenta Me.BTT_REFRESH.ImageTransparentColor = System.Drawing.Color.Magenta
Me.BTT_REFRESH.Name = "BTT_REFRESH" Me.BTT_REFRESH.Name = "BTT_REFRESH"
Me.BTT_REFRESH.Size = New System.Drawing.Size(66, 22) Me.BTT_REFRESH.Size = New System.Drawing.Size(66, 22)
Me.BTT_REFRESH.Text = "Refresh" Me.BTT_REFRESH.Text = "Refresh"
Me.BTT_REFRESH.ToolTipText = "Refresh user list"
' '
'BTT_SHOW_INFO 'BTT_SHOW_INFO
' '
@@ -281,7 +285,17 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Me.BTT_SHOW_INFO.Name = "BTT_SHOW_INFO" Me.BTT_SHOW_INFO.Name = "BTT_SHOW_INFO"
Me.BTT_SHOW_INFO.Size = New System.Drawing.Size(48, 22) Me.BTT_SHOW_INFO.Size = New System.Drawing.Size(48, 22)
Me.BTT_SHOW_INFO.Text = "Info" Me.BTT_SHOW_INFO.Text = "Info"
Me.BTT_SHOW_INFO.ToolTipText = "Show download summary" Me.BTT_SHOW_INFO.ToolTipText = "Left-click: open the 'Info' form (show download summary)." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Right click: open the " &
"'Missing' form (show information about missing posts)."
'
'BTT_FEED
'
Me.BTT_FEED.Image = Global.SCrawler.My.Resources.Resources.RSSPic
Me.BTT_FEED.ImageTransparentColor = System.Drawing.Color.Magenta
Me.BTT_FEED.Name = "BTT_FEED"
Me.BTT_FEED.Size = New System.Drawing.Size(52, 22)
Me.BTT_FEED.Text = "Feed"
Me.BTT_FEED.ToolTipText = "Feed of recently downloaded data"
' '
'BTT_CHANNELS 'BTT_CHANNELS
' '
@@ -403,7 +417,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
' '
Me.MENU_VIEW.AutoToolTip = False Me.MENU_VIEW.AutoToolTip = False
Me.MENU_VIEW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text Me.MENU_VIEW.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
Me.MENU_VIEW.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_VIEW_LARGE, Me.BTT_VIEW_SMALL, Me.BTT_VIEW_LIST, Me.BTT_VIEW_DETAILS, MENU_VIEW_SEP_1, Me.BTT_SITE_ALL, Me.BTT_SITE_SPECIFIC, MENU_VIEW_SEP_2, Me.BTT_SHOW_ALL, Me.BTT_SHOW_REGULAR, Me.BTT_SHOW_TEMP, Me.BTT_SHOW_FAV, Me.BTT_SHOW_DELETED, Me.BTT_SHOW_SUSPENDED, Me.BTT_SHOW_LABELS, Me.BTT_SHOW_NO_LABELS, Me.BTT_SHOW_EXCLUDED_LABELS, Me.BTT_SHOW_EXCLUDED_LABELS_IGNORE, Me.BTT_SHOW_SHOW_GROUPS, MENU_VIEW_SEP_3, Me.BTT_SHOW_LIMIT_DATES}) Me.MENU_VIEW.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_VIEW_LARGE, Me.BTT_VIEW_SMALL, Me.BTT_VIEW_LIST, Me.BTT_VIEW_DETAILS, MENU_VIEW_SEP_1, Me.BTT_SITE_ALL, Me.BTT_SITE_SPECIFIC, MENU_VIEW_SEP_2, Me.BTT_SHOW_ALL, Me.BTT_SHOW_REGULAR, Me.BTT_SHOW_TEMP, Me.BTT_SHOW_FAV, Me.BTT_SHOW_DELETED, Me.BTT_SHOW_SUSPENDED, Me.BTT_SHOW_LABELS, Me.BTT_SHOW_NO_LABELS, Me.BTT_SHOW_EXCLUDED_LABELS, Me.BTT_SHOW_EXCLUDED_LABELS_IGNORE, Me.BTT_SHOW_SHOW_GROUPS, MENU_VIEW_SEP_3, Me.BTT_SHOW_LIMIT_DATES_NOT, Me.BTT_SHOW_LIMIT_DATES_IN})
Me.MENU_VIEW.Image = CType(resources.GetObject("MENU_VIEW.Image"), System.Drawing.Image) Me.MENU_VIEW.Image = CType(resources.GetObject("MENU_VIEW.Image"), System.Drawing.Image)
Me.MENU_VIEW.ImageTransparentColor = System.Drawing.Color.Magenta Me.MENU_VIEW.ImageTransparentColor = System.Drawing.Color.Magenta
Me.MENU_VIEW.Name = "MENU_VIEW" Me.MENU_VIEW.Name = "MENU_VIEW"
@@ -516,13 +530,21 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Me.BTT_SHOW_SHOW_GROUPS.Size = New System.Drawing.Size(231, 22) Me.BTT_SHOW_SHOW_GROUPS.Size = New System.Drawing.Size(231, 22)
Me.BTT_SHOW_SHOW_GROUPS.Text = "Show groups instead of labels" Me.BTT_SHOW_SHOW_GROUPS.Text = "Show groups instead of labels"
' '
'BTT_SHOW_LIMIT_DATES 'BTT_SHOW_LIMIT_DATES_NOT
' '
Me.BTT_SHOW_LIMIT_DATES.AutoToolTip = True Me.BTT_SHOW_LIMIT_DATES_NOT.AutoToolTip = True
Me.BTT_SHOW_LIMIT_DATES.Name = "BTT_SHOW_LIMIT_DATES" Me.BTT_SHOW_LIMIT_DATES_NOT.Name = "BTT_SHOW_LIMIT_DATES_NOT"
Me.BTT_SHOW_LIMIT_DATES.Size = New System.Drawing.Size(231, 22) Me.BTT_SHOW_LIMIT_DATES_NOT.Size = New System.Drawing.Size(231, 22)
Me.BTT_SHOW_LIMIT_DATES.Text = "Limit dates" Me.BTT_SHOW_LIMIT_DATES_NOT.Text = "Limit dates (not in range)"
Me.BTT_SHOW_LIMIT_DATES.ToolTipText = "Show profiles that haven't downloaded new data since date..." Me.BTT_SHOW_LIMIT_DATES_NOT.ToolTipText = "Filter users whose last download date is not in the selected date range"
'
'BTT_SHOW_LIMIT_DATES_IN
'
Me.BTT_SHOW_LIMIT_DATES_IN.AutoToolTip = True
Me.BTT_SHOW_LIMIT_DATES_IN.Name = "BTT_SHOW_LIMIT_DATES_IN"
Me.BTT_SHOW_LIMIT_DATES_IN.Size = New System.Drawing.Size(231, 22)
Me.BTT_SHOW_LIMIT_DATES_IN.Text = "Limit dates (in range)"
Me.BTT_SHOW_LIMIT_DATES_IN.ToolTipText = "Filter users whose last download date is in the selected date range"
' '
'BTT_LOG 'BTT_LOG
' '
@@ -609,9 +631,9 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
' '
'USER_CONTEXT 'USER_CONTEXT
' '
Me.USER_CONTEXT.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_CONTEXT_DOWN, Me.BTT_CONTEXT_DOWN_LIMITED, Me.BTT_CONTEXT_DOWN_DATE_LIMIT, Me.BTT_CONTEXT_EDIT, Me.BTT_CONTEXT_DELETE, CONTEXT_SEP_1, Me.BTT_CONTEXT_FAV, Me.BTT_CONTEXT_TEMP, Me.BTT_CONTEXT_READY, Me.BTT_CONTEXT_GROUPS, Me.BTT_CONTEXT_SCRIPT, Me.BTT_CONTEXT_ADD_TO_COL, Me.BTT_CONTEXT_COL_MERGE, Me.BTT_CONTEXT_CHANGE_FOLDER, CONTEXT_SEP_2, Me.BTT_CHANGE_IMAGE, CONTEXT_SEP_3, Me.BTT_CONTEXT_OPEN_PATH, CONTEXT_SEP_4, Me.BTT_CONTEXT_OPEN_SITE, CONTEXT_SEP_5, Me.BTT_CONTEXT_INFO}) Me.USER_CONTEXT.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BTT_CONTEXT_DOWN, Me.BTT_CONTEXT_DOWN_LIMITED, Me.BTT_CONTEXT_DOWN_DATE_LIMIT, Me.BTT_CONTEXT_EDIT, Me.BTT_CONTEXT_DELETE, Me.BTT_CONTEXT_COPY_TO_FOLDER, CONTEXT_SEP_1, Me.BTT_CONTEXT_FAV, Me.BTT_CONTEXT_TEMP, Me.BTT_CONTEXT_READY, Me.BTT_CONTEXT_GROUPS, Me.BTT_CONTEXT_SCRIPT, Me.BTT_CONTEXT_ADD_TO_COL, Me.BTT_CONTEXT_COL_MERGE, Me.BTT_CONTEXT_CHANGE_FOLDER, CONTEXT_SEP_2, Me.BTT_CHANGE_IMAGE, CONTEXT_SEP_3, Me.BTT_CONTEXT_OPEN_PATH, CONTEXT_SEP_4, Me.BTT_CONTEXT_OPEN_SITE, CONTEXT_SEP_5, Me.BTT_CONTEXT_INFO})
Me.USER_CONTEXT.Name = "USER_CONTEXT" Me.USER_CONTEXT.Name = "USER_CONTEXT"
Me.USER_CONTEXT.Size = New System.Drawing.Size(222, 408) Me.USER_CONTEXT.Size = New System.Drawing.Size(222, 452)
' '
'BTT_CONTEXT_DOWN 'BTT_CONTEXT_DOWN
' '
@@ -650,6 +672,13 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Me.BTT_CONTEXT_DELETE.Size = New System.Drawing.Size(221, 22) Me.BTT_CONTEXT_DELETE.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_DELETE.Text = "Delete user / collection" Me.BTT_CONTEXT_DELETE.Text = "Delete user / collection"
' '
'BTT_CONTEXT_COPY_TO_FOLDER
'
Me.BTT_CONTEXT_COPY_TO_FOLDER.Image = Global.SCrawler.My.Resources.Resources.PastePic32
Me.BTT_CONTEXT_COPY_TO_FOLDER.Name = "BTT_CONTEXT_COPY_TO_FOLDER"
Me.BTT_CONTEXT_COPY_TO_FOLDER.Size = New System.Drawing.Size(221, 22)
Me.BTT_CONTEXT_COPY_TO_FOLDER.Text = "Copy data to another folder"
'
'BTT_CONTEXT_FAV 'BTT_CONTEXT_FAV
' '
Me.BTT_CONTEXT_FAV.Image = Global.SCrawler.My.Resources.Resources.StarPic_24 Me.BTT_CONTEXT_FAV.Image = Global.SCrawler.My.Resources.Resources.StarPic_24
@@ -801,7 +830,6 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Private WithEvents BTT_DELETE_USER As ToolStripButton Private WithEvents BTT_DELETE_USER As ToolStripButton
Private WithEvents BTT_DOWN_SELECTED As ToolStripButton Private WithEvents BTT_DOWN_SELECTED As ToolStripButton
Private WithEvents MENU_DOWN_ALL As ToolStripDropDownButton Private WithEvents MENU_DOWN_ALL As ToolStripDropDownButton
Private WithEvents Toolbar_TOP As ToolStrip
Private WithEvents Toolbar_BOTTOM As StatusStrip Private WithEvents Toolbar_BOTTOM As StatusStrip
Private WithEvents PR_MAIN As ToolStripProgressBar Private WithEvents PR_MAIN As ToolStripProgressBar
Private WithEvents LBL_STATUS As ToolStripStatusLabel Private WithEvents LBL_STATUS As ToolStripStatusLabel
@@ -823,7 +851,6 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Private WithEvents LBL_JOBS_COUNT As ToolStripStatusLabel Private WithEvents LBL_JOBS_COUNT As ToolStripStatusLabel
Private WithEvents BTT_DOWN_VIDEO As ToolStripButton Private WithEvents BTT_DOWN_VIDEO As ToolStripButton
Private WithEvents BTT_SHOW_INFO As ToolStripButton Private WithEvents BTT_SHOW_INFO As ToolStripButton
Private WithEvents BTT_LOG As ToolStripButton
Private WithEvents BTT_CHANNELS As ToolStripButton Private WithEvents BTT_CHANNELS As ToolStripButton
Private WithEvents LIST_PROFILES As ListView Private WithEvents LIST_PROFILES As ListView
Private WithEvents MENU_VIEW As ToolStripDropDownButton Private WithEvents MENU_VIEW As ToolStripDropDownButton
@@ -850,7 +877,7 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Private WithEvents BTT_DONATE As ToolStripButton Private WithEvents BTT_DONATE As ToolStripButton
Private WithEvents BTT_SHOW_DELETED As ToolStripMenuItem Private WithEvents BTT_SHOW_DELETED As ToolStripMenuItem
Private WithEvents BTT_SHOW_SUSPENDED As ToolStripMenuItem Private WithEvents BTT_SHOW_SUSPENDED As ToolStripMenuItem
Private WithEvents BTT_SHOW_LIMIT_DATES As ToolStripMenuItem Private WithEvents BTT_SHOW_LIMIT_DATES_NOT As ToolStripMenuItem
Private WithEvents BTT_VIEW_DETAILS As ToolStripMenuItem Private WithEvents BTT_VIEW_DETAILS As ToolStripMenuItem
Private WithEvents COL_DEF As ColumnHeader Private WithEvents COL_DEF As ColumnHeader
Private WithEvents MENU_SETTINGS As ToolStripDropDownButton Private WithEvents MENU_SETTINGS As ToolStripDropDownButton
@@ -869,4 +896,9 @@ Partial Public Class MainFrame : Inherits System.Windows.Forms.Form
Friend WithEvents TRAY_CONTEXT As ContextMenuStrip Friend WithEvents TRAY_CONTEXT As ContextMenuStrip
Private WithEvents BTT_DOWN_AUTOMATION As ToolStripMenuItem Private WithEvents BTT_DOWN_AUTOMATION As ToolStripMenuItem
Private WithEvents BTT_DOWN_AUTOMATION_PAUSE As ToolStripMenuItem Private WithEvents BTT_DOWN_AUTOMATION_PAUSE As ToolStripMenuItem
Friend WithEvents BTT_LOG As ToolStripButton
Friend WithEvents Toolbar_TOP As ToolStrip
Private WithEvents BTT_FEED As ToolStripButton
Private WithEvents BTT_SHOW_LIMIT_DATES_IN As ToolStripMenuItem
Private WithEvents BTT_CONTEXT_COPY_TO_FOLDER As ToolStripMenuItem
End Class End Class

View File

@@ -10,6 +10,7 @@ Imports System.ComponentModel
Imports System.Globalization Imports System.Globalization
Imports System.Threading Imports System.Threading
Imports PersonalUtilities.Forms Imports PersonalUtilities.Forms
Imports PersonalUtilities.Functions.Messaging
Imports SCrawler.API Imports SCrawler.API
Imports SCrawler.API.Base Imports SCrawler.API.Base
Imports SCrawler.Editors Imports SCrawler.Editors
@@ -20,6 +21,8 @@ Public Class MainFrame
Private ReadOnly _VideoDownloadingMode As Boolean = False Private ReadOnly _VideoDownloadingMode As Boolean = False
Private MyChannels As ChannelViewForm Private MyChannels As ChannelViewForm
Private MySavedPosts As DownloadSavedPostsForm Private MySavedPosts As DownloadSavedPostsForm
Private MyMissingPosts As MissingPostsForm
Private MyFeed As DownloadFeedForm
Private _UFinit As Boolean = True Private _UFinit As Boolean = True
Public Sub New() Public Sub New()
InitializeComponent() InitializeComponent()
@@ -43,19 +46,19 @@ Public Class MainFrame
End Sub End Sub
Private Sub MainFrame_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub MainFrame_Load(sender As Object, e As EventArgs) Handles Me.Load
If _VideoDownloadingMode Then GoTo FormClosingInvoker If _VideoDownloadingMode Then GoTo FormClosingInvoker
If Now.Month = 6 Then Text = "SCrawler: Happy LGBT Pride Month! :-)" If Now.Month.ValueBetween(6, 8) Then Text = "SCrawler: Happy LGBT Pride Month! :-)"
Settings.DeleteCachePath() Settings.DeleteCachePath()
MainFrameObj = New MainFrameObjects(Me) MainFrameObj = New MainFrameObjects(Me)
MainFrameObj.ChangeCloseVisible() MainFrameObj.ChangeCloseVisible()
MainProgress = New Toolbars.MyProgress(Toolbar_BOTTOM, PR_MAIN, LBL_STATUS, "Downloading profiles' data") With { MainProgress = New Toolbars.MyProgress(Toolbar_BOTTOM, PR_MAIN, LBL_STATUS, "Downloading profiles' data") With {
.DropCurrentProgressOnTotalChange = False, .Enabled = False} .ResetProgressOnMaximumChanges = False, .Visible = False}
Downloader = New TDownloader Downloader = New TDownloader
InfoForm = New DownloadedInfoForm InfoForm = New DownloadedInfoForm
MyProgressForm = New ActiveDownloadingProgress MyProgressForm = New ActiveDownloadingProgress
Downloader.ReconfPool() Downloader.ReconfPool()
AddHandler Downloader.OnJobsChange, AddressOf Downloader_UpdateJobsCount AddHandler Downloader.JobsChange, AddressOf Downloader_UpdateJobsCount
AddHandler Downloader.OnDownloading, AddressOf Downloader_OnDownloading AddHandler Downloader.Downloading, AddressOf Downloader_Downloading
AddHandler Downloader.OnDownloadCountChange, AddressOf InfoForm.Downloader_OnDownloadCountChange AddHandler Downloader.DownloadCountChange, AddressOf InfoForm.Downloader_DownloadCountChange
AddHandler Downloader.SendNotification, AddressOf NotificationMessage AddHandler Downloader.SendNotification, AddressOf NotificationMessage
AddHandler InfoForm.UserFind, AddressOf FocusUser AddHandler InfoForm.UserFind, AddressOf FocusUser
Settings.LoadUsers() Settings.LoadUsers()
@@ -85,7 +88,10 @@ Public Class MainFrame
CheckVersion(False) CheckVersion(False)
BTT_SITE_ALL.Checked = Settings.SelectedSites.Count = 0 BTT_SITE_ALL.Checked = Settings.SelectedSites.Count = 0
BTT_SITE_SPECIFIC.Checked = Settings.SelectedSites.Count > 0 BTT_SITE_SPECIFIC.Checked = Settings.SelectedSites.Count > 0
BTT_SHOW_LIMIT_DATES.Checked = Settings.LastUpdatedDate.HasValue BTT_SHOW_LIMIT_DATES_NOT.Tag = ShowingDates.Not
BTT_SHOW_LIMIT_DATES_NOT.Checked = Settings.ViewDateMode.Value = ShowingDates.Not
BTT_SHOW_LIMIT_DATES_IN.Tag = ShowingDates.In
BTT_SHOW_LIMIT_DATES_IN.Checked = Settings.ViewDateMode.Value = ShowingDates.In
With Settings.Groups With Settings.Groups
AddHandler .Added, AddressOf GROUPS_Added AddHandler .Added, AddressOf GROUPS_Added
AddHandler .Deleted, AddressOf GROUPS_Deleted AddHandler .Deleted, AddressOf GROUPS_Deleted
@@ -97,7 +103,6 @@ Public Class MainFrame
Settings.Automation = New Scheduler Settings.Automation = New Scheduler
AddHandler Settings.Groups.Updated, AddressOf Settings.Automation.GROUPS_Updated AddHandler Settings.Groups.Updated, AddressOf Settings.Automation.GROUPS_Updated
AddHandler Settings.Groups.Deleted, AddressOf Settings.Automation.GROUPS_Deleted AddHandler Settings.Groups.Deleted, AddressOf Settings.Automation.GROUPS_Deleted
AddHandler Settings.Automation.UserFind, AddressOf FocusUser
_UFinit = False _UFinit = False
Settings.Automation.Start(True) Settings.Automation.Start(True)
GoTo EndFunction GoTo EndFunction
@@ -138,6 +143,8 @@ EndFunction:
Downloader.Dispose() Downloader.Dispose()
MyProgressForm.Dispose() MyProgressForm.Dispose()
InfoForm.Dispose() InfoForm.Dispose()
If Not MyMissingPosts Is Nothing Then MyMissingPosts.Dispose()
If Not MyFeed Is Nothing Then MyFeed.Dispose()
MainFrameObj.ClearNotifications() MainFrameObj.ClearNotifications()
If Not MyChannels Is Nothing Then MyChannels.Dispose() If Not MyChannels Is Nothing Then MyChannels.Dispose()
If Not VideoDownloader Is Nothing Then VideoDownloader.Dispose() If Not VideoDownloader Is Nothing Then VideoDownloader.Dispose()
@@ -272,6 +279,7 @@ CloseResume:
(Not sg = Settings.ShowGroups And .UseGrouping) Then RefillList() (Not sg = Settings.ShowGroups And .UseGrouping) Then RefillList()
TrayIcon.Visible = .CloseToTray TrayIcon.Visible = .CloseToTray
LIST_PROFILES.ShowGroups = .UseGrouping LIST_PROFILES.ShowGroups = .UseGrouping
If f.FeedParametersChanged And Not MyFeed Is Nothing Then MyFeed.UpdateSettings()
End If End If
End Using End Using
End With End With
@@ -335,6 +343,16 @@ CloseResume:
Private Sub BTT_SHOW_INFO_Click(sender As Object, e As EventArgs) Handles BTT_SHOW_INFO.Click Private Sub BTT_SHOW_INFO_Click(sender As Object, e As EventArgs) Handles BTT_SHOW_INFO.Click
ShowInfoForm(True) ShowInfoForm(True)
End Sub End Sub
Private Sub BTT_SHOW_INFO_MouseDown(sender As Object, e As MouseEventArgs) Handles BTT_SHOW_INFO.MouseDown
If e.Button = MouseButtons.Right Then
If MyMissingPosts Is Nothing Then MyMissingPosts = New MissingPostsForm
If MyMissingPosts.Visible Then MyMissingPosts.BringToFront() Else MyMissingPosts.Show()
End If
End Sub
Private Sub BTT_FEED_Click(sender As Object, e As EventArgs) Handles BTT_FEED.Click
If MyFeed Is Nothing Then MyFeed = New DownloadFeedForm : AddHandler Downloader.FeedFilesChanged, AddressOf MyFeed.Downloader_FilesChanged
If MyFeed.Visible Then MyFeed.BringToFront() Else MyFeed.Show()
End Sub
Private Overloads Sub ShowInfoForm() Private Overloads Sub ShowInfoForm()
ShowInfoForm(False) ShowInfoForm(False)
End Sub End Sub
@@ -356,7 +374,7 @@ CloseResume:
Private Sub BTT_DOWN_SAVED_Click(sender As Object, e As EventArgs) Handles BTT_DOWN_SAVED.Click Private Sub BTT_DOWN_SAVED_Click(sender As Object, e As EventArgs) Handles BTT_DOWN_SAVED.Click
If MySavedPosts Is Nothing Then If MySavedPosts Is Nothing Then
MySavedPosts = New DownloadSavedPostsForm MySavedPosts = New DownloadSavedPostsForm
AddHandler MySavedPosts.OnDownloadDone, AddressOf NotificationMessage AddHandler MySavedPosts.DownloadDone, AddressOf NotificationMessage
End If End If
With MySavedPosts With MySavedPosts
If .Visible Then .BringToFront() Else .Show() If .Visible Then .BringToFront() Else .Show()
@@ -581,31 +599,45 @@ CloseResume:
End If End If
End Using End Using
End Function End Function
Private Sub BTT_SHOW_LIMIT_DATES_Click(sender As Object, e As EventArgs) Handles BTT_SHOW_LIMIT_DATES.Click Private Sub BTT_SHOW_LIMIT_DATES_NOT_IN_Click(ByVal Sender As ToolStripMenuItem, ByVal e As EventArgs) Handles BTT_SHOW_LIMIT_DATES_NOT.Click,
BTT_SHOW_LIMIT_DATES_IN.Click
Dim r As Boolean = False Dim r As Boolean = False
Dim snd As Action(Of Date?) = Sub(ByVal d As Date?) Dim UpSettings As Action(Of Date?, Date?, ShowingDates) = Sub(ByVal _from As Date?, ByVal _to As Date?, ByVal Mode As ShowingDates)
With Settings.LastUpdatedDate With Settings
If .HasValue And d.HasValue Then .BeginUpdate()
r = Not .Value.Date = d.Value.Date If Not .ViewDateMode.Value = CInt(Mode) Then r = True
Else .ViewDateMode.Value = CInt(Mode)
r = True If Not Mode = ShowingDates.Off Then
End If If .ViewDateFrom.HasValue And _from.HasValue Then
End With If Not .ViewDateFrom.Value.Date = _from.Value.Date Then r = True
Settings.LastUpdatedDate = d Else
End Sub r = True
Using f As New FDatePickerForm(Settings.LastUpdatedDate) End If
.ViewDateFrom = _from
If .ViewDateTo.HasValue And _to.HasValue Then
If Not .ViewDateTo.Value.Date = _to.Value.Date Then r = True
Else
r = True
End If
.ViewDateTo = _to
End If
.EndUpdate()
End With
End Sub
Using f As New FDatePickerForm(Settings.ViewDateFrom, Settings.ViewDateTo)
f.ShowDialog() f.ShowDialog()
Select Case f.DialogResult Select Case f.DialogResult
Case DialogResult.Abort : snd(Nothing) Case DialogResult.Abort : UpSettings(f.DateFrom, f.DateTo, ShowingDates.Off)
Case DialogResult.OK : snd(f.SelectedDate) Case DialogResult.OK : UpSettings(f.DateFrom, f.DateTo, Sender.Tag)
End Select End Select
End Using End Using
BTT_SHOW_LIMIT_DATES.Checked = Settings.LastUpdatedDate.HasValue BTT_SHOW_LIMIT_DATES_NOT.Checked = Settings.ViewDateMode.Value = ShowingDates.Not
BTT_SHOW_LIMIT_DATES_IN.Checked = Settings.ViewDateMode.Value = ShowingDates.In
If r Then RefillList() If r Then RefillList()
End Sub End Sub
#End Region #End Region
Private Sub BTT_LOG_Click(sender As Object, e As EventArgs) Handles BTT_LOG.Click Private Sub BTT_LOG_Click(sender As Object, e As EventArgs) Handles BTT_LOG.Click
MyMainLOG_ShowForm(Settings.Design) MyMainLOG_ShowForm(Settings.Design,,,, Sub() MainFrameObj.UpdateLogButton())
End Sub End Sub
Private Sub BTT_DONATE_Click(sender As Object, e As EventArgs) Handles BTT_DONATE.Click Private Sub BTT_DONATE_Click(sender As Object, e As EventArgs) Handles BTT_DONATE.Click
Try : Process.Start("https://github.com/AAndyProgram/SCrawler/blob/main/HowToSupport.md") : Catch : End Try Try : Process.Start("https://github.com/AAndyProgram/SCrawler/blob/main/HowToSupport.md") : Catch : End Try
@@ -641,6 +673,9 @@ CloseResume:
Private Sub BTT_CONTEXT_DELETE_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_DELETE.Click Private Sub BTT_CONTEXT_DELETE_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_DELETE.Click
DeleteSelectedUser() DeleteSelectedUser()
End Sub End Sub
Private Sub BTT_CONTEXT_COPY_TO_FOLDER_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_COPY_TO_FOLDER.Click
CopyUserData()
End Sub
Private Sub BTT_CONTEXT_FAV_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_FAV.Click Private Sub BTT_CONTEXT_FAV_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_FAV.Click
Dim users As List(Of IUserData) = GetSelectedUserArray() Dim users As List(Of IUserData) = GetSelectedUserArray()
If AskForMassReplace(users, "Favorite") Then If AskForMassReplace(users, "Favorite") Then
@@ -745,40 +780,83 @@ CloseResume:
End If End If
End Sub End Sub
Private Sub BTT_CONTEXT_ADD_TO_COL_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_ADD_TO_COL.Click Private Sub BTT_CONTEXT_ADD_TO_COL_Click(sender As Object, e As EventArgs) Handles BTT_CONTEXT_ADD_TO_COL.Click
Const MsgTitle$ = "Add users to the collection"
If Settings.CollectionsPath.Value.IsEmptyString Then If Settings.CollectionsPath.Value.IsEmptyString Then
MsgBoxE("Collection path not specified", MsgBoxStyle.Exclamation) MsgBoxE({"Collection path not specified", MsgTitle}, MsgBoxStyle.Exclamation)
Else Else
Dim user As IUserData = GetSelectedUser() Dim users As List(Of IUserData) = GetSelectedUserArray()
If Not user Is Nothing Then If users.ListExists Then
If user.IsCollection Then Dim i%
MsgBoxE("Collection can not be added to collection!", MsgBoxStyle.Critical) Dim _col_user As Predicate(Of IUserData) = Function(u) u.IsCollection
Else Dim userCollection As UserDataBind = users.Find(_col_user)
Using f As New CollectionEditorForm(user.CollectionName) Dim _col_name$ = String.Empty
If Not userCollection Is Nothing Then
i = users.LongCount(Function(u) _col_user(u))
If i > 1 OrElse i = users.Count OrElse
(i = 1 AndAlso
MsgBoxE({$"Do you want to add the following users to the [{userCollection.Name}] collection?" & vbCr &
users.Where(Function(u) Not _col_user(u)).ListToString(vbCr),
MsgTitle}, vbQuestion + vbYesNo) = vbNo) Then _
MsgBoxE({"The collection cannot be added to the collection!", MsgTitle}, MsgBoxStyle.Critical) : Exit Sub
_col_name = userCollection.Name
End If
If _col_name.IsEmptyString Then
Using f As New CollectionEditorForm
f.ShowDialog() f.ShowDialog()
If f.DialogResult = DialogResult.OK Then If f.DialogResult = DialogResult.OK Then _col_name = f.Collection
With Settings
Dim fCol As Predicate(Of IUserData) = Function(u) u.IsCollection And u.CollectionName = f.Collection
Dim i% = .Users.FindIndex(fCol)
Dim Added As Boolean = i < 0
If i < 0 Then
.Users.Add(New UserDataBind(f.Collection))
CollectionHandler(DirectCast(.Users.Last, UserDataBind))
i = .Users.Count - 1
End If
Try
DirectCast(.Users(i), UserDataBind).Add(user)
RemoveUserFromList(user)
i = .Users.FindIndex(fCol)
If i >= 0 Then UserListUpdate(.Users(i), Added)
MsgBoxE($"[{user.Name}] was added to collection [{f.Collection}]")
Catch ex As InvalidOperationException
i = .Users.FindIndex(fCol)
If i >= 0 AndAlso DirectCast(.Users(i), UserDataBind).Count = 0 Then .Users(i).Dispose() : .Users.RemoveAt(i)
End Try
End With
End If
End Using End Using
End If End If
If _col_name.IsEmptyString Then
MsgBoxE({"The destination collection has not been selected.", MsgTitle}, vbExclamation)
Else
With Settings
userCollection = .Users.Find(Function(u) u.IsCollection And u.CollectionName = _col_name)
Dim Added As Boolean = userCollection Is Nothing
If Added Then
.Users.Add(New UserDataBind(_col_name))
MainFrameObj.CollectionHandler(DirectCast(.Users.Last, UserDataBind))
userCollection = .Users.Last
End If
Dim __added_users As New List(Of IUserData)
Dim __added_users_not As New List(Of IUserData)
For Each user As IUserData In users
If Not user.IsCollection Then
Try
userCollection.Add(user)
RemoveUserFromList(user)
UserListUpdate(userCollection, Added)
If Not Added Then FocusUser(userCollection.LVIKey)
Added = False
__added_users.Add(user)
Catch ex As InvalidOperationException
userCollection.Remove(user)
If __added_users.Count > 0 AndAlso __added_users.Contains(user) Then __added_users.Remove(user)
__added_users_not.Add(user)
End Try
End If
Next
If userCollection.Count = 0 Then
RemoveUserFromList(userCollection)
If Settings.Users.Remove(userCollection) Then userCollection.Dispose()
MsgBoxE({$"No users have been added to the [{_col_name}] collection.", MsgTitle}, vbCritical)
ElseIf __added_users.Count = 1 And __added_users_not.Count = 0 Then
MsgBoxE({$"The user [{__added_users(0)}] has been added to the collection [{_col_name}].", MsgTitle})
ElseIf __added_users.Count = 0 And __added_users_not.Count = 1 Then
MsgBoxE({$"The user [{__added_users_not(0)}] was not added to the collection [{_col_name}].", MsgTitle}, vbCritical)
Else
Dim m As New MMessage($"The following users have been added to the [{_col_name}] collection:{vbCr}", MsgTitle,,
If(__added_users_not.Count > 0, vbExclamation, vbInformation))
m.Text &= __added_users.ListToString(vbCr)
If __added_users_not.Count > 0 Then
m.Text &= $"{vbNewLine.StringDup(2)}The following users have not been added to the [{_col_name}] collection:{vbCr}"
m.Text &= __added_users_not.ListToString(vbCr)
End If
MsgBoxE(m)
End If
__added_users.Clear()
__added_users_not.Clear()
End With
End If
End If End If
End If End If
End Sub End Sub
@@ -994,15 +1072,15 @@ CloseResume:
If USER_CONTEXT.Visible Then USER_CONTEXT.Hide() If USER_CONTEXT.Visible Then USER_CONTEXT.Hide()
Dim ugn As Func(Of IUserData, String) = Function(u) $"{IIf(u.IsCollection, "Collection", "User")}: {u.Name}" Dim ugn As Func(Of IUserData, String) = Function(u) $"{IIf(u.IsCollection, "Collection", "User")}: {u.Name}"
Dim m As New MMessage(users.Select(ugn).ListToString(vbNewLine), "Users deleting", Dim m As New MMessage(users.Select(ugn).ListToString(vbNewLine), "Users deleting",
{New Messaging.MsgBoxButton("Delete and ban") With {.ToolTip = "Users and their data will be deleted and added to the blacklist"}, {New MsgBoxButton("Delete and ban") With {.ToolTip = "Users and their data will be deleted and added to the blacklist"},
New Messaging.MsgBoxButton("Delete user only and ban") With { New MsgBoxButton("Delete user only and ban") With {
.ToolTip = "Users will be deleted and added to the blacklist (user data will not be deleted)"}, .ToolTip = "Users will be deleted and added to the blacklist (user data will not be deleted)"},
New Messaging.MsgBoxButton("Delete and ban with reason") With { New MsgBoxButton("Delete and ban with reason") With {
.ToolTip = "Users and their data will be deleted and added to the blacklist with set a reason to delete"}, .ToolTip = "Users and their data will be deleted and added to the blacklist with set a reason to delete"},
New Messaging.MsgBoxButton("Delete user only and ban with reason") With { New MsgBoxButton("Delete user only and ban with reason") With {
.ToolTip = "Users will be deleted and added to the blacklist with set a reason to delete (user data will not be deleted)"}, .ToolTip = "Users will be deleted and added to the blacklist with set a reason to delete (user data will not be deleted)"},
New Messaging.MsgBoxButton("Delete") With {.ToolTip = "Delete users and their data"}, New MsgBoxButton("Delete") With {.ToolTip = "Delete users and their data"},
New Messaging.MsgBoxButton("Delete user only") With {.ToolTip = "Delete users but keep data"}, "Cancel"}, New MsgBoxButton("Delete user only") With {.ToolTip = "Delete users but keep data"}, "Cancel"},
MsgBoxStyle.Exclamation) With {.ButtonsPerRow = 2, .ButtonsPlacing = MMessage.ButtonsPlacings.StartToEnd} MsgBoxStyle.Exclamation) With {.ButtonsPerRow = 2, .ButtonsPlacing = MMessage.ButtonsPlacings.StartToEnd}
m.Text = $"The following users ({users.Count}) will be deleted:{vbNewLine}{m.Text}" m.Text = $"The following users ({users.Count}) will be deleted:{vbNewLine}{m.Text}"
Dim result% = MsgBoxE(m) Dim result% = MsgBoxE(m)
@@ -1063,7 +1141,89 @@ CloseResume:
End If End If
End If End If
Catch ex As Exception Catch ex As Exception
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error on trying to delete user / collection") ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error when trying to delete user / collection")
End Try
End Sub
Private Sub CopyUserData()
Const MsgTitle$ = "Copying user data"
Try
Dim users As List(Of IUserData) = GetSelectedUserArray()
If users.ListExists Then
Dim f As SFile = Settings.LastCopyPath
Dim _select_path As Func(Of Boolean) = Function() As Boolean
f = SFile.SelectPath(f, True)
If f.Exists(SFO.Path, False) Then
Return MsgBoxE({$"Are you sure you want to copy the data to the selected folder?{vbCr}{f}",
MsgTitle}, vbQuestion + vbYesNo) = vbYes
Else
MsgBoxE({$"Destination path not selected.{vbCr}Operation canceled.", MsgTitle}, vbExclamation)
Return False
End If
End Function
If f.Exists(SFO.Path, False) Then
Select Case MsgBoxE({$"Last folder you copied to:{vbCr}{f}" & vbCr &
"Do you want to copy to this folder or choose another destination?", MsgTitle}, vbQuestion,,,
{New MsgBoxButton("Process") With {.ToolTip = "Use last folder"},
New MsgBoxButton("Choose new") With {.ToolTip = "Choose a new destination"},
New MsgBoxButton("Cancel")})
Case 1 : If Not _select_path.Invoke Then Exit Sub
Case 2 : MsgBoxE({"Operation canceled", MsgTitle}) : Exit Sub
End Select
Else
If Not _select_path.Invoke Then Exit Sub
End If
If f.Exists(SFO.Path, False) Then
Settings.LastCopyPath.Value = f
Using logger As New TextSaver With {.LogMode = True}
Dim m As New MMessage("", MsgTitle,,, {logger})
Dim err As New ErrorsDescriber(EDP.SendInLog) With {.DeclaredMessage = m}
Dim __copied_users As New List(Of IUserData)
Dim __copied_users_not As New List(Of IUserData)
For Each user As IUserData In users
If user.CopyFiles(f, err) Then
__copied_users.Add(user)
Else
__copied_users_not.Add(user)
End If
Next
err = Nothing
Dim buttons As New List(Of MsgBoxButton) From {New MsgBoxButton("OK")}
If __copied_users_not.Count > 0 Then
err = New ErrorsDescriber(EDP.ShowAllMsg)
m.Style = If(__copied_users.Count > 0, vbExclamation, vbCritical)
If Not logger.IsEmptyString Then
m.DefaultButton = 0
m.CancelButton = 0
buttons.Add(New MsgBoxButton("Show LOG") With {
.IsDialogResultButton = False,
.BackColor = MyColor.DeleteBack,
.ForeColor = MyColor.DeleteFore,
.KeyCode = Keys.F1,
.ToolTip = "Show error log",
.CallBack = Sub(r, mm, b)
Using ff As New LOG_FORM(logger) : ff.ShowDialog() : End Using
End Sub})
End If
End If
m.Buttons = buttons
If __copied_users_not.Count = 0 Then
m.Text = "All users are copied."
ElseIf __copied_users.Count = 0 And __copied_users_not.Count > 0 Then
m.Text = "No users have been copied."
Else
m.Text = $"The following users have been copied:{vbNewLine}"
m.Text &= __copied_users.ListToString(vbNewLine)
If __copied_users_not.Count > 0 Then
m.Text = $"{vbNewLine.StringDup(2)}The following users have not been copied:{vbNewLine}"
m.Text &= __copied_users_not.ListToString(vbNewLine)
End If
End If
MsgBoxE(m,, err)
End Using
End If
End If
Catch ex As Exception
ErrorsDescriber.Execute(EDP.LogMessageValue, ex, "Error when trying to copy data")
End Try End Try
End Sub End Sub
Friend Sub UserRemovedFromCollection(ByVal User As IUserData) Friend Sub UserRemovedFromCollection(ByVal User As IUserData)
@@ -1076,22 +1236,25 @@ CloseResume:
End Sub End Sub
Private Enum DownUserLimits : None : Number : [Date] : End Enum Private Enum DownUserLimits : None : Number : [Date] : End Enum
Private Sub DownloadSelectedUser(ByVal UseLimits As DownUserLimits) Private Sub DownloadSelectedUser(ByVal UseLimits As DownUserLimits)
Const MsgTitle$ = "Download limit"
Dim users As List(Of IUserData) = GetSelectedUserArray() Dim users As List(Of IUserData) = GetSelectedUserArray()
If users.ListExists Then If users.ListExists Then
Dim l%? = Nothing Dim limit%? = Nothing
Dim d As Date? = Nothing Dim _from As Date? = Nothing
Dim _to As Date? = Nothing
Dim _fromStr$, _toStr$
If UseLimits = DownUserLimits.Number Then If UseLimits = DownUserLimits.Number Then
Do Do
l = AConvert(Of Integer)(InputBoxE("Enter top posts limit for downloading:", "Download limit", 10), AModes.Var, Nothing) limit = AConvert(Of Integer)(InputBoxE("Enter top posts limit for downloading:", MsgTitle, 10), AModes.Var, Nothing)
If l.HasValue Then If limit.HasValue Then
Select Case MsgBoxE(New MMessage($"You are set up downloading top [{l.Value}] posts", "Download limit", Select Case MsgBoxE(New MMessage($"You are set up downloading top [{limit.Value}] posts", MsgTitle,
{"Confirm", "Try again", "Disable limit", "Cancel"}) With {.ButtonsPerRow = 2}).Index {"Confirm", "Try again", "Disable limit", "Cancel"}) With {.ButtonsPerRow = 2}).Index
Case 0 : Exit Do Case 0 : Exit Do
Case 2 : l = Nothing : Exit Do Case 2 : limit = Nothing : Exit Do
Case 3 : GoTo CancelDownloadingOperation Case 3 : GoTo CancelDownloadingOperation
End Select End Select
Else Else
Select Case MsgBoxE({"You are not set up downloading limit", "Download limit"},,,, {"Confirm", "Try again", "Cancel"}).Index Select Case MsgBoxE({"You are not set up downloading limit", MsgTitle},,,, {"Confirm", "Try again", "Cancel"}).Index
Case 0 : Exit Do Case 0 : Exit Do
Case 2 : GoTo CancelDownloadingOperation Case 2 : GoTo CancelDownloadingOperation
End Select End Select
@@ -1099,24 +1262,30 @@ CloseResume:
Loop Loop
ElseIf UseLimits = DownUserLimits.Date Then ElseIf UseLimits = DownUserLimits.Date Then
Do Do
Using fd As New FDatePickerForm(Nothing) Using fd As New FDatePickerForm(Nothing, Nothing)
fd.ShowDialog() fd.ShowDialog()
If fd.DialogResult = DialogResult.OK Then If fd.DialogResult = DialogResult.OK Then
d = fd.SelectedDate _from = fd.DateFrom
_to = fd.DateTo
ElseIf fd.DialogResult = DialogResult.Abort Then ElseIf fd.DialogResult = DialogResult.Abort Then
d = Nothing _from = Nothing
_to = Nothing
End If End If
End Using End Using
If d.HasValue Then If _from.HasValue Or _to.HasValue Then
Select Case MsgBoxE(New MMessage($"You are set up downloading posts until [{d.Value.Date.ToStringDate(ADateTime.Formats.BaseDate)}]", _fromStr = AConvert(Of String)(_from, ADateTime.Formats.BaseDate, String.Empty)
"Download limit", _toStr = AConvert(Of String)(_to, ADateTime.Formats.BaseDate, String.Empty)
{"Confirm", "Try again", "Disable limit", "Cancel"}) With {.ButtonsPerRow = 2}).Index If Not _fromStr.IsEmptyString Then _fromStr = $"FROM [{_fromStr}]"
If Not _toStr.IsEmptyString Then _toStr = $"TO [{_toStr}]"
If Not _toStr.IsEmptyString And Not _fromStr.IsEmptyString Then _fromStr &= " "
Select Case MsgBoxE(New MMessage($"You have set a date limit for downloading posts: {_fromStr}{_toStr}", MsgTitle,
{"Confirm", "Try again", "Disable limit", "Cancel"}) With {.ButtonsPerRow = 2}).Index
Case 0 : Exit Do Case 0 : Exit Do
Case 2 : d = Nothing : Exit Do Case 2 : _from = Nothing : _to = Nothing : Exit Do
Case 3 : GoTo CancelDownloadingOperation Case 3 : GoTo CancelDownloadingOperation
End Select End Select
Else Else
Select Case MsgBoxE({"You are not set up a date limit", "Download limit"},,,, {"Confirm", "Try again", "Cancel"}).Index Select Case MsgBoxE({"You have not set a date limit", MsgTitle},,,, {"Confirm", "Try again", "Cancel"}).Index
Case 0 : Exit Do Case 0 : Exit Do
Case 2 : GoTo CancelDownloadingOperation Case 2 : GoTo CancelDownloadingOperation
End Select End Select
@@ -1130,18 +1299,17 @@ CancelDownloadingOperation:
MsgBoxE("Operation canceled") MsgBoxE("Operation canceled")
Exit Sub Exit Sub
ResumeDownloadingOperation: ResumeDownloadingOperation:
If users.Count = 1 Then Dim uStr$ = If(users.Count = 1, String.Empty, users.Select(Function(u) u.ToString()).ListToString(vbNewLine))
users(0).DownloadTopCount = l If users.Count = 1 OrElse MsgBoxE({$"You have selected {users.Count} user profiles" & vbCr &
users(0).DownloadToDate = d $"Do you want to download them all?{vbNewLine.StringDup(2)}" &
Downloader.Add(users(0)) $"Selected users:{vbNewLine}{uStr}", "Multiple users selected"},
Else MsgBoxStyle.Question + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Dim uStr$ = users.Select(Function(u) u.ToString()).ListToString(vbNewLine) users.ForEach(Sub(u)
If MsgBoxE({$"You are select {users.Count} users' profiles{vbNewLine}Do you want to download all of them?{vbNewLine.StringDup(2)}" & u.DownloadTopCount = limit
$"Selected users:{vbNewLine}{uStr}", "A few users selected"}, u.DownloadDateFrom = _from
MsgBoxStyle.Question + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then u.DownloadDateTo = _to
users.ForEach(Sub(u) u.DownloadTopCount = l) End Sub)
Downloader.AddRange(users) Downloader.AddRange(users)
End If
End If End If
End If End If
End Sub End Sub
@@ -1153,14 +1321,14 @@ ResumeDownloadingOperation:
Private Overloads Sub FocusUser(ByVal Key As String) Private Overloads Sub FocusUser(ByVal Key As String)
FocusUser(Key, True) FocusUser(Key, True)
End Sub End Sub
Private Overloads Sub FocusUser(ByVal Key As String, Optional ByVal ActivateMe As Boolean = False) Friend Overloads Sub FocusUser(ByVal Key As String, Optional ByVal ActivateMe As Boolean = False)
Dim a As Action = Sub() Dim a As Action = Sub()
Dim i% = LIST_PROFILES.Items.IndexOfKey(Key) Dim i% = LIST_PROFILES.Items.IndexOfKey(Key)
If i < 0 Then If i < 0 Then
i = Settings.Users.FindIndex(Function(u) u.Key = Key) Dim u As IUserData = Settings.GetUser(Key, True)
If i >= 0 Then If Not u Is Nothing Then
UserListUpdate(Settings.Users(i), True) UserListUpdate(u, True)
i = LIST_PROFILES.Items.IndexOfKey(Key) i = LIST_PROFILES.Items.IndexOfKey(u.Key)
End If End If
End If End If
If i >= 0 Then If i >= 0 Then
@@ -1183,16 +1351,14 @@ ResumeDownloadingOperation:
Dim a As Action = Sub() LBL_JOBS_COUNT.Text = IIf(TotalCount = 0, String.Empty, $"[Jobs {TotalCount}]") Dim a As Action = Sub() LBL_JOBS_COUNT.Text = IIf(TotalCount = 0, String.Empty, $"[Jobs {TotalCount}]")
If Toolbar_BOTTOM.InvokeRequired Then Toolbar_BOTTOM.Invoke(a) Else a.Invoke If Toolbar_BOTTOM.InvokeRequired Then Toolbar_BOTTOM.Invoke(a) Else a.Invoke
If Not _LogColorChanged AndAlso Not MyMainLOG.IsEmptyString Then If Not _LogColorChanged AndAlso Not MyMainLOG.IsEmptyString Then
a = Sub() BTT_LOG.ControlChangeColor(False) MainFrameObj.UpdateLogButton()
If Toolbar_TOP.InvokeRequired Then Toolbar_TOP.Invoke(a) Else a.Invoke
_LogColorChanged = True _LogColorChanged = True
ElseIf _LogColorChanged And MyMainLOG.IsEmptyString Then ElseIf _LogColorChanged And MyMainLOG.IsEmptyString Then
a = Sub() BTT_LOG.ControlChangeColor(SystemColors.Control, SystemColors.ControlText) MainFrameObj.UpdateLogButton()
If Toolbar_TOP.InvokeRequired Then Toolbar_TOP.Invoke(a) Else a.Invoke
_LogColorChanged = False _LogColorChanged = False
End If End If
End Sub End Sub
Private Sub Downloader_OnDownloading(ByVal Value As Boolean) Private Sub Downloader_Downloading(ByVal Value As Boolean)
Dim a As Action = Sub() BTT_DOWN_STOP.Enabled = Value Or Downloader.Working Dim a As Action = Sub() BTT_DOWN_STOP.Enabled = Value Or Downloader.Working
If Toolbar_TOP.InvokeRequired Then Toolbar_TOP.Invoke(a) Else a.Invoke If Toolbar_TOP.InvokeRequired Then Toolbar_TOP.Invoke(a) Else a.Invoke
End Sub End Sub

View File

@@ -16,6 +16,12 @@ Friend Class MainFrameObjects
MF = f MF = f
Notificator = New NotificationsManager Notificator = New NotificationsManager
End Sub End Sub
#Region "Users"
Friend Sub FocusUser(ByVal Key As String, Optional ByVal ActivateForm As Boolean = False)
MF.FocusUser(Key, ActivateForm)
End Sub
#End Region
#Region "Image handlers"
Friend Sub ImageHandler(ByVal User As IUserData) Friend Sub ImageHandler(ByVal User As IUserData)
ImageHandler(User, False) ImageHandler(User, False)
ImageHandler(User, True) ImageHandler(User, True)
@@ -37,6 +43,8 @@ Friend Class MainFrameObjects
Catch Catch
End Try End Try
End Sub End Sub
#End Region
#Region "Form functions"
Friend Sub Focus(Optional ByVal Show As Boolean = False) Friend Sub Focus(Optional ByVal Show As Boolean = False)
If Not MF.Visible And Show Then MF.Show() If Not MF.Visible And Show Then MF.Show()
If MF.Visible Then MF.BringToFront() : MF.Activate() If MF.Visible Then MF.BringToFront() : MF.Activate()
@@ -45,6 +53,11 @@ Friend Class MainFrameObjects
Dim a As Action = Sub() MF.BTT_TRAY_CLOSE_NO_SCRIPT.Visible = Settings.ClosingCommand.Attribute And Not Settings.ClosingCommand.IsEmptyString Dim a As Action = Sub() MF.BTT_TRAY_CLOSE_NO_SCRIPT.Visible = Settings.ClosingCommand.Attribute And Not Settings.ClosingCommand.IsEmptyString
If MF.TRAY_CONTEXT.InvokeRequired Then MF.TRAY_CONTEXT.Invoke(a) Else a.Invoke If MF.TRAY_CONTEXT.InvokeRequired Then MF.TRAY_CONTEXT.Invoke(a) Else a.Invoke
End Sub End Sub
Friend Sub UpdateLogButton()
MyMainLOG_UpdateLogButton(MF.BTT_LOG, MF.Toolbar_TOP)
End Sub
#End Region
#Region "Notifications"
Friend Overloads Sub ShowNotification(ByVal Message As String) Friend Overloads Sub ShowNotification(ByVal Message As String)
MF.TrayIcon.ShowBalloonTip(2000, MF.TrayIcon.BalloonTipTitle, Message, ToolTipIcon.Info) MF.TrayIcon.ShowBalloonTip(2000, MF.TrayIcon.BalloonTipTitle, Message, ToolTipIcon.Info)
End Sub End Sub
@@ -63,4 +76,5 @@ Friend Class MainFrameObjects
Focus() Focus()
End If End If
End Sub End Sub
#End Region
End Class End Class

View File

@@ -83,6 +83,11 @@ Friend Module MainMod
Deleted = 10000 Deleted = 10000
Suspended = 12000 Suspended = 12000
End Enum End Enum
Friend Enum ShowingDates As Integer
[Off] = 0
[Not] = 1
[In] = 2
End Enum
Friend Enum FileNameReplaceMode As Integer Friend Enum FileNameReplaceMode As Integer
None = 0 None = 0
Replace = 1 Replace = 1
@@ -95,6 +100,7 @@ Friend Module MainMod
Friend MyProgressForm As ActiveDownloadingProgress Friend MyProgressForm As ActiveDownloadingProgress
Friend MainFrameObj As MainFrameObjects Friend MainFrameObj As MainFrameObjects
Friend ReadOnly ParsersDataDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime) Friend ReadOnly ParsersDataDateProvider As New ADateTime(ADateTime.Formats.BaseDateTime)
Friend ReadOnly FeedVideoLengthProvider As New ADateTime("hh\:mm\:ss") With {.TimeParseMode = ADateTime.TimeModes.TimeSpan}
Friend ReadOnly LogConnector As New LogHost Friend ReadOnly LogConnector As New LogHost
#Region "File name operations" #Region "File name operations"
Friend FileDateAppenderProvider As IFormatProvider Friend FileDateAppenderProvider As IFormatProvider
@@ -136,18 +142,6 @@ Friend Module MainMod
Return $"{If(Host?.Name, String.Empty)}{Opt}" Return $"{If(Host?.Name, String.Empty)}{Opt}"
End If End If
End Function End Function
#Region "Image Handlers management"
Friend Sub ImageHandler(ByVal User As IUserData)
ImageHandler(User, False)
ImageHandler(User, True)
End Sub
Friend Sub ImageHandler(ByVal User As IUserData, ByVal Add As Boolean)
MainFrameObj.ImageHandler(User, Add)
End Sub
Friend Sub CollectionHandler(ByVal [Collection] As UserDataBind)
MainFrameObj.CollectionHandler(Collection)
End Sub
#End Region
#Region "Standalone video download functions" #Region "Standalone video download functions"
Friend Function GetCurrentBuffer() As String Friend Function GetCurrentBuffer() As String
Dim b$ = BufferText Dim b$ = BufferText

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2022.8.28.0")> <Assembly: AssemblyVersion("2022.9.24.0")>
<Assembly: AssemblyFileVersion("2022.8.28.0")> <Assembly: AssemblyFileVersion("2022.9.24.0")>
<Assembly: NeutralResourcesLanguage("en")> <Assembly: NeutralResourcesLanguage("en")>

View File

@@ -170,6 +170,16 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property PastePic32() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("PastePic32", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap. ''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary> '''</summary>
@@ -260,6 +270,26 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
'''</summary>
Friend ReadOnly Property RedGifsIcon() As System.Drawing.Icon
Get
Dim obj As Object = ResourceManager.GetObject("RedGifsIcon", resourceCulture)
Return CType(obj,System.Drawing.Icon)
End Get
End Property
'''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property RedGifsPic32() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("RedGifsPic32", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap. ''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary> '''</summary>
@@ -270,22 +300,12 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
'''</summary>
Friend ReadOnly Property RegGifsIcon() As System.Drawing.Icon
Get
Dim obj As Object = ResourceManager.GetObject("RegGifsIcon", resourceCulture)
Return CType(obj,System.Drawing.Icon)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap. ''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary> '''</summary>
Friend ReadOnly Property RegGifsPic32() As System.Drawing.Bitmap Friend ReadOnly Property RSSPic() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("RegGifsPic32", resourceCulture) Dim obj As Object = ResourceManager.GetObject("RSSPic", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj,System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -300,6 +320,16 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
'''</summary>
Friend ReadOnly Property SettingsIcon() As System.Drawing.Icon
Get
Dim obj As Object = ResourceManager.GetObject("SettingsIcon", resourceCulture)
Return CType(obj,System.Drawing.Icon)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap. ''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary> '''</summary>
@@ -330,6 +360,16 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized resource of type System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property StopPic32() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("StopPic32", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized resource of type System.Drawing.Icon similar to (Icon). ''' Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
'''</summary> '''</summary>

View File

@@ -199,10 +199,22 @@
<data name="Pause_Blue_16" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Pause_Blue_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Content\Pictures\Pause_Blue_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Content\Pictures\Pause_Blue_16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="RegGifsIcon" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="SettingsIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Content\Icons\RegGifsIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Content\Icons\SettingsIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="RegGifsPic32" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="RedGifsIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Content\Pictures\RegGifsPic32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Content\Icons\RedGifsIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RedGifsPic32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Content\Pictures\RedGifsPic32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RSSPic" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Content\Pictures\RSSPic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="StopPic32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Content\Pictures\StopPic32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="PastePic32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Content\Pictures\PastePic32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
</root> </root>

View File

@@ -79,10 +79,13 @@ Namespace Plugin.Hosts
End Property End Property
Friend ReadOnly Property HasSpecialOptions As Boolean = False Friend ReadOnly Property HasSpecialOptions As Boolean = False
Private ReadOnly _ResponserGetMethod As MethodInfo Private ReadOnly _ResponserGetMethod As MethodInfo
Private ReadOnly _ResponserIsContainer As Boolean = False
Friend ReadOnly Property Responser As Response Friend ReadOnly Property Responser As Response
Get Get
If Not _ResponserGetMethod Is Nothing Then If Not _ResponserGetMethod Is Nothing Then
Return _ResponserGetMethod.Invoke(Source, Nothing) Return _ResponserGetMethod.Invoke(Source, Nothing)
ElseIf _ResponserIsContainer Then
Return DirectCast(Source, IResponserContainer).Responser
Else Else
Return Nothing Return Nothing
End If End If
@@ -90,6 +93,7 @@ Namespace Plugin.Hosts
End Property End Property
#End Region #End Region
#Region "Base properties compatibility" #Region "Base properties compatibility"
Friend ReadOnly Property DownloadSiteData As XMLValue(Of Boolean)
Friend ReadOnly Property Temporary As XMLValue(Of Boolean) Friend ReadOnly Property Temporary As XMLValue(Of Boolean)
Friend ReadOnly Property DownloadImages As XMLValue(Of Boolean) Friend ReadOnly Property DownloadImages As XMLValue(Of Boolean)
Friend ReadOnly Property DownloadVideos As XMLValue(Of Boolean) Friend ReadOnly Property DownloadVideos As XMLValue(Of Boolean)
@@ -176,6 +180,7 @@ Namespace Plugin.Hosts
Dim n() As String = {SettingsCLS.Name_Node_Sites, Name} Dim n() As String = {SettingsCLS.Name_Node_Sites, Name}
If If(_XML(n)?.Count, 0) > 0 Then Source.Load(ToKeyValuePair(Of String, EContainer)(_XML(n))) If If(_XML(n)?.Count, 0) > 0 Then Source.Load(ToKeyValuePair(Of String, EContainer)(_XML(n)))
Dim Members As IEnumerable(Of MemberInfo) = Plugin.GetType.GetTypeInfo.DeclaredMembers Dim Members As IEnumerable(Of MemberInfo) = Plugin.GetType.GetTypeInfo.DeclaredMembers
_ResponserIsContainer = TypeOf Plugin Is IResponserContainer
If Members.ListExists Then If Members.ListExists Then
Dim Updaters As New List(Of MemberInfo) Dim Updaters As New List(Of MemberInfo)
Dim Providers As New List(Of MemberInfo) Dim Providers As New List(Of MemberInfo)
@@ -259,6 +264,8 @@ Namespace Plugin.Hosts
DownloadVideos.SetExtended("DownloadVideos", True, _XML, n) DownloadVideos.SetExtended("DownloadVideos", True, _XML, n)
DownloadVideos.SetDefault(_Vids) DownloadVideos.SetDefault(_Vids)
DownloadSiteData = New XMLValue(Of Boolean)("DownloadSiteData", True, _XML, n)
GetUserMediaOnly = New XMLValue(Of Boolean)("GetUserMediaOnly", True, _XML, n) GetUserMediaOnly = New XMLValue(Of Boolean)("GetUserMediaOnly", True, _XML, n)
If PropList.Count > 0 Then If PropList.Count > 0 Then
Dim MaxOffset% = Math.Max(PropList.Max(Function(pp) pp.LeftOffset), PropertyValueHost.LeftOffsetDefault) Dim MaxOffset% = Math.Max(PropList.Max(Function(pp) pp.LeftOffset), PropertyValueHost.LeftOffsetDefault)
@@ -307,15 +314,22 @@ Namespace Plugin.Hosts
Throw New ArgumentNullException("IPluginContentProvider", $"Plugin [{Key}] does not provide user instance") Throw New ArgumentNullException("IPluginContentProvider", $"Plugin [{Key}] does not provide user instance")
End If End If
End Function End Function
Friend Function GetUserPostUrl(ByVal UserID As String, ByVal PostID As String) As String
Return Source.GetUserPostUrl(UserID, PostID)
End Function
Private _AvailableValue As Boolean = True Private _AvailableValue As Boolean = True
Private _AvailableAsked As Boolean = False Private _AvailableAsked As Boolean = False
Private _ActiveTaskCount As Integer = 0 Private _ActiveTaskCount As Integer = 0
Friend Function Available(ByVal What As Download, ByVal Silent As Boolean) As Boolean Friend Function Available(ByVal What As Download, ByVal Silent As Boolean) As Boolean
If Not _AvailableAsked Then If DownloadSiteData Then
_AvailableValue = Source.Available(What, Silent) If Not _AvailableAsked Then
_AvailableAsked = True _AvailableValue = Source.Available(What, Silent)
_AvailableAsked = True
End If
Return _AvailableValue
Else
Return False
End If End If
Return _AvailableValue
End Function End Function
Friend Sub DownloadStarted(ByVal What As Download) Friend Sub DownloadStarted(ByVal What As Download)
_ActiveTaskCount += 1 _ActiveTaskCount += 1

View File

@@ -53,7 +53,8 @@ Namespace Plugin.Hosts
.SeparateVideoFolder = SeparateVideoFolderF .SeparateVideoFolder = SeparateVideoFolderF
.DataPath = MyFile.CutPath.PathNoSeparator .DataPath = MyFile.CutPath.PathNoSeparator
.PostsNumberLimit = DownloadTopCount .PostsNumberLimit = DownloadTopCount
.PostsDateLimit = DownloadToDate .DownloadDateFrom = DownloadDateFrom
.DownloadDateTo = DownloadDateTo
.ExistingContentList = New List(Of PluginUserMedia) .ExistingContentList = New List(Of PluginUserMedia)
.TempMediaList = New List(Of PluginUserMedia) .TempMediaList = New List(Of PluginUserMedia)
@@ -74,8 +75,6 @@ Namespace Plugin.Hosts
UserSuspended = .UserSuspended UserSuspended = .UserSuspended
End With End With
End Sub End Sub
Protected Overrides Sub ReparseVideo(ByVal Token As CancellationToken)
End Sub
Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken) Protected Overrides Sub DownloadContent(ByVal Token As CancellationToken)
If UseInternalDownloader Then If UseInternalDownloader Then
DownloadContentDefault(Token) DownloadContentDefault(Token)
@@ -105,7 +104,7 @@ Namespace Plugin.Hosts
Progress.Perform(Count) Progress.Perform(Count)
End Sub End Sub
Private Sub ExternalPlugin_TotalCountChanged(ByVal Count As Integer) Private Sub ExternalPlugin_TotalCountChanged(ByVal Count As Integer)
Progress.TotalCount += Count Progress.Maximum += Count
End Sub End Sub
Protected Overrides Sub Dispose(ByVal disposing As Boolean) Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing And Not disposedValue Then If disposing And Not disposedValue Then

View File

@@ -29,6 +29,8 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetPlatformVersion>10.0</TargetPlatformVersion> <TargetPlatformVersion>10.0</TargetPlatformVersion>
@@ -111,10 +113,29 @@
<ApplicationManifest>My Project\app.manifest</ApplicationManifest> <ApplicationManifest>My Project\app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="LibVLCSharp, Version=3.6.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LibVLCSharp.3.6.6\lib\net40\LibVLCSharp.dll</HintPath>
</Reference>
<Reference Include="LibVLCSharp.WinForms, Version=3.6.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\LibVLCSharp.WinForms.3.6.6\lib\net40\LibVLCSharp.WinForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Deployment" /> <Reference Include="System.Deployment" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Net" />
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@@ -169,6 +190,24 @@
<Compile Include="Download\AutoDownloaderEditorForm.vb"> <Compile Include="Download\AutoDownloaderEditorForm.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Download\DownloadFeedForm.Designer.vb">
<DependentUpon>DownloadFeedForm.vb</DependentUpon>
</Compile>
<Compile Include="Download\DownloadFeedForm.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Download\FeedMedia.Designer.vb">
<DependentUpon>FeedMedia.vb</DependentUpon>
</Compile>
<Compile Include="Download\FeedMedia.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Download\FeedVideo.Designer.vb">
<DependentUpon>FeedVideo.vb</DependentUpon>
</Compile>
<Compile Include="Download\FeedVideo.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Download\Groups\DownloadGroup.vb" /> <Compile Include="Download\Groups\DownloadGroup.vb" />
<Compile Include="Download\DownloadProgress.vb" /> <Compile Include="Download\DownloadProgress.vb" />
<Compile Include="Download\Groups\DownloadGroupCollection.vb" /> <Compile Include="Download\Groups\DownloadGroupCollection.vb" />
@@ -182,6 +221,12 @@
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Download\Groups\GroupParameters.vb" /> <Compile Include="Download\Groups\GroupParameters.vb" />
<Compile Include="Download\MissingPostsForm.Designer.vb">
<DependentUpon>MissingPostsForm.vb</DependentUpon>
</Compile>
<Compile Include="Download\MissingPostsForm.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Download\Scheduler.vb" /> <Compile Include="Download\Scheduler.vb" />
<Compile Include="Download\SchedulerEditorForm.Designer.vb"> <Compile Include="Download\SchedulerEditorForm.Designer.vb">
<DependentUpon>SchedulerEditorForm.vb</DependentUpon> <DependentUpon>SchedulerEditorForm.vb</DependentUpon>
@@ -189,7 +234,13 @@
<Compile Include="Download\SchedulerEditorForm.vb"> <Compile Include="Download\SchedulerEditorForm.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="EncryptCookies.vb" />
<Compile Include="MainFrameObjects.vb" /> <Compile Include="MainFrameObjects.vb" />
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="PluginsEnvironment\Hosts\UserDataHost.vb" /> <Compile Include="PluginsEnvironment\Hosts\UserDataHost.vb" />
<Compile Include="API\Base\UserDataBase.vb" /> <Compile Include="API\Base\UserDataBase.vb" />
<Compile Include="API\Gfycat\Envir.vb" /> <Compile Include="API\Gfycat\Envir.vb" />
@@ -295,11 +346,6 @@
<DependentUpon>Application.myapp</DependentUpon> <DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb"> <Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
@@ -344,12 +390,24 @@
<EmbeddedResource Include="Download\ActiveDownloadingProgress.resx"> <EmbeddedResource Include="Download\ActiveDownloadingProgress.resx">
<DependentUpon>ActiveDownloadingProgress.vb</DependentUpon> <DependentUpon>ActiveDownloadingProgress.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Download\DownloadFeedForm.resx">
<DependentUpon>DownloadFeedForm.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Download\DownloadSavedPostsForm.resx"> <EmbeddedResource Include="Download\DownloadSavedPostsForm.resx">
<DependentUpon>DownloadSavedPostsForm.vb</DependentUpon> <DependentUpon>DownloadSavedPostsForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Download\FeedMedia.resx">
<DependentUpon>FeedMedia.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Download\FeedVideo.resx">
<DependentUpon>FeedVideo.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Download\Groups\GroupEditorForm.resx"> <EmbeddedResource Include="Download\Groups\GroupEditorForm.resx">
<DependentUpon>GroupEditorForm.vb</DependentUpon> <DependentUpon>GroupEditorForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Download\MissingPostsForm.resx">
<DependentUpon>MissingPostsForm.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Download\SchedulerEditorForm.resx"> <EmbeddedResource Include="Download\SchedulerEditorForm.resx">
<DependentUpon>SchedulerEditorForm.vb</DependentUpon> <DependentUpon>SchedulerEditorForm.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -379,9 +437,9 @@
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx"> <EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator> <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace> <CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType> <SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Download\VideosDownloaderForm.resx"> <EmbeddedResource Include="Download\VideosDownloaderForm.resx">
<DependentUpon>VideosDownloaderForm.vb</DependentUpon> <DependentUpon>VideosDownloaderForm.vb</DependentUpon>
@@ -400,6 +458,7 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput> <LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None> </None>
<None Include="App.config" /> <None Include="App.config" />
<None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\..\MyUtilities\PersonalUtilities.Notifications\PersonalUtilities.Notifications.vbproj"> <ProjectReference Include="..\..\..\MyUtilities\PersonalUtilities.Notifications\PersonalUtilities.Notifications.vbproj">
@@ -427,6 +486,13 @@
<None Include="Content\Pictures\Pause_Blue_16.png" /> <None Include="Content\Pictures\Pause_Blue_16.png" />
<None Include="Content\Pictures\RegGifsPic32.png" /> <None Include="Content\Pictures\RegGifsPic32.png" />
<None Include="Content\Icons\RegGifsIcon.ico" /> <None Include="Content\Icons\RegGifsIcon.ico" />
<None Include="Content\Icons\SettingsIcon.ico" />
<None Include="Content\Pictures\RedGifsPic32.png" />
<None Include="Content\Pictures\RSSPic.png" />
<None Include="Content\Icons\RedGifsIcon.ico" />
<None Include="Content\Icons\RSSIcon.ico" />
<None Include="Content\Pictures\StopPic32.png" />
<None Include="Content\Pictures\PastePic32.png" />
<Content Include="ffmpeg.exe"> <Content Include="ffmpeg.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@@ -444,6 +510,14 @@
<Install>false</Install> <Install>false</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<Import Project="..\packages\VideoLAN.LibVLC.Windows.3.0.17.4\build\VideoLAN.LibVLC.Windows.targets" Condition="Exists('..\packages\VideoLAN.LibVLC.Windows.3.0.17.4\build\VideoLAN.LibVLC.Windows.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\VideoLAN.LibVLC.Windows.3.0.17.4\build\VideoLAN.LibVLC.Windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\VideoLAN.LibVLC.Windows.3.0.17.4\build\VideoLAN.LibVLC.Windows.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />
</Project> </Project>

View File

@@ -18,6 +18,7 @@ Friend Class SettingsCLS : Implements IDisposable
Friend Const DefaultMaxDownloadingTasks As Integer = 5 Friend Const DefaultMaxDownloadingTasks As Integer = 5
Friend Const Name_Node_Sites As String = "Sites" Friend Const Name_Node_Sites As String = "Sites"
Private Const SitesValuesSeparator As String = "," Private Const SitesValuesSeparator As String = ","
Friend Const CookieEncryptKey As String = "SCrawlerCookiesEncryptKeyword"
Friend ReadOnly Design As XmlFile Friend ReadOnly Design As XmlFile
Private ReadOnly MyXML As XmlFile Private ReadOnly MyXML As XmlFile
Private ReadOnly OS64 As Boolean Private ReadOnly OS64 As Boolean
@@ -28,12 +29,14 @@ Friend Class SettingsCLS : Implements IDisposable
Return OS64 And FfmpegExists Return OS64 And FfmpegExists
End Get End Get
End Property End Property
Friend ReadOnly Property CachePath As SFile = "_Cache\"
Friend ReadOnly Plugins As List(Of PluginHost) Friend ReadOnly Plugins As List(Of PluginHost)
Friend ReadOnly Property Users As List(Of IUserData) Friend ReadOnly Property Users As List(Of IUserData)
Friend ReadOnly Property UsersList As List(Of UserInfo) Friend ReadOnly Property UsersList As List(Of UserInfo)
Friend Property Channels As Reddit.ChannelsCollection Friend Property Channels As Reddit.ChannelsCollection
Friend ReadOnly Property Labels As LabelsKeeper Friend ReadOnly Property Labels As LabelsKeeper
Friend ReadOnly Property Groups As Groups.DownloadGroupCollection Friend ReadOnly Property Groups As Groups.DownloadGroupCollection
Friend ReadOnly Property LastCollections As List(Of String)
Friend Property Automation As Scheduler Friend Property Automation As Scheduler
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"
@@ -50,9 +53,14 @@ Friend Class SettingsCLS : Implements IDisposable
UsersList = New List(Of UserInfo) UsersList = New List(Of UserInfo)
BlackList = New List(Of UserBan) BlackList = New List(Of UserBan)
Plugins = New List(Of PluginHost) Plugins = New List(Of PluginHost)
LastCollections = New List(Of String)
GlobalPath = New XMLValue(Of SFile)("GlobalPath", New SFile($"{SFile.GetPath(Application.StartupPath).PathWithSeparator}Data\"), MyXML,, GlobalPath = New XMLValue(Of SFile)("GlobalPath", New SFile($"{SFile.GetPath(Application.StartupPath).PathWithSeparator}Data\"), MyXML,,
New XMLValueBase.ToFilePath) New XMLValueBase.ToFilePath)
LastCopyPath = New XMLValue(Of SFile)("LastCopyPath",, MyXML,, New XMLValueBase.ToFilePath)
CookiesEncrypted = New XMLValue(Of Boolean)("CookiesEncrypted", False, MyXML)
EncryptCookies.CookiesEncrypted = CookiesEncrypted
SeparateVideoFolder = New XMLValue(Of Boolean)("SeparateVideoFolder", True, MyXML) SeparateVideoFolder = New XMLValue(Of Boolean)("SeparateVideoFolder", True, MyXML)
CollectionsPath = New XMLValue(Of String)("CollectionsPath", "Collections", MyXML) CollectionsPath = New XMLValue(Of String)("CollectionsPath", "Collections", MyXML)
@@ -68,12 +76,11 @@ Friend Class SettingsCLS : Implements IDisposable
Dim tmpPluginList As IEnumerable(Of PluginHost) = PluginHost.GetPluginsHosts(MyXML, GlobalPath.Value, DefaultTemporary, Dim tmpPluginList As IEnumerable(Of PluginHost) = PluginHost.GetPluginsHosts(MyXML, GlobalPath.Value, DefaultTemporary,
DefaultDownloadImages, DefaultDownloadVideos) DefaultDownloadImages, DefaultDownloadVideos)
If tmpPluginList.ListExists Then Plugins.AddRange(tmpPluginList) If tmpPluginList.ListExists Then Plugins.AddRange(tmpPluginList)
CookiesEncrypted.Value = True
FastProfilesLoading = New XMLValue(Of Boolean)("FastProfilesLoading", False, MyXML) FastProfilesLoading = New XMLValue(Of Boolean)("FastProfilesLoading", False, MyXML)
MaxLargeImageHeight = New XMLValue(Of Integer)("MaxLargeImageHeight", 150, MyXML) MaxLargeImageHeight = New XMLValue(Of Integer)("MaxLargeImageHeight", 150, MyXML)
MaxLargeImageHeight.ReplaceByValue("MaxLargeImageHeigh",, MyXML)
MaxSmallImageHeight = New XMLValue(Of Integer)("MaxSmallImageHeight", 15, MyXML) MaxSmallImageHeight = New XMLValue(Of Integer)("MaxSmallImageHeight", 15, MyXML)
MaxSmallImageHeight.ReplaceByValue("MaxSmallImageHeigh",, MyXML)
DownloadOpenInfo = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenInfo", "OpenAgain", False, False, MyXML) DownloadOpenInfo = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenInfo", "OpenAgain", False, False, MyXML)
DownloadOpenProgress = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenProgress", "OpenAgain", False, False, MyXML) DownloadOpenProgress = New XMLValueAttribute(Of Boolean, Boolean)("DownloadOpenProgress", "OpenAgain", False, False, MyXML)
DownloadsCompleteCommand = New XMLValueAttribute(Of String, Boolean)("DownloadsCompleteCommand", "Use",,, MyXML) DownloadsCompleteCommand = New XMLValueAttribute(Of String, Boolean)("DownloadsCompleteCommand", "Use",,, MyXML)
@@ -86,10 +93,18 @@ Friend Class SettingsCLS : Implements IDisposable
ShowGroups = New XMLValue(Of Boolean)("ShowGroups", True, MyXML) ShowGroups = New XMLValue(Of Boolean)("ShowGroups", True, MyXML)
UseGrouping = New XMLValue(Of Boolean)("UseGrouping", True, MyXML) UseGrouping = New XMLValue(Of Boolean)("UseGrouping", True, MyXML)
AddMissingToLog = New XMLValue(Of Boolean)("AddMissingToLog", True, MyXML)
AddMissingErrorsToLog = New XMLValue(Of Boolean)("AddMissingErrorsToLog", False, MyXML)
LatestSavingPath = New XMLValue(Of SFile)("LatestSavingPath", Nothing, MyXML,, New XMLValueBase.ToFilePath) LatestSavingPath = New XMLValue(Of SFile)("LatestSavingPath", Nothing, MyXML,, New XMLValueBase.ToFilePath)
LatestSelectedChannel = New XMLValue(Of String)("LatestSelectedChannel",, MyXML) LatestSelectedChannel = New XMLValue(Of String)("LatestSelectedChannel",, MyXML)
LastUpdatedLimit = New XMLValue(Of Date)
LastUpdatedLimit.SetExtended("LastUpdatedLimit",, MyXML) _ViewDateFrom = New XMLValue(Of Date)
_ViewDateFrom.SetExtended("ViewDateFrom",, MyXML)
_ViewDateTo = New XMLValue(Of Date)
_ViewDateTo.SetExtended("ViewDateTo",, MyXML)
ViewDateMode = New XMLValue(Of Integer)("ViewDateMode", ShowingDates.Off, MyXML)
LatestDownloadedSites = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "LatestDownloadedSites", MyXML) LatestDownloadedSites = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "LatestDownloadedSites", MyXML)
SelectedSites = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "SelectedSites", MyXML, {Name_Node_Sites}) SelectedSites = New XMLValuesCollection(Of String)(XMLValueBase.ListModes.String, "SelectedSites", MyXML, {Name_Node_Sites})
@@ -106,6 +121,13 @@ Friend Class SettingsCLS : Implements IDisposable
ChannelsMaxJobsCount = New XMLValue(Of Integer)("MaxJobsCount", DefaultMaxDownloadingTasks, MyXML, n) ChannelsMaxJobsCount = New XMLValue(Of Integer)("MaxJobsCount", DefaultMaxDownloadingTasks, MyXML, n)
ChannelsAddUserImagesFromAllChannels = New XMLValue(Of Boolean)("AddUserImagesFromAllChannels", True, MyXML, n) ChannelsAddUserImagesFromAllChannels = New XMLValue(Of Boolean)("AddUserImagesFromAllChannels", True, MyXML, n)
n = {"Feed"}
FeedDataColumns = New XMLValue(Of Integer)("DataColumns", 1, MyXML, n)
FeedDataRows = New XMLValue(Of Integer)("DataRows", 10, MyXML, n)
FeedEndless = New XMLValue(Of Boolean)("Endless", True, MyXML, n)
FeedAddDateToCaption = New XMLValue(Of Boolean)("AddDateToCaption", True, MyXML, n)
FeedAddSessionToCaption = New XMLValue(Of Boolean)("AddSessionToCaption", False, MyXML, n)
n = {"Users"} n = {"Users"}
FromChannelDownloadTop = New XMLValue(Of Integer)("FromChannelDownloadTop", 10, MyXML, n) FromChannelDownloadTop = New XMLValue(Of Integer)("FromChannelDownloadTop", 10, MyXML, n)
FromChannelDownloadTopUse = New XMLValue(Of Boolean)("FromChannelDownloadTopUse", False, MyXML, n) FromChannelDownloadTopUse = New XMLValue(Of Boolean)("FromChannelDownloadTopUse", False, MyXML, n)
@@ -204,7 +226,7 @@ Friend Class SettingsCLS : Implements IDisposable
If d.Count > 0 Then If d.Count > 0 Then
For Each kv In d For Each kv In d
Users.Add(New UserDataBind(kv.Value(0).CollectionName)) Users.Add(New UserDataBind(kv.Value(0).CollectionName))
CollectionHandler(DirectCast(Users(Users.Count - 1), UserDataBind)) MainFrameObj.CollectionHandler(DirectCast(Users(Users.Count - 1), UserDataBind))
For v = 0 To kv.Value.Count - 1 : DirectCast(Users(Users.Count - 1), UserDataBind).Add(kv.Value(v), False) : Next For v = 0 To kv.Value.Count - 1 : DirectCast(Users(Users.Count - 1), UserDataBind).Add(kv.Value(v), False) : Next
Next Next
d.Clear() d.Clear()
@@ -329,6 +351,30 @@ Friend Class SettingsCLS : Implements IDisposable
_UserListUpdateRequired = True _UserListUpdateRequired = True
End Try End Try
End Sub End Sub
Friend Overloads Function GetUser(ByVal User As IUserData, Optional ByVal GetCollection As Boolean = False) As IUserData
Return GetUser(If(User?.Key, String.Empty), GetCollection)
End Function
Friend Overloads Function GetUser(ByVal UserKey As String, Optional ByVal GetCollection As Boolean = False) As IUserData
If Users.Count > 0 And Not UserKey.IsEmptyString Then
Dim finder As Predicate(Of IUserData) = Function(u) u.Key = UserKey
Dim i%, ii%
For i = 0 To Users.Count - 1
With Users(i)
If finder.Invoke(.Self) Then
Return .Self
ElseIf .IsCollection Then
With DirectCast(.Self, UserDataBind)
If .Count > 0 Then
ii = .Collections.FindIndex(finder)
If ii >= 0 Then Return If(GetCollection, .Self, .Collections(ii))
End If
End With
End If
End With
Next
End If
Return Nothing
End Function
#End Region #End Region
Friend Sub UpdateBlackList() Friend Sub UpdateBlackList()
If BlackList.Count > 0 Then If BlackList.Count > 0 Then
@@ -379,6 +425,7 @@ Friend Class SettingsCLS : Implements IDisposable
End Get End Get
End Property End Property
Friend ReadOnly Property GlobalPath As XMLValue(Of SFile) Friend ReadOnly Property GlobalPath As XMLValue(Of SFile)
Friend ReadOnly Property LastCopyPath As XMLValue(Of SFile)
Friend ReadOnly Property SeparateVideoFolder As XMLValue(Of Boolean) Friend ReadOnly Property SeparateVideoFolder As XMLValue(Of Boolean)
Friend ReadOnly Property CollectionsPath As XMLValue(Of String) Friend ReadOnly Property CollectionsPath As XMLValue(Of String)
Friend ReadOnly Property CollectionsPathF As SFile Friend ReadOnly Property CollectionsPathF As SFile
@@ -392,6 +439,9 @@ Friend Class SettingsCLS : Implements IDisposable
End Property End Property
Friend ReadOnly Property MaxUsersJobsCount As XMLValue(Of Integer) Friend ReadOnly Property MaxUsersJobsCount As XMLValue(Of Integer)
Friend ReadOnly Property ImgurClientID As XMLValue(Of String) Friend ReadOnly Property ImgurClientID As XMLValue(Of String)
Private ReadOnly Property CookiesEncrypted As XMLValue(Of Boolean)
Friend ReadOnly Property AddMissingToLog As XMLValue(Of Boolean)
Friend ReadOnly Property AddMissingErrorsToLog As XMLValue(Of Boolean)
#Region "Defaults" #Region "Defaults"
Friend ReadOnly Property DefaultTemporary As XMLValue(Of Boolean) Friend ReadOnly Property DefaultTemporary As XMLValue(Of Boolean)
Friend ReadOnly Property DefaultDownloadImages As XMLValue(Of Boolean) Friend ReadOnly Property DefaultDownloadImages As XMLValue(Of Boolean)
@@ -434,15 +484,27 @@ Friend Class SettingsCLS : Implements IDisposable
Friend ReadOnly Property UseGrouping As XMLValue(Of Boolean) Friend ReadOnly Property UseGrouping As XMLValue(Of Boolean)
Friend ReadOnly Property ShowGroupsInsteadLabels As XMLValue(Of Boolean) Friend ReadOnly Property ShowGroupsInsteadLabels As XMLValue(Of Boolean)
Friend ReadOnly Property SelectedSites As XMLValuesCollection(Of String) Friend ReadOnly Property SelectedSites As XMLValuesCollection(Of String)
Private ReadOnly LastUpdatedLimit As XMLValue(Of Date) #Region "View dates"
Friend Property LastUpdatedDate As Date? Private ReadOnly _ViewDateFrom As XMLValue(Of Date)
Friend Property ViewDateFrom As Date?
Get Get
If LastUpdatedLimit.ValueF.Exists Then Return LastUpdatedLimit.Value Else Return Nothing If _ViewDateFrom.ValueF.Exists Then Return _ViewDateFrom.Value Else Return Nothing
End Get End Get
Set(ByVal NewDate As Date?) Set(ByVal d As Date?)
If Not NewDate.HasValue Then LastUpdatedLimit.ValueF = Nothing Else LastUpdatedLimit.Value = NewDate.Value If Not d.HasValue Then _ViewDateFrom.ValueF = Nothing Else _ViewDateFrom.Value = d.Value
End Set End Set
End Property End Property
Private ReadOnly _ViewDateTo As XMLValue(Of Date)
Friend Property ViewDateTo As Date?
Get
If _ViewDateTo.ValueF.Exists Then Return _ViewDateTo.Value Else Return Nothing
End Get
Set(ByVal d As Date?)
If Not d.HasValue Then _ViewDateTo.ValueF = Nothing Else _ViewDateTo.Value = d.Value
End Set
End Property
Friend ReadOnly Property ViewDateMode As XMLValue(Of Integer)
#End Region
#End Region #End Region
#Region "Latest values" #Region "Latest values"
Friend ReadOnly Property LatestSavingPath As XMLValue(Of SFile) Friend ReadOnly Property LatestSavingPath As XMLValue(Of SFile)
@@ -459,6 +521,13 @@ Friend Class SettingsCLS : Implements IDisposable
Friend ReadOnly Property ChannelsMaxJobsCount As XMLValue(Of Integer) Friend ReadOnly Property ChannelsMaxJobsCount As XMLValue(Of Integer)
Friend ReadOnly Property ChannelsAddUserImagesFromAllChannels As XMLValue(Of Boolean) Friend ReadOnly Property ChannelsAddUserImagesFromAllChannels As XMLValue(Of Boolean)
#End Region #End Region
#Region "Feed properties"
Friend ReadOnly Property FeedDataColumns As XMLValue(Of Integer)
Friend ReadOnly Property FeedDataRows As XMLValue(Of Integer)
Friend ReadOnly Property FeedEndless As XMLValue(Of Boolean)
Friend ReadOnly Property FeedAddDateToCaption As XMLValue(Of Boolean)
Friend ReadOnly Property FeedAddSessionToCaption As XMLValue(Of Boolean)
#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)
Friend ReadOnly Property ShowNewVersionNotification As XMLValue(Of Boolean) Friend ReadOnly Property ShowNewVersionNotification As XMLValue(Of Boolean)
@@ -487,8 +556,9 @@ Friend Class SettingsCLS : Implements IDisposable
DeleteCachePath() DeleteCachePath()
End If End If
If Not Automation Is Nothing Then Automation.Dispose() If Not Automation Is Nothing Then Automation.Dispose()
AutoDownloader.CachePath.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None) CachePath.Delete(SFO.Path, SFODelete.DeletePermanently, EDP.None)
Plugins.Clear() Plugins.Clear()
LastCollections.Clear()
Users.ListClearDispose Users.ListClearDispose
UsersList.Clear() UsersList.Clear()
SelectedSites.Dispose() SelectedSites.Dispose()

10
SCrawler/packages.config Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LibVLCSharp" version="3.6.6" targetFramework="net461" />
<package id="LibVLCSharp.WinForms" version="3.6.6" targetFramework="net461" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net461" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net461" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
<package id="VideoLAN.LibVLC.Windows" version="3.0.17.4" targetFramework="net461" />
</packages>