Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1628 from AlbinoDrought/bugfix/1627/dynamic-inclu…
Browse files Browse the repository at this point in the history
…de-unrated

Fix #1627: Check for includeUnrated in Dynamic Playlists with rating and include rules
  • Loading branch information
CDrummond authored Jul 30, 2020
2 parents d0542f6 + bf09a33 commit 55402d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions playlists/cantata-dynamic
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,7 @@ sub readRules() {
}
}
} elsif ($key=~ m/^(IncludeUnrated)/) {
if ($val > 0) {
$includeUnrated = $val eq "true";
}
$includeUnrated = $val eq "true";
} elsif ($key=~ m/^(Duration)/) {
my @vals = split("-", $val);
if (scalar(@vals)==2) {
Expand Down Expand Up @@ -681,6 +679,9 @@ sub checkSongRatingInRange() {
}
my $file=shift;
my @entries = &getEntries("sticker get song \"${file}\" rating", 'sticker');
if (@entries == 0 && $includeUnrated == 1) { # Song has no ratings, and unrated songs are included!
return 1;
}
foreach my $entry (@entries) {
if (1==&songRatingInRange($entry)) {
return 1;
Expand Down

0 comments on commit 55402d8

Please sign in to comment.