fix(player): simplify autoplay to redirect and ensure episodes are sorted
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -62,6 +63,10 @@ func (h *Handler) HandleWatchPage(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
sort.Slice(episodes.Data, func(i, j int) bool {
|
||||
return episodes.Data[i].MalID < episodes.Data[j].MalID
|
||||
})
|
||||
|
||||
user, _ := r.Context().Value(ctxpkg.UserKey).(*database.User)
|
||||
|
||||
currentEpID := r.URL.Query().Get("ep")
|
||||
|
||||
Reference in New Issue
Block a user