Paar Bugfixees für IMDB-Inline

This commit is contained in:
Andreas Bielawski 2016-08-05 15:20:08 +02:00
parent c21aa73459
commit 7e8dbbeedd

View File

@ -39,9 +39,15 @@ function imdb:inline_callback(inline_query, config, matches)
local movie_info = imdb:get_imdb_info(imdb_id) local movie_info = imdb:get_imdb_info(imdb_id)
local title = movie_info.Title local title = movie_info.Title
local year = movie_info.Year local year = movie_info.Year
local description = movie_info.Plot local text = '<b>'..movie_info.Title.. ' ('..movie_info.Year..')</b> von '..movie_info.Director..'\\n'..string.gsub(movie_info.imdbRating, '%.', ',')..'/10 | '..movie_info.Runtime..' | '.. movie_info.Genre
local text = '<b>'..movie_info.Title.. ' ('..movie_info.Year..')</b> von '..movie_info.Director..'\\n'..string.gsub(movie_info.imdbRating, '%.', ',')..'/10 | '..movie_info.Runtime..' | '.. movie_info.Genre..'\\n<i>' .. movie_info.Plot .. '</i>' if movie_info.Plot then
text = text..'\\n<i>'..movie_info.Plot..'</i>'
description = movie_info.Plot
else
description = 'Keine Beschreibung verfügbar'
end
local text = text:gsub('"', '\\"') local text = text:gsub('"', '\\"')
local text = text:gsub("'", "\'")
if movie_info.Poster == "N/A" then if movie_info.Poster == "N/A" then
img_url = 'https://anditest.perseus.uberspace.de/inlineQuerys/imdb/logo.jpg' img_url = 'https://anditest.perseus.uberspace.de/inlineQuerys/imdb/logo.jpg'
@ -53,7 +59,7 @@ function imdb:inline_callback(inline_query, config, matches)
local results = results:sub(0, -2) local results = results:sub(0, -2)
local results = results..']' local results = results..']'
utilities.answer_inline_query(self, inline_query, results, 10000) utilities.answer_inline_query(self, inline_query, results, 1)
end end
function imdb:action(msg, config) function imdb:action(msg, config)