refactor: rename malago to mal

This commit is contained in:
2026-04-07 00:14:35 +02:00
parent 8970909917
commit b61070b652
23 changed files with 46 additions and 46 deletions

View File

@@ -10,7 +10,7 @@ test:
go test ./...
migrate:
sqlite3 malago.db < migrations/001_init.sql
sqlite3 mal.db < migrations/001_init.sql
sqlc:
sqlc generate

View File

@@ -10,8 +10,8 @@ import (
_ "github.com/mattn/go-sqlite3"
"malago/internal/database"
"malago/internal/features/auth"
"mal/internal/database"
"mal/internal/features/auth"
)
func main() {
@@ -27,7 +27,7 @@ func main() {
dbFile := os.Getenv("DATABASE_FILE")
if dbFile == "" {
dbFile = "malago.db"
dbFile = "mal.db"
}
db, err := sql.Open("sqlite3", dbFile)

View File

@@ -8,17 +8,17 @@ import (
_ "github.com/mattn/go-sqlite3"
"malago/internal/database"
"malago/internal/features/auth"
"malago/internal/jikan"
"malago/internal/server"
"mal/internal/database"
"mal/internal/features/auth"
"mal/internal/jikan"
"mal/internal/server"
)
func main() {
dbFile := os.Getenv("DATABASE_FILE")
if dbFile == "" {
dbFile = "malago.db"
dbFile = "mal.db"
}
db, err := sql.Open("sqlite3", dbFile)

2
go.mod
View File

@@ -1,4 +1,4 @@
module malago
module mal
go 1.24.0

View File

@@ -6,9 +6,9 @@ import (
"net/http"
"strconv"
"malago/internal/database"
"malago/internal/shared/middleware"
"malago/internal/templates"
"mal/internal/database"
"mal/internal/shared/middleware"
"mal/internal/templates"
)
type Handler struct {

View File

@@ -4,8 +4,8 @@ import (
"context"
"fmt"
"malago/internal/database"
"malago/internal/jikan"
"mal/internal/database"
"mal/internal/jikan"
)
type Service struct {

View File

@@ -13,7 +13,7 @@ import (
"github.com/google/uuid"
"golang.org/x/crypto/bcrypt"
"malago/internal/database"
"mal/internal/database"
)
var (

View File

@@ -3,7 +3,7 @@ package auth
import (
"net/http"
"malago/internal/templates"
"mal/internal/templates"
)
type Handler struct {

View File

@@ -7,9 +7,9 @@ import (
"net/http"
"strconv"
"malago/internal/database"
"malago/internal/shared/middleware"
"malago/internal/templates"
"mal/internal/database"
"mal/internal/shared/middleware"
"mal/internal/templates"
)
type Handler struct {
@@ -198,7 +198,7 @@ func (h *Handler) HandleExportWatchlist(w http.ResponseWriter, r *http.Request)
}
w.Header().Set("Content-Type", "application/json")
w.Header().Set("Content-Disposition", "attachment; filename=malago-watchlist.json")
w.Header().Set("Content-Disposition", "attachment; filename=mal-watchlist.json")
json.NewEncoder(w).Encode(export)
}

View File

@@ -8,7 +8,7 @@ import (
"github.com/google/uuid"
"malago/internal/database"
"mal/internal/database"
)
type Service struct {

View File

@@ -3,12 +3,12 @@ package server
import (
"net/http"
"malago/internal/database"
"malago/internal/features/anime"
"malago/internal/features/auth"
"malago/internal/features/watchlist"
"malago/internal/jikan"
"malago/internal/shared/middleware"
"mal/internal/database"
"mal/internal/features/anime"
"mal/internal/features/auth"
"mal/internal/features/watchlist"
"mal/internal/jikan"
"mal/internal/shared/middleware"
)
type Config struct {

View File

@@ -5,8 +5,8 @@ import (
"net/http"
"strings"
"malago/internal/database"
"malago/internal/features/auth"
"mal/internal/database"
"mal/internal/features/auth"
)
type contextKey string

View File

@@ -1,11 +1,11 @@
package templates
import "malago/internal/jikan"
import "mal/internal/jikan"
import "fmt"
import "strings"
templ AnimeDetails(anime jikan.Anime, currentStatus string) {
@Layout("malago - " + anime.DisplayTitle()) {
@Layout("mal - " + anime.DisplayTitle()) {
<div class="anime-page">
<div class="anime-main">
<div class="anime-hero">

View File

@@ -8,7 +8,7 @@ package templates
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import "malago/internal/jikan"
import "mal/internal/jikan"
import "fmt"
import "strings"
@@ -599,7 +599,7 @@ func AnimeDetails(anime jikan.Anime, currentStatus string) templ.Component {
}
return nil
})
templ_7745c5c3_Err = Layout("malago - "+anime.DisplayTitle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = Layout("mal - "+anime.DisplayTitle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -1,10 +1,10 @@
package templates
import "malago/internal/jikan"
import "mal/internal/jikan"
import "fmt"
templ Catalog() {
@Layout("malago - catalog") {
@Layout("mal - catalog") {
<div class="catalog-grid" id="catalog-content">
<div hx-get="/api/catalog?page=1" hx-trigger="load" hx-swap="outerHTML" style="grid-column: 1 / -1;">
<div class="loading-indicator">

View File

@@ -8,7 +8,7 @@ package templates
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import "malago/internal/jikan"
import "mal/internal/jikan"
import "fmt"
func Catalog() templ.Component {
@@ -50,7 +50,7 @@ func Catalog() templ.Component {
}
return nil
})
templ_7745c5c3_Err = Layout("malago - catalog").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = Layout("mal - catalog").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -1,13 +1,13 @@
package templates
import (
"malago/internal/jikan"
"mal/internal/jikan"
"fmt"
"net/url"
)
templ Search(q string) {
@Layout("malago - search") {
@Layout("mal - search") {
if q != "" {
<div class="loading-indicator htmx-indicator" id="loading">
<div class="loading-dot"></div>

View File

@@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime"
import (
"fmt"
"malago/internal/jikan"
"mal/internal/jikan"
"net/url"
)
@@ -73,7 +73,7 @@ func Search(q string) templ.Component {
}
return nil
})
templ_7745c5c3_Err = Layout("malago - search").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
templ_7745c5c3_Err = Layout("mal - search").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -14,7 +14,7 @@ templ Layout(title string) {
<header>
<div class="header-top">
<div class="header-left">
<a href="/" class="logo">/malago</a>
<a href="/" class="logo">/mal</a>
<div class="nav">
<a href="/">catalog</a>
<a href="/watchlist">watchlist</a>

View File

@@ -42,7 +42,7 @@ func Layout(title string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"stylesheet\" href=\"/static/css/style.css\"><script src=\"https://unpkg.com/htmx.org@1.9.11\"></script></head><body><header><div class=\"header-top\"><div class=\"header-left\"><a href=\"/\" class=\"logo\">/malago</a><div class=\"nav\"><a href=\"/\">catalog</a> <a href=\"/watchlist\">watchlist</a></div></div><div class=\"header-search-wrapper\"><form action=\"/search\" method=\"GET\" class=\"header-search\"><input type=\"text\" id=\"search-input\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\" autocomplete=\"off\"><div id=\"search-dropdown\" class=\"search-dropdown\"></div></form></div></div></header><main>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"stylesheet\" href=\"/static/css/style.css\"><script src=\"https://unpkg.com/htmx.org@1.9.11\"></script></head><body><header><div class=\"header-top\"><div class=\"header-left\"><a href=\"/\" class=\"logo\">/mal</a><div class=\"nav\"><a href=\"/\">catalog</a> <a href=\"/watchlist\">watchlist</a></div></div><div class=\"header-search-wrapper\"><form action=\"/search\" method=\"GET\" class=\"header-search\"><input type=\"text\" id=\"search-input\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\" autocomplete=\"off\"><div id=\"search-dropdown\" class=\"search-dropdown\"></div></form></div></div></header><main>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}

View File

@@ -2,7 +2,7 @@ package templates
import (
"fmt"
"malago/internal/database"
"mal/internal/database"
)
templ Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) {

View File

@@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime"
import (
"fmt"
"malago/internal/database"
"mal/internal/database"
)
func Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) templ.Component {

BIN
mal Executable file

Binary file not shown.