LANraragi
LANraragi copied to clipboard
fakku metadata plugin
Some books that can be acquired in various ways are most often named like so:
[Artist] Title (img resolution) [Publisher]
Because the search results are most accurate when only the Title is given i added 2 new filters to get rid of
~~[Artist]~~ Title ~~(img resolution)~~ ~~[Publisher]~~ making it a lot more accurate.
here is the script i used to test with, i didn't bother to remove spaces as it didn't seem to affect the search results but might as well do that too. Tested on a few hundred archives and it was close to 95% accurate with the only problems coming from works with multiple works but the same name like "Title 1" Title 2", but that's a limitation of the search not the plugin.
#! /usr/bin/perl
use v5.36.0;
my $title = "[Artist] Title (img resolution) [Publisher]";
$title =~ s/ -|'\w*|~|!|@//g;
# Removes everything inside [ ] as well as the brackets themselves
$title =~ s/\[([^\[\]]|(?0))*]//g;
# Removes everything inside () as well as the parentheses themselves
$title =~ s/\(.*$//g;
say $title;