Improved import
This commit is contained in:
@ -2,6 +2,7 @@ package listimportanilist
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/anilist"
|
||||
@ -66,7 +67,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.
|
||||
|
@ -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.
|
||||
|
@ -3,6 +3,7 @@ package listimportmyanimelist
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
@ -75,7 +76,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.
|
||||
|
Reference in New Issue
Block a user