func SearchMovies(ctx *gin.Context) { query := ctx.Request.URL.Query().Get("q") if query == "" { query = xbmc.Keyboard("", "LOCALIZE[30206]") if query == "" { return } } renderMovies(tmdb.SearchMovies(query, config.Get().Language), ctx, -1) }
func SearchMovies(ctx *gin.Context) { query := ctx.Request.URL.Query().Get("q") if query == "" { if len(searchHistory) > 0 && xbmc.DialogConfirm("Quasar", "LOCALIZE[30262]") { choice := xbmc.ListDialog("LOCALIZE[30261]", searchHistory...) query = searchHistory[choice] } else { query = xbmc.Keyboard("", "LOCALIZE[30206]") if query == "" { return } searchHistory = append(searchHistory, query) } } page, _ := strconv.Atoi(ctx.DefaultQuery("page", "0")) renderMovies(tmdb.SearchMovies(query, config.Get().Language, page), ctx, page, query) }