BUGFIX: user is missing when loading their user profile, try to scrape them first

This commit is contained in:
Alessio 2023-11-26 20:43:38 -08:00
parent aaab11b1d0
commit e5597ceac0

View File

@ -38,8 +38,15 @@ func (app *Application) UserFeed(w http.ResponseWriter, r *http.Request) {
user, err := app.Profile.GetUserByHandle(scraper.UserHandle(parts[0]))
if err != nil {
app.error_404(w)
return
if !app.IsScrapingDisabled {
user, err = scraper.GetUser(scraper.UserHandle(parts[0]))
}
if err != nil {
app.error_404(w)
return
}
app.Profile.SaveUser(&user)
app.Profile.DownloadUserContentFor(&user)
}
if r.URL.Query().Has("scrape") {