Text spezifisch je nach Art

This commit is contained in:
Akamaru 2016-08-23 17:08:21 +02:00
parent 274919ed46
commit 0ccf89e7ba
2 changed files with 20 additions and 4 deletions

View File

@ -3,7 +3,7 @@ local bot = {}
bindings = require('miku.bindings') bindings = require('miku.bindings')
utilities = require('miku.utilities') utilities = require('miku.utilities')
bot.version = '160816' bot.version = '160823'
function bot:init(config) -- The function run when the bot is started or reloaded. function bot:init(config) -- The function run when the bot is started or reloaded.
cred_data = load_cred() cred_data = load_cred()

View File

@ -57,6 +57,12 @@ function plex:get_plex(query)
episode = '' episode = ''
end end
if data.parentTitle then
artist = '<b>'..data.parentTitle..'</b>'
else
artist = ''
end
if data.grandparentTitle then if data.grandparentTitle then
from = ' (aus <i>'..data.grandparentTitle..'</i> ['..string.gsub(season..episode, 'S0E', 'SP')..']'..') ' from = ' (aus <i>'..data.grandparentTitle..'</i> ['..string.gsub(season..episode, 'S0E', 'SP')..']'..') '
else else
@ -76,9 +82,9 @@ function plex:get_plex(query)
end end
if data.originallyAvailableAt then if data.originallyAvailableAt then
date = '\n<b>Ausstrahlung:</b> '..makeOurDate(data.originallyAvailableAt) date = makeOurDate(data.originallyAvailableAt)
elseif data.year then elseif data.year then
date = '\n<b>Ausstrahlung:</b> '..data.year date = data.year
else else
date = '' date = ''
end end
@ -128,7 +134,17 @@ function plex:get_plex(query)
pic = nil pic = nil
end end
local text = title..tag..from..origtitle..studio..date..episodes..fsk..duration..rating..desc if data.librarySectionTitle == 'Animes' then
text = title..from..studio..'\n<b>Ausstrahlung:</b> '..date..episodes..fsk..duration..rating..desc
elseif data.librarySectionTitle == 'Cartoons' then
text = title..from..studio..'\n<b>Ausstrahlung:</b> '..date..episodes..fsk..duration..rating..desc
elseif data.librarySectionTitle == 'Filme' then
text = title..tag..origtitle..studio..'\n<b>Veröffentlicht:</b> '..date..fsk..duration..rating..desc
elseif data.librarySectionTitle == 'Musik' then
text = title..' von '..artist..'\n<b>Veröffentlicht:</b> '..date
elseif data.librarySectionTitle == 'Serien' then
text = title..from..studio..'\n<b>Ausstrahlung:</b> '..date..episodes..fsk..duration..rating..desc
end
if string.match(title, 'Local Network') then if string.match(title, 'Local Network') then
return 'Nichts gefunden!' return 'Nichts gefunden!'