Performer urls (#4958)

* Populate URLs from legacy fields
* Return nil properly in xpath/json scrapers
* Improve migration logging
This commit is contained in:
WithoutPants
2024-06-18 13:41:05 +10:00
committed by GitHub
parent fda4776d30
commit f26766033e
47 changed files with 992 additions and 379 deletions

18
pkg/performer/url.go Normal file
View File

@@ -0,0 +1,18 @@
package performer
import (
"regexp"
)
var (
twitterURLRE = regexp.MustCompile(`^https?:\/\/(?:www\.)?twitter\.com\/`)
instagramURLRE = regexp.MustCompile(`^https?:\/\/(?:www\.)?instagram\.com\/`)
)
func IsTwitterURL(url string) bool {
return twitterURLRE.MatchString(url)
}
func IsInstagramURL(url string) bool {
return instagramURLRE.MatchString(url)
}