use strict;
use warnings;
use utf8;
+use feature 'say';
use Log::Any qw($log);
use Object::Pad;
die "Missing command arguments\n" unless @args;
$self->set_db_needs_update(0);
for my $artist (@args) {
- if ( $self->db_add_unwanted_artist($artist) ) {
+ if ( $self->db->add_unwanted_artist($artist) ) {
$log->info(
"Artist '$artist' added to the unwanted list\n");
}
die "Missing command arguments\n" unless @args;
$self->set_db_needs_update(0);
for my $artist (@args) {
- if ( $self->db_del_unwanted_artist($artist) ) {
+ if ( $self->db->del_unwanted_artist($artist) ) {
$log->info(
"Artist '$artist' deleted from the unwanted list\n");
}
return 0;
}
+ if ( $cmd eq 'list-unwanted-artists' ) {
+ die "This command has no arguments\n" if @args;
+ $self->set_db_needs_update(0);
+ my $count = $self->db->walk_unwanted_artists( sub { say @_ } );
+ say "Total unwanted artists: $count";
+
+ return 0;
+ }
+
if ( $cmd eq 'add-unwanted-album' ) {
die "NOT IMPLEMENTED\n";
}