move models, views, and controllers to root

This commit is contained in:
ari melody 2024-11-01 19:33:26 +00:00
parent f0d29126ab
commit 96cc64464f
Signed by: ari
GPG key ID: CF99829C92678188
21 changed files with 190 additions and 203 deletions

View file

@ -6,15 +6,15 @@ import (
"strings"
"arimelody-web/global"
"arimelody-web/music/model"
"arimelody-web/music/controller"
"arimelody-web/model"
"arimelody-web/controller"
)
func serveTrack() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
slices := strings.Split(r.URL.Path[1:], "/")
id := slices[0]
track, err := music.GetTrack(global.DB, id)
track, err := controller.GetTrack(global.DB, id)
if err != nil {
fmt.Printf("Error rendering admin track page for %s: %s\n", id, err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
@ -25,7 +25,7 @@ func serveTrack() http.Handler {
return
}
releases, err := music.GetTrackReleases(global.DB, track.ID, true)
releases, err := controller.GetTrackReleases(global.DB, track.ID, true)
if err != nil {
fmt.Printf("FATAL: Failed to pull releases for %s: %s\n", id, err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)