From 3a09929e6e93022959dab611abd9259b2acd6212 Mon Sep 17 00:00:00 2001 From: yuriy Date: Wed, 20 Sep 2023 23:13:30 -0400 Subject: [PATCH] added extra checks for proper URL when reading from ini and after logging in --- Modules/Podcast-Upload.ahk | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Modules/Podcast-Upload.ahk b/Modules/Podcast-Upload.ahk index 09b5716..66f3019 100644 --- a/Modules/Podcast-Upload.ahk +++ b/Modules/Podcast-Upload.ahk @@ -9,7 +9,7 @@ PodcastTags := StrReplace(PodcastTags, "--", "-") ; Msgbox % "PodcastTags: " PodcastTags -Message = Starting Upload +Message = Starting Podcast Upload SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") @@ -21,6 +21,11 @@ if(FDRRadioURL = ""){ Return } +if(!InStr(FDRRadioURL, "/Podcasts/New")){ + Message = FDRRadioURL is not formatted properly. Please make sure it ends with "https://....../manage/#/Podcasts/New" + SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,ErrorSummaryVar,DiscordErrorLogging") +} + IniRead, Username, %SettingsIniFilepath%, General, FDRRadioUN, %A_Space% IniRead, Password, %SettingsIniFilepath%, General, FDRRadioPW, %A_Space% @@ -137,6 +142,18 @@ if(!Status){ ; if inputting email did NOT fail, then we are on the login page, i } +Message = Checking URL for /Podcasts/New string +SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") +try, CurrentURL := driver.url() +if(!InStr(CurrentURL, "/Podcasts/New")){ + Message = Re-Navigating to /Podcast/new URL + SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile,DiscordErrorLogging") + + try driver.Get(FDRRadioURL) + +} + + Message = Waiting for Page to Load SaveOrPostProgress(Message:=Message,PostType:="Tooltip,ErrorLoggingTextFile")