Desktop: smart playlists can only AND their rules — no OR #35

Closed
opened 2026-08-18 05:56:10 +00:00 by logan · 0 comments
Collaborator

Report

The smart playlist creator only seems to do AND. I wanted a playlist drawing on several genres, and there is no way to express "genre is X OR genre is Y".

Findings

Confirmed in the backend: backend/smartplaylist/smartplaylist.go:182return strings.Join(conditions, " AND "), args, nil. The conjunction is hardcoded; there is no match-type on the rule set and no grouping.

Direction

Two levels, and the first probably suffices:

  1. Match all / match any — a matchType on the playlist, joined with AND or OR. One schema field, one join change, one radio in smart-playlist-editor.
  2. Rule groups — nested groups each with their own conjunction. Much more UI, and only worth it if 1 proves insufficient.

Either way: a multi-valued field needs care. Genre is a genuine many-to-many (file_genres), so "genre is any of (X, Y)" is better expressed as an IN on one rule than as two OR'd rules — consider an "is one of" operator for genre alongside the match-type work. Also remember a query file must be ASCII (sqlc rewrites by byte offset) and that this builder emits raw SQL rather than sqlc queries.

**Report** The smart playlist creator only seems to do AND. I wanted a playlist drawing on several genres, and there is no way to express "genre is X OR genre is Y". **Findings** Confirmed in the backend: `backend/smartplaylist/smartplaylist.go:182` — `return strings.Join(conditions, " AND "), args, nil`. The conjunction is hardcoded; there is no match-type on the rule set and no grouping. **Direction** Two levels, and the first probably suffices: 1. **Match all / match any** — a `matchType` on the playlist, joined with `AND` or `OR`. One schema field, one join change, one radio in `smart-playlist-editor`. 2. **Rule groups** — nested groups each with their own conjunction. Much more UI, and only worth it if 1 proves insufficient. Either way: a multi-valued field needs care. Genre is a genuine many-to-many (`file_genres`), so "genre is any of (X, Y)" is better expressed as an `IN` on one rule than as two OR'd rules — consider an "is one of" operator for genre alongside the match-type work. Also remember a query file must be ASCII (sqlc rewrites by byte offset) and that this builder emits raw SQL rather than sqlc queries.
yonlu was assigned by logan 2026-08-18 15:32:38 +00:00
logan closed this issue 2026-08-18 16:18:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yonlu/yellowjacket#35