Subject: | please allow using mpd-dynamic without a ratings.db |
Before mpd-dynamic was simplified in v2.001, it was possible to use without a ratings.db, whereas now it will discard all tracks that do not have a rating. See https://bugs.debian.org/823246 for a request to bring back this functionality. A naive way to so could be
--- a/bin/mpd-dynamic
+++ b/bin/mpd-dynamic
@@ -68,12 +68,17 @@ while (1) { # endless loop
die "Please set up mpd's audio collection before running mpd-dynamic"
unless @files;
- my @oksongs =
- shuffle
- grep { $ratings{$_} >= $ARGV{min} }
- grep { $ratings{$_} != 0 }
- grep { exists $ratings{$_} }
- @files;
+ my @oksongs;
+ if ($istied) {
+ @oksongs =
+ shuffle
+ grep { $ratings{$_} >= $ARGV{min} }
+ grep { $ratings{$_} != 0 }
+ grep { exists $ratings{$_} }
+ @files;
+ } else {
+ @oksongs = shuffle @files;
+ }
my @newones = splice @oksongs, 0, $new;
foreach my $path (@newones) {
my $song = encode('utf-8', $path);