FSK "Umrechner"

This commit is contained in:
Akamaru 2016-02-26 22:45:34 +01:00
parent c557d11da2
commit 1924eddeaa
2 changed files with 19 additions and 4 deletions

View File

@ -579,6 +579,21 @@ function unescape(str)
return str
end
function gerRating(str)
str = string.gsub(str, "de/0", "FSK0")
str = string.gsub(str, "G %- All Ages", "FSK0")
str = string.gsub(str, "de/6", "FSK6")
str = string.gsub(str, "PG %- Children", "FSK6")
str = string.gsub(str, "de/12", "FSK12")
str = string.gsub(str, "de/16", "FSK16")
str = string.gsub(str, "PG%-13 %- Teens 13 or older", "FSK16")
str = string.gsub(str, "de/18", "FSK18")
str = string.gsub(str, "R %- 17%+ %(violence & profanity%)", "FSK18")
str = string.gsub(str, "R%+ %- Mild Nudity", "FSK18")
str = string.gsub(str, "Rx %- Hentai", "FSK18")
return str
end
-- See http://stackoverflow.com/a/14899740
function unescape_html(str)
local map = {

View File

@ -68,7 +68,7 @@ local data = json:decode(table.concat(response_body))._children[1]
end
if data.contentRating then
fsk = '\nAltersfreigabe: '..data.contentRating
fsk = '\nAltersfreigabe: '..gerRating(data.contentRating)
else
fsk = ''
end
@ -111,9 +111,9 @@ local function run(msg, matches)
end
return {
description = "",
usage = "",
patterns = {"^/plex (.*)$"},
description = "Suche für Plex Media Server",
usage = "/plex [BEGRIFF]",
patterns = {"^/[Pp][Ll][Ee][Xx] (.*)$"},
run = run
}