Well this doesnt work yet, and is likely not the correct way, this needs more thought put into it, probably a complete rewrite is advisable because bringing this into a shape where it could have multiple Providers is hard

This commit is contained in:
Pablu23
2024-02-26 22:21:59 +01:00
parent 87ec7aa1a8
commit 18d9ecf4ad
11 changed files with 234 additions and 115 deletions

View File

@@ -17,26 +17,6 @@ import (
"time"
)
func (s *Server) HandleNew(w http.ResponseWriter, r *http.Request) {
title := r.PathValue("title")
chapter := r.PathValue("chapter")
url := fmt.Sprintf("/title/%s/%s", title, chapter)
s.Mutex.Lock()
s.ImageBuffers = make(map[string]*bytes.Buffer)
s.Mutex.Unlock()
s.CurrSubUrl = url
s.PrevSubUrl = ""
s.NextSubUrl = ""
s.LoadCurr()
go s.LoadNext()
go s.LoadPrev()
http.Redirect(w, r, "/current/", http.StatusTemporaryRedirect)
}
func (s *Server) HandleMenu(w http.ResponseWriter, _ *http.Request) {
tmpl := template.Must(view.GetViewTemplate(view.Menu))
@@ -277,8 +257,6 @@ func (s *Server) HandlePrev(w http.ResponseWriter, r *http.Request) {
func (s *Server) HandleNewQuery(w http.ResponseWriter, r *http.Request) {
sub := r.PostFormValue("subUrl")
url := fmt.Sprintf("/title/%s", sub)
s.Mutex.Lock()
s.ImageBuffers = make(map[string]*bytes.Buffer)
s.Mutex.Unlock()