Skip to content

Commit

Permalink
Merge pull request #742 from Asinin3/dev
Browse files Browse the repository at this point in the history
Filter more credit pages & move covers to start
  • Loading branch information
Difegue authored Feb 5, 2023
2 parents 8702bc7 + 9895ed7 commit a9a81fd
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/LANraragi/Utils/Archive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,14 @@ sub get_filelist {

@files = sort { &expand($a) cmp &expand($b) } @files;

# Move any pages containing "credit" to the end of the array.
my @credit_pages = grep { /credit/i } @files;
my @non_credit_pages = grep { !/credit/i } @files;
@files = ( @non_credit_pages, @credit_pages );

# Move front cover pages to the start of a gallery, and miscellaneous pages such as translator credits to the end.
my @cover_pages = grep { /^(?!.*(back|end|rear|recover|discover)).*cover.*/i } @files;
my @credit_pages = grep { /^end_card_save_file|notes\.[^\.]*$|note\.[^\.]*$|^artist_info|credit|999nhnl\./i } @files;
# Get all the leftover pages
my %credit_hash = map { $_ => 1 } @credit_pages;
my %cover_hash = map { $_ => 1 } @cover_pages;
my @other_pages = grep { !$credit_hash{$_} && !$cover_hash{$_} } @files;
@files = ( @cover_pages, @other_pages, @credit_pages );
# Return files and sizes in a hashref
return ( \@files, \@sizes );
}
Expand Down

0 comments on commit a9a81fd

Please sign in to comment.