8 use App::MPD::Feeder::Options;
10 use Log::Any::Adapter Stderr => log_level => 'error';
12 my $feeder = Feeder->new();
15 my $cmd = shift @ARGV;
17 if ($cmd eq 'dump-config') {
18 die "dump-config command accepts no arguments\n" if @ARGV;
24 if ( $cmd eq 'add-unwanted-artist' ) {
25 die "Missing command arguments\n" unless @ARGV;
26 $feeder->set_db_needs_update(0);
27 for my $artist (@ARGV) {
28 if ( $feeder->db_add_unwanted_artist($artist) ) {
29 $log->info("Artist '$artist' added to the unwanted list\n");
32 $log->warn("Artist '$artist' already in the unwanted list\n");
38 if ( $cmd eq 'del-unwanted-artist' ) {
39 die "Missing command arguments\n" unless @ARGV;
40 $feeder->set_db_needs_update(0);
41 for my $artist (@ARGV) {
42 if ( $feeder->db_del_unwanted_artist($artist) ) {
43 $log->info("Artist '$artist' deleted from the unwanted list\n");
46 $log->warn("Artist '$artist' is not in the unwanted list\n");
52 if ( $cmd eq 'add-unwanted-album' ) {
53 die "NOT IMPLEMENTED\n";
56 if ( $cmd eq 'one-shot' ) {
57 die "one-shot command accepts no arguments\n" if @ARGV;
59 $feeder->queue_songs(undef, sub { exit });
60 $feeder->mpd->loop->run;
62 elsif ( $cmd eq 'single' ) {
63 die "single command accepts no arguments\n" if @ARGV;
65 $feeder->queue_songs(1, sub { exit });
66 $feeder->mpd->loop->run;
69 die "Unknown command '$cmd'";