Skip to content

Commit

Permalink
Unify filtering for content types to make things more readable.
Browse files Browse the repository at this point in the history
Update Changelog.
  • Loading branch information
michaelherger committed Nov 25, 2024
1 parent e7efd53 commit a1e9c28
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changelog9.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ <h2><a name="v9.0.0" id="v9.0.0"></a>Introducing... Lyrion Music Server Version
<li><a href="https://github.com/LMS-Community/slimserver/pull/1146">#1146</a> - Restore partial Cometd support for CLI clients (thanks @sodface!)</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1203">#1203</a> - Fix display of album roles in the playlist (thanks @darrel-k!)</li>
<li><a href="https://github.com/LMS-Community/slimserver/issues/1213">#1213</a> - Modify #CURRTRACK to first track when playlist finishes</li>
<li><a href="https://github.com/LMS-Community/slimserver/pull/1229">#1229</a> - Only allow audio tracks for RandomPlay (thanks @jbylsma!)</li>
</ul>
<br />

Expand Down
2 changes: 1 addition & 1 deletion Slim/Control/Queries.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4535,7 +4535,7 @@ sub titlesQuery {
$tags = $tagsprm if defined $tagsprm;

my $collate = Slim::Utils::OSDetect->getOS()->sqlHelperClass()->collate();
my $where = '(tracks.content_type != "cpl" AND tracks.content_type != "src" AND tracks.content_type != "ssp" AND tracks.content_type != "dir" ';
my $where = '(tracks.audio = 1 AND tracks.content_type NOT IN ("cpl", "src", "ssp", "dir") ';
$where .= $ignoreWorkTracks ? 'AND tracks.work IS NULL)' : ')';
my $order_by = "tracks.titlesort $collate";

Expand Down
2 changes: 1 addition & 1 deletion Slim/Plugin/RandomPlay/Mixer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ sub getIdList {
# it's messy reaching that far in to Slim::Control::Queries, but it's >5x faster on a Raspberry Pi2 with 100k tracks than running the full "titles" query
my $results;
($results, $idList) = Slim::Control::Queries::_getTagDataForTracks( 'II', {
where => '(tracks.audio = 1 AND tracks.content_type != "cpl" AND tracks.content_type != "src" AND tracks.content_type != "ssp" AND tracks.content_type != "dir")',
where => '(tracks.audio = 1 AND tracks.content_type NOT IN ("cpl", "src", "ssp", "dir"))',
year => $type eq 'year' && getRandomYear($client, $filteredGenres),
genreId => $queryGenres,
libraryId => $queryLibrary,
Expand Down
2 changes: 1 addition & 1 deletion Slim/Web/Pages/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ sub advancedSearch {
my $prefix = Slim::Music::Import->lastScanTime() . '_advSearch_';

if ( !($params->{'fileTypes'} = $cache->get($prefix . 'ctList')) ) {
foreach my $ct ( @{ $dbh->selectcol_arrayref('SELECT DISTINCT content_type FROM tracks WHERE audio = 1 AND tracks.content_type != "cpl" AND tracks.content_type != "src" AND tracks.content_type != "ssp" AND tracks.content_type != "dir"') } ) {
foreach my $ct ( @{ $dbh->selectcol_arrayref('SELECT DISTINCT content_type FROM tracks WHERE audio = 1 AND tracks.content_type NOT IN ("cpl", "src", "ssp", "dir")') } ) {
$params->{'fileTypes'} ||= {};
$params->{'fileTypes'}->{lc($ct)} = string(uc($ct));
}
Expand Down

0 comments on commit a1e9c28

Please sign in to comment.