remove unfinished score sorting and score display (#2)
* refactor: remove watchlist score sort * refactor: drop score metadata from ui
This commit is contained in:
@@ -152,7 +152,7 @@ func (h *Handler) HandleGetWatchlist(w http.ResponseWriter, r *http.Request) {
|
||||
sortBy := r.URL.Query().Get("sort")
|
||||
sortOrder := r.URL.Query().Get("order")
|
||||
|
||||
if sortBy != "title" && sortBy != "score" {
|
||||
if sortBy != "title" {
|
||||
sortBy = "date"
|
||||
}
|
||||
if sortOrder != "asc" {
|
||||
@@ -270,11 +270,6 @@ func (h *Handler) sortEntries(entries []database.GetUserWatchListRow, sortBy, so
|
||||
}
|
||||
return !cmp
|
||||
}
|
||||
case "score":
|
||||
less = func(i, j int) bool {
|
||||
// Score is stored as JSON in the DB, for now just keep default order
|
||||
return false
|
||||
}
|
||||
default: // "date"
|
||||
less = func(i, j int) bool {
|
||||
cmp := entries[i].UpdatedAt.After(entries[j].UpdatedAt)
|
||||
|
||||
@@ -41,8 +41,6 @@ type Anime struct {
|
||||
} `json:"webp"`
|
||||
} `json:"images"`
|
||||
Synopsis string `json:"synopsis"`
|
||||
Score float64 `json:"score"`
|
||||
ScoredBy int `json:"scored_by"`
|
||||
Rank int `json:"rank"`
|
||||
Popularity int `json:"popularity"`
|
||||
Status string `json:"status"`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ui
|
||||
|
||||
type SortFilterOptions struct {
|
||||
Sort string // "title", "date", "score"
|
||||
Sort string // "title", "date"
|
||||
Order string // "asc", "desc"
|
||||
View string // for watchlist: "grid", "table"
|
||||
Status string // for watchlist: "all", "watching", etc
|
||||
@@ -14,7 +14,6 @@ templ SortFilter(opts SortFilterOptions) {
|
||||
<select id="sort-select" class="sort-filter-select" onchange="document.getElementById('sort-input').value = this.value; document.getElementById('sort-form').submit()">
|
||||
<option value="date" selected?={ opts.Sort == "date" }>Date added</option>
|
||||
<option value="title" selected?={ opts.Sort == "title" }>Title</option>
|
||||
<option value="score" selected?={ opts.Sort == "score" }>Score</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="sort-filter-group">
|
||||
|
||||
@@ -82,12 +82,6 @@ templ AnimeDetails(anime jikan.Anime, currentStatus string) {
|
||||
<span class="sidebar-value">{ anime.Status }</span>
|
||||
</div>
|
||||
}
|
||||
if anime.Score > 0 {
|
||||
<div class="sidebar-row">
|
||||
<span class="sidebar-label">MAL Score</span>
|
||||
<span class="sidebar-value">{ fmt.Sprintf("%.2f", anime.Score) }</span>
|
||||
</div>
|
||||
}
|
||||
if anime.Duration != "" {
|
||||
<div class="sidebar-row">
|
||||
<span class="sidebar-label">Duration</span>
|
||||
|
||||
Reference in New Issue
Block a user