10-azlyrics.pl: fix "the" stripping

This commit is contained in:
Přemysl Eric Janouch 2022-09-20 12:45:45 +02:00
parent 8aac4ae0a8
commit 568abc896c
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 2 additions and 2 deletions

View File

@ -20,8 +20,8 @@ my ($title, $artist, $album) = map {decode_utf8($_)} @ARGV;
# TODO: An upgrade would be transliteration with, e.g., Text::Unidecode. # TODO: An upgrade would be transliteration with, e.g., Text::Unidecode.
use Unicode::Normalize; use Unicode::Normalize;
$artist = lc(NFD($artist) =~ s/^the\s+//ir =~ s/[^A-Za-z0-9]//gr); $artist = lc(NFD($artist)) =~ s/^the\s+//ir =~ s/[^a-z0-9]//gr;
$title = lc(NFD($title) =~ s/\(.*?\)//gr =~ s/[^A-Za-z0-9]//gr); $title = lc(NFD($title)) =~ s/\(.*?\)//gr =~ s/[^a-z0-9]//gr;
# TODO: Consider caching the results in a location like # TODO: Consider caching the results in a location like
# $XDG_CACHE_HOME/nncmpp/info/azlyrics/$artist-$title # $XDG_CACHE_HOME/nncmpp/info/azlyrics/$artist-$title