' Copyright (C) 2023 Andy https://github.com/AAndyProgram ' 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 SCrawler.Plugin.Attributes Imports DModels = SCrawler.API.Twitter.UserData.DownloadModels Namespace API.Twitter Friend Class EditorExchangeOptions : Inherits Base.EditorExchangeOptionsBase Private Const DefaultOffset As Integer = 100 Friend Overrides Property SiteKey As String = TwitterSiteKey Friend Property GifsDownload As Boolean Friend Property GifsSpecialFolder As String Friend Property GifsPrefix As String Friend Property UseMD5Comparison As Boolean = False Friend Property RemoveExistingDuplicates As Boolean = False Friend Overridable Property MediaModelAllowNonUserTweets As Boolean = False Friend Overridable Property DownloadModelMedia As Boolean = False Friend Overridable Property DownloadModelProfile As Boolean = False Friend Overridable Property DownloadModelSearch As Boolean = False Friend Overridable Property DownloadModelLikes As Boolean = False Friend Overridable Property DownloadBroadcasts As Boolean = False Friend Overridable Property DownloadModelForceApply As Boolean = False Friend Overridable Property LargeProfile As Boolean = False Private ReadOnly Property MySettings As Object Friend Sub New(ByVal s As SiteSettings) MyBase.New(s) GifsDownload = s.GifsDownload.Value GifsSpecialFolder = s.GifsSpecialFolder.Value GifsPrefix = s.GifsPrefix.Value UseMD5Comparison = s.UseMD5Comparison.Value DownloadModelForceApply = s.UseAppropriateModel.Value MediaModelAllowNonUserTweets = s.MediaModelAllowNonUserTweets.Value MySettings = s End Sub Friend Sub New(ByVal s As Mastodon.SiteSettings) GifsDownload = s.GifsDownload.Value GifsSpecialFolder = s.GifsSpecialFolder.Value GifsPrefix = s.GifsPrefix.Value UseMD5Comparison = s.UseMD5Comparison.Value MySettings = s End Sub Friend Sub New(ByVal u As UserData) MyBase.New(u) GifsDownload = u.GifsDownload GifsSpecialFolder = u.GifsSpecialFolder GifsPrefix = u.GifsPrefix UseMD5Comparison = u.UseMD5Comparison RemoveExistingDuplicates = u.RemoveExistingDuplicates MediaModelAllowNonUserTweets = u.MediaModelAllowNonUserTweets LargeProfile = u.LargeProfile If Not TypeOf u Is Mastodon.UserData Then DownloadModelForceApply = u.DownloadModelForceApply DownloadBroadcasts = u.DownloadBroadcasts Dim dm As DModels() = EnumExtract(Of DModels)(u.DownloadModel) If dm.ListExists Then DownloadModelMedia = dm.Contains(DModels.Media) DownloadModelProfile = dm.Contains(DModels.Profile) DownloadModelSearch = dm.Contains(DModels.Search) DownloadModelLikes = dm.Contains(DModels.Likes) End If End If MySettings = u.HOST.Source End Sub End Class End Namespace