Skip to content

Commit

Permalink
add magazines to koromo (#824)
Browse files Browse the repository at this point in the history
* add magazines to koromo

* add new metadata to tests
  • Loading branch information
polak14 committed Jul 5, 2023
1 parent 9adabdc commit aaffd4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/LANraragi/Plugin/Metadata/Koromo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ sub tags_from_koromo_json {
my $tags = $hash->{"Tags"};
my $characters = $hash->{"Characters"};
my $series = $hash->{"Series"};
my $magazine = $hash->{"Magazine"};
my $parody = $hash->{"Parody"};
my $groups = $hash->{"Groups"};
my $artist = $hash->{"Artist"};
Expand Down Expand Up @@ -132,6 +133,7 @@ sub tags_from_koromo_json {

push( @found_tags, "series:" . $parody ) unless !$parody;


# Don't add bogus artist:ARRAYblabla if artist is an array
if ($artist) {
if ( ref $artist eq 'ARRAY' ) {
Expand All @@ -143,6 +145,7 @@ sub tags_from_koromo_json {
}
}

push( @found_tags, "magazine:" . $magazine ) unless !$magazine;
push( @found_tags, "language:" . $language ) unless !$language;
push( @found_tags, "category:" . $type ) unless !$type;
push( @found_tags, "source:" . $url ) unless !$url;
Expand Down
4 changes: 2 additions & 2 deletions tests/LANraragi/Plugin/Metadata/Koromo.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ note("Koromo Tests");
my %ko_tags = trap { LANraragi::Plugin::Metadata::Koromo::get_tags( "", \%dummyhash, 1 ); };

my $expected_tags =
"Teacher, Schoolgirl Outfit, Cheating, Hentai, Ahegao, Creampie, Uncensored, Condom, Unlimited, Heart Pupils, Love Hotel, series:Original Work, artist:▲ Chimaki, language:English, source:https://www.fakku.net/hentai/after-school-english_1632947200";
"Teacher, Schoolgirl Outfit, Cheating, Hentai, Ahegao, Creampie, Uncensored, Condom, Unlimited, Heart Pupils, Love Hotel, series:Original Work, artist:▲ Chimaki, magazine:Comic Bavel 2021-11, language:English, source:https://www.fakku.net/hentai/after-school-english_1632947200";
is( $ko_tags{title}, "After School", "Koromo parsing test 1/2" );
is( $ko_tags{tags}, $expected_tags, "Koromo parsing test 2/2" );
}
Expand All @@ -63,7 +63,7 @@ note("multiple artists json");
my %ko_tags = trap { LANraragi::Plugin::Metadata::Koromo::get_tags( "", \%dummyhash, 1 ); };

my $expected_tags =
"Teacher, Schoolgirl Outfit, Cheating, Hentai, Ahegao, Creampie, Uncensored, Condom, Unlimited, Heart Pupils, Love Hotel, series:Original Work, artist:First, artist:Second, language:English, source:https://www.fakku.net/hentai/after-school-english_1632947200";
"Teacher, Schoolgirl Outfit, Cheating, Hentai, Ahegao, Creampie, Uncensored, Condom, Unlimited, Heart Pupils, Love Hotel, series:Original Work, artist:First, artist:Second, magazine:Comic Bavel 2021-11, language:English, source:https://www.fakku.net/hentai/after-school-english_1632947200";
is( $ko_tags{title}, "After School", "Koromo parsing test 1/2" );
is( $ko_tags{tags}, $expected_tags, "Koromo parsing test 2/2" );
}
Expand Down

0 comments on commit aaffd4b

Please sign in to comment.