Пример #1
0
func PopularMovies(ctx *gin.Context) {
	genre := ctx.Params.ByName("genre")
	if genre == "0" {
		genre = ""
	}
	page, _ := strconv.Atoi(ctx.DefaultQuery("page", "0"))
	renderMovies(tmdb.PopularMoviesComplete(genre, config.Get().Language, page), ctx, page, "")
}
Пример #2
0
func PopularMovies(ctx *gin.Context) {
	genre := ctx.Params.ByName("genre")
	if genre == "0" {
		genre = ""
	}
	page := -1
	if config.Get().EnablePaging == true {
		currentpage, err := strconv.Atoi(ctx.DefaultQuery("page", "0"))
		if err == nil {
			page = currentpage
		}
	}
	renderMovies(tmdb.PopularMoviesComplete(genre, config.Get().Language, page), ctx, page)
}