Ignoriere 00 Tage/Monate in MyAnimeList

This commit is contained in:
Akamaru 2015-12-19 15:19:26 +01:00
parent 47590c6cdc
commit 0e2991b9ea
2 changed files with 13 additions and 1 deletions

View File

@ -21,7 +21,13 @@ end
local makeOurDate = function(dateString) local makeOurDate = function(dateString)
local pattern = "(%d+)%-(%d+)%-(%d+)" local pattern = "(%d+)%-(%d+)%-(%d+)"
local year, month, day = dateString:match(pattern) local year, month, day = dateString:match(pattern)
if day == "00" then
return month..'.'..year
elseif month == "00" then
return year
else
return day..'.'..month..'.'..year return day..'.'..month..'.'..year
end
end end
local function get_anime_info(anime) local function get_anime_info(anime)
@ -50,7 +56,7 @@ local function send_anime_data(result, receiver)
end end
if xml.find(result, 'english')[1] then if xml.find(result, 'english')[1] then
eng = '; '..unescape(delete_tags(xml.find(result, 'english')[1])) eng = '\nEnglisch: '..unescape(delete_tags(xml.find(result, 'english')[1]))
else else
eng = '' eng = ''
end end

View File

@ -21,7 +21,13 @@ end
local makeOurDate = function(dateString) local makeOurDate = function(dateString)
local pattern = "(%d+)%-(%d+)%-(%d+)" local pattern = "(%d+)%-(%d+)%-(%d+)"
local year, month, day = dateString:match(pattern) local year, month, day = dateString:match(pattern)
if day == "00" then
return month..'.'..year
elseif month == "00" then
return year
else
return day..'.'..month..'.'..year return day..'.'..month..'.'..year
end
end end
local function get_manga_info(manga) local function get_manga_info(manga)