On manually rescraping a user feed, update the user and download their content too

This commit is contained in:
Alessio 2025-02-02 20:02:26 -08:00
parent cd02110021
commit eec02fef00

View File

@ -46,6 +46,12 @@ func (app *Application) UserFeed(w http.ResponseWriter, r *http.Request) {
return return
} }
// Update the user themself
user, err = app.API.GetUser(scraper.UserHandle(parts[0]))
panic_if(err)
panic_if(app.Profile.SaveUser(&user)) // TODO: handle conflicting users
panic_if(app.Profile.DownloadUserContentFor(&user, &app.API))
if len(parts) == 1 { // The URL is just the user handle if len(parts) == 1 { // The URL is just the user handle
// Run scraper // Run scraper
trove, err := app.API.GetUserFeed(user.ID, 50) // TODO: parameterizable trove, err := app.API.GetUserFeed(user.ID, 50) // TODO: parameterizable