@@ -10,11 +10,12 @@ import (
1010
1111// ParseSeq extracts the integer episode seq from a podwise episode URL.
1212// Expected format: https://podwise.ai/dashboard/episodes/<seq>
13+ // Also accepts https://app.podwise.ai/dashboard/episodes/<seq> and beta.podwise.ai.
1314func ParseSeq (input string ) (int , error ) {
1415 const hint = "(expected https://podwise.ai/dashboard/episodes/<id>)"
1516
1617 u , err := url .Parse (input )
17- if err != nil || u .Scheme != "https" || (u .Host != "podwise.ai" && u . Host != "beta.podwise.ai" ) {
18+ if err != nil || u .Scheme != "https" || ! isPodwiseHost (u .Host ) {
1819 return 0 , fmt .Errorf ("%q is not a valid podwise episode URL %s" , input , hint )
1920 }
2021
@@ -68,6 +69,16 @@ func IsXiaoyuzhouURL(rawURL string) bool {
6869 return u .Hostname () == "www.xiaoyuzhoufm.com" && strings .HasPrefix (u .Path , "/episode/" )
6970}
7071
72+ // isPodwiseHost reports whether host is a recognised Podwise web host.
73+ // Accepted: podwise.ai, app.podwise.ai, beta.podwise.ai.
74+ func isPodwiseHost (host string ) bool {
75+ switch host {
76+ case "podwise.ai" , "app.podwise.ai" , "beta.podwise.ai" :
77+ return true
78+ }
79+ return false
80+ }
81+
7182// trimTime removes a leading "00:" hour prefix from a time string only when
7283// the remainder is still a valid mm:ss[-based] string (contains at least one
7384// more colon). Examples:
0 commit comments