9 use Log::Any::Adapter Stderr => log_level => 'error';
11 { # autoflush without IO::Handle
12 my $fh = select STDERR;
17 my $feeder = App::MPD::Feeder->new();
20 require App::MPD::Feeder::Command;
21 bless $feeder, 'App::MPD::Feeder::Command';
23 exit $feeder->run(@ARGV);
34 mpd-feeder -- MPD playlist manager with emphasys on diversity
38 Engage daemon mode, keeping the MPD playlist full:
40 mpd-feeder [I<option>...]
42 Perform a single command and return:
44 mpd-feeder [I<option>...] I<command>
48 C<mpd-feeder> keeps the playlist of MPD full with songs, avoiding songs,
49 artists and albums that have been queued recently. This can be used for
50 listening to large song collections without repetitions that happen with random
51 shuffling or when a given artist has many more songs that the rest.
53 The song list is stored in a PostgreSQL database that is kept updated
54 automatically as the MPD database is updated.
56 The timespans for "recent" queueing are configurable.
60 In daemon mode (with no command given), C<mpd-feeder> connects to MPD, updates
61 its local copy of the song database and makes sure that the playlist never has
62 fewer songs than the configured minimum. Playlist changes are detected when
65 When a command is given, C<mpd-feeder> does not engage in daemon mode, but returns
66 to the OS after execution.
70 Prints configuration file contents on standard output. Can be used to create
71 skeleton F<mpd-feeder.conf>. Makes no connection to MPD or PostgreSQL.
73 =head2 add-unwanted-artist I<artist name>
75 Adds one artist to toe list of unwanted artists. That list is consulted when a
76 new song needs to be added to MPD's playlist and songs by artists in it are
79 =head2 del-unwanted-artist I<artist name>
81 The reverse of C<add-unwanted-artist>.
83 =head2 list-unwanted-artists
85 Prints the contents of the unwanted artist list, one per line.
87 =head2 add-unwanted-album I<album name> by I<artist name>
89 =head2 del-unwanted-album I<album name> by I<artist name>
91 =head2 list-unwanted-albums
93 Manupulate the list of unwanted albums. Useful when there is an album you don't
94 want to listen to, but you still want to hear other albums by the same artist.
98 Connects to MPD, and if the playlist is below the configured minimum, adds some
103 Adds one song to the playlist. Ignores the configured minimum.
109 =item B<--log-level> I<trace|debug|info|notice|warning|error|critical|alert|emergency>
111 Set log verbosity. C<trace> is most talkative, including all exchanges with MPD.
113 =item B<--skip-db-update>
115 Skips the startup sync of the song database from MPD.
117 =item B<--tql> I<number>
119 =item B<--target-queue-length> I<number>
121 Sets the wanted playlist length.
123 =item B<--mpd-host> I<hostname>
125 =item B<--mpd-port> I<number>
127 Parameters for connecting to MPD.
129 =item B<--db-path> I<DSN>
131 =item B<--db-user> I<username>
133 Parameters for connecting to PostgreSQL.
135 =item B<--min-album-interval> I<duration>
137 =item B<--min-song-interval> I<duration>
139 =item B<--min-artist-interval> I<duration>
141 Tunes the minimum time between adding songs from the same album/artist and
142 before re-adding the same song.
144 I<duration> is a text duration, recognised by L<Time::Duration::Parse>.
148 =head1 CONFIGURATION FILE
150 =head1 COPYRIGHT & LICENSE
152 Copyright © 2021 Damyan Ivanov L<dam+mpdfeeder@ktnx.net>
154 This program is free software; you can redistribute it and/or modify it under
155 the terms of the GNU General Public License version 2 as published by the Free
158 This program is distributed in the hope that it will be useful, but WITHOUT ANY
159 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
160 PARTICULAR PURPOSE. See the GNU General Public License for more details.
162 You should have received a copy of the GNU General Public License along with
163 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
164 Street, Fifth Floor, Boston, MA 02110-1301 USA.