Example #1
0
func SearchShows(ctx *gin.Context) {
	query := ctx.Request.URL.Query().Get("q")
	if query == "" {
		query = xbmc.Keyboard("", "LOCALIZE[30201]")
		if query == "" {
			return
		}
	}
	renderShows(tmdb.SearchShows(query, config.Get().Language), ctx, -1)
}
Example #2
0
func SearchShows(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[30201]")
			if query == "" {
				return
			}
			searchHistory = append(searchHistory, query)
		}
	}
	page, _ := strconv.Atoi(ctx.DefaultQuery("page", "0"))
	renderShows(tmdb.SearchShows(query, config.Get().Language, page), ctx, page, query)
}