Skip to content

Commit

Permalink
Use group names from original filename if AniDB doesn't return one
Browse files Browse the repository at this point in the history
  • Loading branch information
tcallan committed Apr 16, 2021
1 parent e57e07e commit 693f502
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions adbren.pl
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ sub CLEANUP {
$src = "[" . $src . "]";
}
$fileinfo->{'source'} = $src;

# Grab group name from the file if something sane doesn't come back from anidb
my $group = $fileinfo->{'group_short'};
if ( $group eq "raw" or $group eq "" ) {
if ($filename =~ /\[([^\[]*)\]/) {
print "Using group from file ($1) instead of group from anidb ($group)\n";
$group = $1;
}
}
$fileinfo->{'group_short'} = $group;

$newname =~ s/\%orginal_name\%/$filename/xmsig;
while ( $newname =~ /\%([^\%]+)\%/ ) {
my $key = $1;
Expand Down

0 comments on commit 693f502

Please sign in to comment.