Herkunft, Staffel und Episode zu plex hinzugefügt
This commit is contained in:
parent
f4e57eceaa
commit
7417683bbf
@ -14,7 +14,7 @@ end
|
||||
|
||||
local function get_plex(query)
|
||||
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 request_constructor = {
|
||||
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
|
||||
|
||||
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
|
||||
origtitle = '\nOriginal: '..data.originalTitle
|
||||
else
|
||||
@ -62,7 +80,7 @@ local data = json:decode(table.concat(response_body))._children[1]
|
||||
local desc = '\n\nBeschreibung: '..data.summary
|
||||
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
|
||||
end
|
||||
|
Reference in New Issue
Block a user