plex.lua: länge der Beschreibung gekürzt

This commit is contained in:
Akamaru 2016-07-24 17:24:16 +02:00
parent 8bd0a5bc56
commit 2334a40638

View File

@ -12,6 +12,8 @@ local makeOurDate = function(dateString)
end
end
local DESC_LENTH = 400
local function get_plex(query)
local token = cred_data.plex_token
local baseurl = 'http://kyouko.local:32400' --replace it with yours
@ -98,7 +100,7 @@ local data = json:decode(table.concat(response_body))._children[1]
end
if data.summary then
desc = '\n\n'..string.gsub(unescape(data.summary), 'EditBackgroundNo(.*)', '')
desc = '\n\n'..string.sub(unescape(data.summary:gsub("%b<>", "")), 1, DESC_LENTH)..'...'
else
desc = ''
end