This commit is contained in:
ponzischeme89
2026-08-17 13:13:10 +12:00
parent 12b27c77c3
commit 43ab18854c
39 changed files with 1707 additions and 1528 deletions
+10 -3
View File
@@ -67,7 +67,7 @@ func (s *Server) handleBrowseItems(
limit := queryInt(r, "limit", genrePageSize, genrePageMax)
offset := queryOffset(r, "offset")
itemType, ok := genreItemType(r.URL.Query().Get("type"))
if !ok || (genre == "" && itemType == "Movie,Series") {
if !ok {
writeError(w, http.StatusBadRequest, "type must be Movie or Series")
return
}
@@ -145,8 +145,15 @@ func (s *Server) handleBrowseItems(
writeRaw(w, http.StatusOK, body)
}
// genreItemType keeps the old mixed search as the default for Search, while the Movies
// and TV Series destinations can ask for a shelf that never crosses media types.
// genreItemType keeps the mixed shelf as the default, which is what the Search chips and
// the Genres destination ask for, while the Movies and TV Series destinations name a type
// and get a shelf that never crosses media types.
//
// The unfiltered browse used to refuse the mixed type, on the reasoning that a whole
// library with no genre and no media type is not a shelf anybody asked for. The Genres
// destination is exactly that request — its "All genres" entry is the catalogue itself —
// and refusing it here only made the one entry at the top of that rail the one entry that
// could not answer.
func genreItemType(value string) (string, bool) {
switch strings.ToLower(strings.TrimSpace(value)) {
case "":