Added redirects for other list services

This commit is contained in:
2018-04-04 16:45:02 +02:00
parent 74daef0df7
commit 534372de24
8 changed files with 53 additions and 38 deletions

View File

@ -2,7 +2,6 @@ package listimportkitsu
import (
"net/http"
"strings"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
@ -80,14 +79,7 @@ func Finish(ctx *aero.Context) string {
animeList.Save()
// Redirect
prefix := "/"
if strings.HasPrefix(ctx.URI(), "/_") {
prefix = "/_/"
}
return ctx.Redirect(prefix + "+" + user.Nick + "/animelist/watching")
return utils.SmartRedirect(ctx, "/+"+user.Nick+"/animelist/watching")
}
// getMatches finds and returns all matches for the logged in user.