preview.lua: Kürze Beschreibung wenn länger als 300 Zeichen
+fixes
This commit is contained in:
parent
4f3aef6493
commit
b53c855788
@ -11,6 +11,7 @@ function unescape(str)
|
||||
str = string.gsub(str, '$', '$') -- dollar sign
|
||||
str = string.gsub(str, '%', '%') -- percent sign
|
||||
str = string.gsub(str, ''', '\'') -- single quote
|
||||
str = string.gsub(str, ''', '\'') -- single quote
|
||||
str = string.gsub(str, '(', '(') -- opening parenthesis
|
||||
str = string.gsub(str, ')', ')') -- closing parenthesis
|
||||
str = string.gsub(str, '*', '*') -- asterisk
|
||||
|
@ -49,7 +49,7 @@ function playstation_store:get_info(country_code, game_id)
|
||||
price = data.default_sku.display_price--..psplus
|
||||
end
|
||||
local fsk = data.age_limit
|
||||
local description = string.sub(unescape(data.long_desc:gsub("%b<>", "")), 1, 250)..'...'
|
||||
local description = string.sub(unescape(data.long_desc:gsub("%b<>", "")), 1, 300)..'...'
|
||||
local release = makeOurDate(data.release_date)
|
||||
if data.images[4].type ~= 10 then
|
||||
image_url = data.images[4].url
|
||||
|
@ -29,6 +29,11 @@ function preview:inline_callback(inline_query, config, matches)
|
||||
if data.description then
|
||||
description = unescape(data.description:gsub('"', '\\"'))
|
||||
description_in_text = '\n'..description
|
||||
if string.len(description_in_text) > 300 then
|
||||
description_in_text = string.sub(description_in_text, 1, 300)..'...'
|
||||
else
|
||||
description_in_text = description_in_text
|
||||
end
|
||||
else
|
||||
description_in_text = ''
|
||||
description = 'Keine Beschreibung verfügbar'
|
||||
|
Reference in New Issue
Block a user