MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance.
Nightingale Forums - Nested rules for smart playlists

Nightingale Forums

Full Version: Nested rules for smart playlists
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It would be useful to be able to set smart playlists like so:

List where ((genre = Rap || genre = Hip Hop) && (year < 1994))

Would it be possible to create nested conditions like this?
The playlist rules are converted into SQL statements, which are then ran against the database. Doing nested logic is pretty complicated, at least from what I've learned about SQL.
(12-15-2015, 04:25 AM)freaktechnik Wrote: [ -> ]The playlist rules are converted into SQL statements, which are then ran against the database. Doing nested logic is pretty complicated, at least from what I've learned about SQL.

I don't think SQL is the problem here. Imho the user interface would be hard to get right (unless, of course, we let the user enter his own SQL -- but then we present some internal logic as well, as fields are not simply columns in a table, etc.).

You can, however, nest playlists. So it is possible to create a playlist for "(genre = Rap || genre = Hip Hop)" and then one for "(in first playlist && year < 1994)" -- which, of course, has various drawbacks (automatic updates not working over two layers iirc, and some smaller issues).
Right, I was going to mention that you can accomplish this by matching an existing playlist. So in terms of functionality, if there was a way to have nested rules, and just use create two playlists, hiding one, maybe that would do the trick.

So automatic updates won't work over two layers? What if I update the second playlist manually? Sometimes I do this by editing the playlist, leaving the rules intact and then saving.
(12-17-2015, 03:06 PM)3×5 Wrote: [ -> ]So automatic updates won't work over two layers? What if I update the second playlist manually? Sometimes I do this by editing the playlist, leaving the rules intact and then saving.

Iirc the issue is that the first playlist is not updated. So you'd need to manually update the first playlist to get a correct second playlist -- that would not be possible if the first playlist is hidden, unless one disables dynamic updates in general (as a manual refresh could trigger a refresh of all child playlists).

So it would in theory be possible for an add-on to provide that behavior, but I'd prefer not to touch the core on this one except if solving the issue properly Wink