+
+ return 0;
+ }
+
+ if ( $cmd eq 'list-unwanted-albums' ) {
+ die "This command has no arguments\n" if @args;
+ $self->set_db_needs_update(0);
+ my $count = $self->db->walk_unwanted_albums(
+ sub ( $album, $artist ) { say "«$album» by «$artist»" } );
+ say "Total unwanted albums: $count";
+
+ return 0;
+ }
+
+ if ( $cmd eq 'one-shot' ) {
+ die "one-shot command accepts no arguments\n" if @args;
+
+ $self->queue_songs( undef, sub {$self->mpd->loop->stop} );
+ $self->mpd->loop->run;
+ return 0;
+ }
+ elsif ( $cmd eq 'single' ) {
+ die "single command accepts no arguments\n" if @args;
+
+ $self->queue_songs( 1, sub {$self->mpd->loop->stop} );
+ $self->mpd->loop->run;
+ return 0;
+ }
+ else {
+ die "Unknown command '$cmd'";