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

@ -11,8 +11,8 @@ import (
"arimelody-web/discord"
"arimelody-web/global"
musicDB "arimelody-web/music/controller"
musicModel "arimelody-web/music/model"
"arimelody-web/controller"
"arimelody-web/model"
)
type loginData struct {
@ -41,21 +41,21 @@ func Handler() http.Handler {
return
}
releases, err := musicDB.GetAllReleases(global.DB, false, 0, true)
releases, err := controller.GetAllReleases(global.DB, false, 0, true)
if err != nil {
fmt.Printf("FATAL: Failed to pull releases: %s\n", err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
return
}
artists, err := musicDB.GetAllArtists(global.DB)
artists, err := controller.GetAllArtists(global.DB)
if err != nil {
fmt.Printf("FATAL: Failed to pull artists: %s\n", err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
return
}
tracks, err := musicDB.GetOrphanTracks(global.DB)
tracks, err := controller.GetOrphanTracks(global.DB)
if err != nil {
fmt.Printf("FATAL: Failed to pull orphan tracks: %s\n", err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
@ -63,9 +63,9 @@ func Handler() http.Handler {
}
type IndexData struct {
Releases []*musicModel.Release
Artists []*musicModel.Artist
Tracks []*musicModel.Track
Releases []*model.Release
Artists []*model.Artist
Tracks []*model.Track
}
err = pages["index"].Execute(w, IndexData{