<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Add "contains delimited" operator to Smart Playlists]]></title><description><![CDATA[<p dir="auto">I've seen a few discussions about improving Smart Playlists to support more flexible AND/OR logic. I've wanted this functionality myself, so I experimented with a relatively simple enhancement that seems to offer much of that flexibility without requiring a redesign of the existing Smart Playlist interface.</p>
<p dir="auto"><strong>The idea</strong></p>
<p dir="auto">Add a new "contains delimited" operator alongside the existing "contains", "equals", etc. operators.</p>
<p dir="auto">This would allow multiple pipe-separated values within a single rule, treating those values as an OR condition.</p>
<p dir="auto"><strong>For example, a Smart Playlist using Match ALL (AND) could contain:</strong></p>
<p dir="auto">Genre     contains delimited    Rock|Country<br />
Grouping  contains delimited    Classic|Alternative<br />
Comment   contains delimited    Workout|Exercise</p>
<p dir="auto">Internally, these rules would generate SQL equivalent to:</p>
<p dir="auto">WHERE<br />
(genre LIKE '%Rock%' OR genre LIKE '%Country%')<br />
AND<br />
(grouping LIKE '%Classic%' OR grouping LIKE '%Alternative%')<br />
AND<br />
(comment LIKE '%Workout%' OR comment LIKE '%Exercise%')</p>
<p dir="auto"><strong>Why I think this would be useful</strong></p>
<p dir="auto">The primary advantage isn't simply searching for multiple values. It's the ability to create independent OR groups within an overall AND-based Smart Playlist.</p>
<p dir="auto">This offers significantly more flexible filtering while preserving the existing rule-building GUI and its global AND/OR selection.</p>
<p dir="auto">The implementation also appends a new operator enum value without changing existing values, so previously saved operators retain their original identifiers.</p>
<p dir="auto"><strong>Implementation and testing</strong></p>
<p dir="auto">I'm not an experienced C++ developer, but with AI assistance, I put together a patch against the Strawberry 1.2.31 source code.</p>
<p dir="auto">I've successfully:</p>
<p dir="auto">Applied the patch to a clean 1.2.31 source checkout.</p>
<p dir="auto">Compiled and installed the modified Strawberry application on Linux Mint 22.3.</p>
<p dir="auto">Tested the new operator with several combinations of delimited values.</p>
<p dir="auto">Verified that the operator behaves as expected in actual Smart Playlists.</p>
<p dir="auto">The patch modifies only two source files:</p>
<p dir="auto"><em>src/smartplaylists/smartplaylistsearchterm.h</em></p>
<p dir="auto"><em>src/smartplaylists/smartplaylistsearchterm.cpp</em></p>
<p dir="auto">I've linked the patch below in case it's useful as a starting point for an official implementation.</p>
<p dir="auto">I recognize that AI-assisted code may need review or refinement before being incorporated upstream, and the patch targets 1.2.31 rather than the current development branch.</p>
<p dir="auto">I'm sharing it in the hope that this relatively simple enhancement might be worth considering for Strawberry itself.</p>
<pre><code>https://files.catbox.moe/4s496i.patch
</code></pre>
<p dir="auto">Thanks for all the work on Strawberry!</p>
]]></description><link>https://forum.strawberrymusicplayer.org/topic/6112/add-contains-delimited-operator-to-smart-playlists</link><generator>RSS for Node</generator><lastBuildDate>Tue, 24 Nov 2026 06:26:35 GMT</lastBuildDate><atom:link href="https://forum.strawberrymusicplayer.org/topic/6112.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 23 Nov 2026 21:16:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Add "contains delimited" operator to Smart Playlists on Tue, 24 Nov 2026 03:02:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jamesjones" aria-label="Profile: jamesjones">@<bdi>jamesjones</bdi></a></p>
<p dir="auto">Those are good points.</p>
<p dir="auto">Some of those cases are already addressed in the linked patch, while others could definitely use some refinement.</p>
<p dir="auto"><strong>Empty values</strong>: The current implementation splits on |, trims whitespace, and explicitly skips empty values. So Rock||Country behaves the same as Rock|Country, and a completely empty list won't generate a match-everything condition.</p>
<p dir="auto"><strong>Substring matching</strong>: I intentionally kept the behavior consistent with the existing <strong>contains</strong> operator. For example, searching for Rock would also match Classic Rock, Hard Rock, etc.</p>
<p dir="auto">In my own music library, I've worked around that limitation by formatting multi-value Genre tags like this:</p>
<p dir="auto">"; Rock ; Country ; Alternative Rock ;"</p>
<p dir="auto">That allows me to search for "; Rock ;|; Country ;" and match individual genre values rather than arbitrary substrings. It's admittedly a library-specific convention, but it works well for my purposes.</p>
<p dir="auto"><strong>Escaping</strong>: You're right about %, _, and literal delimiters. Those aren't explicitly handled in the current patch and would be worth addressing.</p>
<p dir="auto"><strong>Case sensitivity</strong>: My intention was to retain the same behavior as Strawberry's existing <strong>contains</strong> operator. I agree that this should be verified, particularly for non-ASCII characters.</p>
<p dir="auto"><strong>Operator compatibility</strong>: I appended the new operator enum value rather than inserting it among existing values, preserving their original IDs. Compatibility with older Strawberry versions encountering the new operator is worth considering separately.</p>
<p dir="auto"><strong>Background</strong>: This was an AI-assisted proof of concept, and my initial goal was to see whether this relatively simple approach was viable. I borrowed the idea from Rockbox while working on its playlist configuration, where I discovered the @~ operator, which provides similar pipe-delimited matching functionality.</p>
<p dir="auto">I've successfully compiled and tested the patch against Strawberry 1.2.31 with my own music collection, but haven't added automated tests or tried it against the current development branch.</p>
]]></description><link>https://forum.strawberrymusicplayer.org/post/9486</link><guid isPermaLink="true">https://forum.strawberrymusicplayer.org/post/9486</guid><dc:creator><![CDATA[dtw_2000]]></dc:creator><pubDate>Tue, 24 Nov 2026 03:02:34 GMT</pubDate></item><item><title><![CDATA[Reply to Add "contains delimited" operator to Smart Playlists on Tue, 24 Nov 2026 02:24:38 GMT]]></title><description><![CDATA[<p dir="auto">This sounds useful, especially for keeping AND-based playlists while adding independent OR groups. One implementation detail worth covering is escaping values before building LIKE patterns: %, _, and the delimiter itself should be handled explicitly, and empty tokens such as Rock||Country should probably be ignored rather than matching everything. It would also help to define case sensitivity and add tests for escaping and operator enum compatibility before opening a PR against the current branch.</p>
]]></description><link>https://forum.strawberrymusicplayer.org/post/9485</link><guid isPermaLink="true">https://forum.strawberrymusicplayer.org/post/9485</guid><dc:creator><![CDATA[jamesjones]]></dc:creator><pubDate>Tue, 24 Nov 2026 02:24:38 GMT</pubDate></item></channel></rss>