Improved import

This commit is contained in:
2018-04-03 22:53:53 +02:00
parent 8f5d98addb
commit 2010e9ed68
5 changed files with 55 additions and 14 deletions

View File

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