summaryrefslogtreecommitdiff
path: root/lib/Multi/Anime.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-09-27 10:01:46 +0200
committerYorhel <git@yorhel.nl>2009-09-27 10:01:46 +0200
commit9d733c1d82f5b2b8013d3d921f66cc962fea8048 (patch)
tree72be2e064f5b410fe988cb7f417f143f2d63a9e4 /lib/Multi/Anime.pm
parent2c6f9360a25fd576fce5b35f3f512c05429d9d57 (diff)
Converted anime.type to ENUM and made them translatable
Again, two separate but related things.
Diffstat (limited to 'lib/Multi/Anime.pm')
-rw-r--r--lib/Multi/Anime.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Multi/Anime.pm b/lib/Multi/Anime.pm
index 03134925..df2f6424 100644
--- a/lib/Multi/Anime.pm
+++ b/lib/Multi/Anime.pm
@@ -70,6 +70,17 @@ sub spawn {
lm => 0, # timestamp of last outgoing message, 0=no running msg
aid => 0, # anime ID of the last sent ANIME command
tag => int(rand()*50000),
+ # anime types as returned by AniDB (lowercased)
+ anime_types => {
+ 'unknown' => undef, # NULL
+ 'tv series' => 'tv',
+ 'ova' => 'ova',
+ 'movie' => 'mov',
+ 'other' => 'oth',
+ 'web' => 'web',
+ 'tv special' => 'spe',
+ 'music video' => 'mv',
+ },
},
);
}
@@ -224,7 +235,7 @@ sub receivepacket { # input, wheelid
$col[2] = undef if !$col[2] || $col[2] =~ /^0,/;
$col[3] = $1 if $col[3] =~ /^([0-9]+)/; # remove multi-year stuff
$col[3] = undef if !$col[3];
- $col[4] = (grep lc($VNDB::S{anime_types}[$_]) eq lc($col[4]), 0..$#{$VNDB::S{anime_types}})[0];
+ $col[4] = $_[HEAP]{anime_types}{ lc($col[4]) };
$col[5] = undef if !$col[5];
$col[6] = undef if !$col[6];
$_[KERNEL]->post(pg => do => 'UPDATE anime