Works now, Mutex whatever

This commit is contained in:
Pablu23
2024-02-21 23:32:46 +01:00
parent fd8e5bbdbd
commit cc7009c106
3 changed files with 20 additions and 22 deletions

View File

@@ -188,7 +188,10 @@ func (s *Server) HandlePrev(w http.ResponseWriter, r *http.Request) {
}
func (s *Server) HandleCurrent(w http.ResponseWriter, _ *http.Request) {
tmpl := template.Must(template.ParseFiles("test.gohtml"))
tmpl := template.Must(template.ParseFiles("viewer.gohtml"))
s.DbMgr.rw.Lock()
defer s.DbMgr.rw.Unlock()
mangaId, chapterId, err := getMangaIdAndChapterId(s.CurrSubUrl)
if err != nil {
@@ -311,6 +314,9 @@ func (s *Server) AppendImagesToBuf(html string) ([]Image, error) {
func (s *Server) HandleMenu(w http.ResponseWriter, r *http.Request) {
tmpl := template.Must(template.ParseFiles("menu.gohtml"))
s.DbMgr.rw.Lock()
defer s.DbMgr.rw.Unlock()
all := s.DbMgr.Mangas
l := len(all)
mangaViewModels := make([]MangaViewModel, l)