Herkunft, Staffel und Episode zu plex hinzugefügt

This commit is contained in:
Akamaru 2016-02-25 15:55:07 +01:00
parent f4e57eceaa
commit 7417683bbf

View File

@ -14,7 +14,7 @@ end
local function get_plex(query) local function get_plex(query)
local token = cred_data.plex_token local token = cred_data.plex_token
local baseurl = 'http://yagyuu.local:32400' local baseurl = 'http://yagyuu.local:32400' --replace it with yours
local response_body = {} local response_body = {}
local request_constructor = { local request_constructor = {
url = baseurl..'/search?query='..query..'&X-Plex-Token='..token, url = baseurl..'/search?query='..query..'&X-Plex-Token='..token,
@ -29,6 +29,24 @@ local data = json:decode(table.concat(response_body))._children[1]
local title = data.title local title = data.title
if data.parentIndex then
season = 'S'..data.parentIndex
else
season = ''
end
if data.index then
episode = 'E'..data.index
else
episode = ''
end
if data.grandparentTitle then
from = ' (aus '..data.grandparentTitle..' ['..season..episode..']'..') '
else
from = ''
end
if data.originalTitle then if data.originalTitle then
origtitle = '\nOriginal: '..data.originalTitle origtitle = '\nOriginal: '..data.originalTitle
else else
@ -62,7 +80,7 @@ local data = json:decode(table.concat(response_body))._children[1]
local desc = '\n\nBeschreibung: '..data.summary local desc = '\n\nBeschreibung: '..data.summary
local pic = baseurl..data.thumb local pic = baseurl..data.thumb
local text = title..origtitle..studio..date..fsk..rating..desc..'\n' local text = title..from..origtitle..studio..date..fsk..rating..desc..'\n'
return text, pic return text, pic
end end