From 0d6459c0846ffd28a2f4f3ccea52c85023f2e55e Mon Sep 17 00:00:00 2001 From: Akamaru Date: Thu, 12 Nov 2015 21:00:29 +0100 Subject: [PATCH] Neuer Output inkl. Alternativtitel bei myanimelist.lua --- plugins/myanimelist.lua | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/plugins/myanimelist.lua b/plugins/myanimelist.lua index dc29f27..069d3f8 100644 --- a/plugins/myanimelist.lua +++ b/plugins/myanimelist.lua @@ -36,10 +36,16 @@ local function send_anime_data(result, receiver) local id = xml.find(result, 'id')[1] local mal_url = 'http://myanimelist.net/anime/'..id - if xml.find(result, 'synopsis')[1] then - desc = '\n'..unescape(delete_tags(string.sub(xml.find(result, 'synopsis')[1], 1, 200))) .. '...' + if xml.find(result, 'type')[1] then + typ = ' ('..xml.find(result, 'type')[1]..')' else - desc = '' + typ = '' + end + + if xml.find(result, 'synonyms')[1] then + syno = '\nAlternativ: '..unescape(delete_tags(string.sub(xml.find(result, 'synonyms')[1], 1, 200))) + else + syno = '' end if xml.find(result, 'episodes')[1] then @@ -59,26 +65,26 @@ local function send_anime_data(result, receiver) else score = '' end - - if xml.find(result, 'type')[1] then - typ = '\nTyp: '..xml.find(result, 'type')[1] - else - typ = '' - end if xml.find(result, 'start_date')[1] ~= "0000-00-00" then - startdate = '\nStart: '..makeOurDate(xml.find(result, 'start_date')[1]) + startdate = '\nAusstrahlung: '..makeOurDate(xml.find(result, 'start_date')[1]) else startdate = '' end if xml.find(result, 'end_date')[1] ~= "0000-00-00" then - enddate = '\nEnde: '..makeOurDate(xml.find(result, 'end_date')[1]) + enddate = ' - '..makeOurDate(xml.find(result, 'end_date')[1]) else enddate = '' end + + if xml.find(result, 'synopsis')[1] then + desc = '\n'..unescape(delete_tags(string.sub(xml.find(result, 'synopsis')[1], 1, 200))) .. '...' + else + desc = '' + end - local text = title..desc..episodes..status..score..typ..startdate..enddate..'\n'..mal_url + local text = title..typ..syno..episodes..status..score..startdate..enddate..'\n'..desc..'\n'..mal_url if xml.find(result, 'image') then local image_url = xml.find(result, 'image')[1] local cb_extra = {