0.2.73
This commit is contained in:
@@ -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 "":
|
||||
|
||||
Reference in New Issue
Block a user