From 70a6e9a6b56f53dd4634f1b305f3f7bfa1e4552b Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sat, 13 Jun 2026 17:04:01 +0200 Subject: [PATCH] refactor: remove discover page --- internal/anime/command_palette.go | 3 ++- internal/anime/handler.go | 6 +----- templates/components/navigation.gohtml | 3 +-- templates/discover.gohtml | 4 ++-- templates/schedule.gohtml | 2 +- templates/watchlist.gohtml | 4 ++-- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/internal/anime/command_palette.go b/internal/anime/command_palette.go index 7e4a955..280c967 100644 --- a/internal/anime/command_palette.go +++ b/internal/anime/command_palette.go @@ -76,8 +76,9 @@ func (h *AnimeHandler) HandleCommandPalette(c *gin.Context) { func (h *AnimeHandler) commandPaletteNavigationItems(query string) []commandPaletteItem { all := []commandPaletteItem{ - {ID: "nav:discover", Type: "navigation", Label: "Go to Discover", Subtitle: "Navigation", Href: "/discover", Icon: "compass"}, + {ID: "nav:home", Type: "navigation", Label: "Go to Home", Subtitle: "Navigation", Href: "/", Icon: "home"}, {ID: "nav:watchlist", Type: "navigation", Label: "Go to Watchlist", Subtitle: "Navigation", Href: "/watchlist", Icon: "bookmark"}, + {ID: "nav:schedule", Type: "navigation", Label: "Open Broadcast Guide", Subtitle: "External broadcast metadata", Href: "/schedule", Icon: "calendar"}, {ID: "nav:popular", Type: "navigation", Label: "Browse popular", Subtitle: "Browse", Href: "/browse?order_by=popularity&sort=asc", Icon: "trending"}, {ID: "nav:airing", Type: "navigation", Label: "Currently airing", Subtitle: "Browse", Href: "/browse?status=airing&order_by=popularity&sort=asc", Icon: "play"}, } diff --git a/internal/anime/handler.go b/internal/anime/handler.go index a4643e4..0be7d94 100644 --- a/internal/anime/handler.go +++ b/internal/anime/handler.go @@ -316,11 +316,7 @@ func (h *AnimeHandler) renderCatalogSection(c *gin.Context, section string) { } func (h *AnimeHandler) HandleDiscover(c *gin.Context) { - user := server.CurrentUser(c) - c.HTML(http.StatusOK, "discover.gohtml", gin.H{ - "CurrentPath": "/discover", - "User": user, - }) + c.Redirect(http.StatusSeeOther, "/") } func (h *AnimeHandler) HandleDiscoverTopPicksForYou(c *gin.Context) { diff --git a/templates/components/navigation.gohtml b/templates/components/navigation.gohtml index 8137c0d..ac6de37 100644 --- a/templates/components/navigation.gohtml +++ b/templates/components/navigation.gohtml @@ -66,8 +66,6 @@ {{$isCollapsed := .IsCollapsed}} {{$navItems := list (dict "key" "home" "href" "/" "label" "Home" "isActive" (eq $currentPath "/")) - (dict "key" "discover" "href" "/discover" "label" "Discover" "isActive" (eq $currentPath "/discover")) - (dict "key" "schedule" "href" "/schedule" "label" "Schedule" "isActive" (eq $currentPath "/schedule")) (dict "key" "watchlist" "href" "/watchlist" "label" "Watchlist" "isActive" (eq $currentPath "/watchlist")) }} @@ -93,6 +91,7 @@ {{template "nav_item" dict "key" .key "href" .href "label" .label "isActive" .isActive "isCollapsed" $isCollapsed}} {{end}} + {{end}} diff --git a/templates/discover.gohtml b/templates/discover.gohtml index 158c6ab..e1c8da4 100644 --- a/templates/discover.gohtml +++ b/templates/discover.gohtml @@ -7,7 +7,7 @@

Top Picks for You

The full ranked list from your current watchlist profile.

- Back to Discover + Back to Home {{if eq (len .Animes) 0}} @@ -17,7 +17,7 @@

Add a few anime to your watchlist so the recommender has something to learn from.

Open watchlist - Discover anime + Browse anime
{{else}} diff --git a/templates/schedule.gohtml b/templates/schedule.gohtml index 9041ad7..b69324d 100644 --- a/templates/schedule.gohtml +++ b/templates/schedule.gohtml @@ -35,7 +35,7 @@
Browse airing - Discover + Browse Open watchlist
diff --git a/templates/watchlist.gohtml b/templates/watchlist.gohtml index 57a892c..939027a 100644 --- a/templates/watchlist.gohtml +++ b/templates/watchlist.gohtml @@ -81,8 +81,8 @@

Your watchlist is empty.

Start adding anime to keep track of what you want to watch.

- Browse anime - Discover new + Go home + Browse anime
{{end}}