diff --git a/lib/LANraragi/Controller/Category.pm b/lib/LANraragi/Controller/Category.pm index 46a8d9b3d..a7fac8a95 100644 --- a/lib/LANraragi/Controller/Category.pm +++ b/lib/LANraragi/Controller/Category.pm @@ -21,25 +21,18 @@ sub index { $redis->quit(); - #Then complete it with the rest from the database. - #40-character long keys only => Archive IDs - my @keys = $redis->keys('????????????????????????????????????????'); - + my @idlist = LANraragi::Model::Archive::generate_archive_list; #Parse the archive list and build
  • elements accordingly. my $arclist = ""; #Only show IDs that still have their files present. - foreach my $id (@keys) { - my $zipfile = $redis->hget( $id, "file" ); - my $title = $redis->hget( $id, "title" ); - $title = redis_decode($title); - $title = xml_escape($title); - - if ( -e $zipfile ) { - $arclist .= - "
  • "; - $arclist .= "
  • "; - } + foreach my $arc (@idlist) { + my $title = xml_escape($arc->{title}); + my $id = xml_escape($arc->{arcid}); + + $arclist .= + "
  • "; + $arclist .= "
  • "; } $redis->quit();