Plex: Fix wenn kein Ergebnis
This commit is contained in:
parent
19eb111b9f
commit
4f11455bc5
@ -39,7 +39,9 @@ function plex:get_plex(query)
|
||||
}
|
||||
local ok, response_code, response_headers, response_status_line = http.request(request_constructor)
|
||||
if not ok then return 'NOTOK' end
|
||||
local data = json.decode(table.concat(response_body)).MediaContainer.Metadata[1]
|
||||
local raw = json.decode(table.concat(response_body)).MediaContainer
|
||||
if raw.size == 4 then return 'NOTOK' end
|
||||
local data = raw.Metadata[1]
|
||||
|
||||
local title = '<b>'..data.title..'</b>'
|
||||
|
||||
@ -198,7 +200,7 @@ function plex:action(msg, config)
|
||||
utilities.send_reply(msg, config.errors.results)
|
||||
return
|
||||
elseif text == 'NOTOK' then
|
||||
utilities.send_reply(msg, config.errors.connection)
|
||||
utilities.send_reply(msg, 'Keine Ergebnisse gefunden.')
|
||||
return
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user