From 181044be9a440af4bed29943f90fe358aaf75178 Mon Sep 17 00:00:00 2001 From: yuriy Date: Sun, 22 Oct 2023 02:20:30 -0400 Subject: [PATCH] Fixed errors when gitea not available --- Freedomain Social Media Poster.ahk | 27 +++++++++++++++++-------- Lib/Freedomain-Posters-Shared-Functions | 2 +- Modules/Post-To-Locals.ahk | 21 ++----------------- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/Freedomain Social Media Poster.ahk b/Freedomain Social Media Poster.ahk index 9835c4d..efa1f52 100644 --- a/Freedomain Social Media Poster.ahk +++ b/Freedomain Social Media Poster.ahk @@ -42,7 +42,7 @@ global UpdateVersionNumber ScriptName = Freedomain Social Media Poster -ScriptVersion = 2.84 +ScriptVersion = 2.85 FullScriptName := ScriptName . " " . ScriptVersion ;---ToDo--- @@ -299,7 +299,7 @@ if(StrLen(ErrorLoggingDirectory) > 5 and !InStr(ErrorLoggingDirectory, ".exe")){ (Locals != "")?(LocalsCheckStatus := 0) : (LocalsCheckStatus := 1) (LinkedIN != "")?(LinkedINCheckStatus := 0) : (LinkedINCheckStatus := 1) (Twetch != "")?(TwetchCheckStatus := 0) : (TwetchCheckStatus := 1) -(ThinkSpot != "")?(ThinkSpotCheckStatus := 0) : (ThinkSpotCheckStatus := 1) +(ThinkSpot != "")?(ThinkSpotCheckStatus := 0) : (ThinkSpotCheckStatus := 0) ; (Flote != "")?(FloteCheckStatus := 0) : (FloteCheckStatus := 0) ; (Pintrest != "")?(PintrestCheckStatus := 0) : (PintrestCheckStatus := 1) ; (Parler != "")?(ParlerCheckStatus := 0) : (ParlerCheckStatus := 0) @@ -512,13 +512,22 @@ ControlFocus, Edit1, %FullScriptName% ; check for updates if the setting is enabled -if(AutoUpdateCheck AND !SkipUpdateCheckThisRun){ - CheckForUpdates(GitReleasesAPIURL) +if(AutoUpdateCheck AND !UpdateAvailable){ + Message = Checking for Updates + SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") + ; DevModeMsgBox("checking for updates") + ; msgbox, checkin for update + ; DevModeMsgBox(GitReleasesAPIURL) + ; UpdateAvailable := + + if(CheckForUpdates(GitReleasesAPIURL)) GuiControl,,UpdateAvailable, Uploader Update Available! - ; if(CheckForChromeUpdates(ChromeFilepath)) - ; GuiControl,,ChromeUpdateAvailable, Chrome Update Available! + if(CheckForChromeUpdates(ChromeFilepath)){ + GuiControl,,ChromeUpdateAvailable, Chrome Update Available! + ChromeUpdateAvailable := 1 + } } @@ -615,7 +624,9 @@ if(!status){ } - DownloadLatestChromium() + Status := DownloadLatestChromium() + if(Status) + GuiControl,,ChromeUpdateAvailable, Chrome Up-to-Dat Return @@ -808,7 +819,7 @@ IniWrite, %ShowTooltipProgress%, %SettingsIniFilepath%, SocialMediaPoster, ShowT (Locals = 1)?(PostedWebsites .= "Locals|") : () (LinkedIn = 1)?(PostedWebsites .= "LinkedIn|") : () (Twetch = 1)?(PostedWebsites .= "Twetch|") : () -(ThinkSpot = 1)?(PostedWebsites .= "ThinkSpot|") : () +(ThinkSpot = 0)?(PostedWebsites .= "ThinkSpot|") : () ; (Flote = 1)?(PostedWebsites .= "Flote|") : () (PocketNet = 1)?(PostedWebsites .= "PocketNet|") : () (Gettr = 1)?(PostedWebsites .= "Gettr|") : () diff --git a/Lib/Freedomain-Posters-Shared-Functions b/Lib/Freedomain-Posters-Shared-Functions index 1962743..49b1e74 160000 --- a/Lib/Freedomain-Posters-Shared-Functions +++ b/Lib/Freedomain-Posters-Shared-Functions @@ -1 +1 @@ -Subproject commit 1962743565d49bd0ed3c36a67a05642483e28eff +Subproject commit 49b1e74d40b1c64e9c6e48958d4741ae7e6a5a6d diff --git a/Modules/Post-To-Locals.ahk b/Modules/Post-To-Locals.ahk index d593d2d..82175fd 100644 --- a/Modules/Post-To-Locals.ahk +++ b/Modules/Post-To-Locals.ahk @@ -8,30 +8,13 @@ SaveOrPostProgress(Message:="Navigating to Post Creation Page",PostType:="Toolti IniRead, LocalsURL, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL, %A_Space% -if(LocalsURL = ""){ - Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL= +if(LocalsURL = "" OR !InStr(LocalsURL, "/share/post")){ + Message = Please add your Locals Profile URL to the settings.ini file under`n`n[General]`nLocalsURL=`n`nURL Needs to end in: /share/post SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") Return } -Message = LocalsURL from Ini File: %LocalsURL% -SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") - -if(!InStr(LocalsURL, "/share/post")){ - LocalsURL = https://freedomain.locals.com/share/post - - Message = LocalsURL from ini file was incorrect. New URL set to %LocalsURL% and saved to settings.ini - SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") - - IniWrite, %LocalsURL%, %SettingsIniFilepath%, %ScriptSettingsSection%, LocalsURL -} - -; LocalsURL := StrReplace(Localsurl, "/share/post", "") -; LocalsURL := Localsurl . "/login" -; Message = Localsurl: %LocalsURL% -; SaveOrPostProgress(Message:=Message,PostType:=",DiscordErrorLogging") - Status := NavigateFromBaseURLTo(LocalsURL) if(Status = "Failed") Return