summaryrefslogtreecommitdiff
path: root/lib/Multi/Anime.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-09-11 19:52:44 +0200
committerYorhel <git@yorhel.nl>2019-09-11 19:52:44 +0200
commit794806518f18bfb5470a785bb47ca799f11679b3 (patch)
tree63be39090829a890f9a95d2397d12635bcaab31b /lib/Multi/Anime.pm
parent26c2f1290468309e69d3139842481920e79cd5bc (diff)
VNDB::Types: Convert vn_lengths, anime_types and tag_categories
Diffstat (limited to 'lib/Multi/Anime.pm')
-rw-r--r--lib/Multi/Anime.pm14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/Multi/Anime.pm b/lib/Multi/Anime.pm
index f189286e..d286a657 100644
--- a/lib/Multi/Anime.pm
+++ b/lib/Multi/Anime.pm
@@ -11,6 +11,7 @@ use Multi::Core;
use AnyEvent::Socket;
use AnyEvent::Util;
use Encode 'decode_utf8', 'encode_utf8';
+use VNDB::Types;
sub LOGIN_ACCEPTED () { 200 }
@@ -57,17 +58,6 @@ my %C = (
lm => 0, # timestamp of last outgoing message
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',
- },
);
@@ -245,7 +235,7 @@ sub update_anime {
$col[1] = undef if !$col[1];
$col[2] = undef if !$col[2] || $col[2] =~ /^0,/;
$col[3] = $col[3] =~ /^([0-9]+)/ ? $1 : undef;
- $col[4] = $O{anime_types}{ lc($col[4]) };
+ ($col[4]) = grep lc($col[4]) eq lc($ANIME_TYPE{$_}{anidb}), keys %ANIME_TYPE;
$col[5] = undef if !$col[5];
$col[6] = undef if !$col[6];