GNOME Bugzilla – Bug 571105
WISHLIST chaining of AND and OR logic in playlists
Last modified: 2020-03-17 08:33:18 UTC
This should be a simple wishlist item to implement, I think. Basically I'd like to be able to chain together a bunch of playlist filters with different logic conditions: AND, and OR. Let me simplify. I may want to choose all songs which are have a genre of either 'Indie' or 'Rock', which is really simple to set up right now in Banshee. Simply create a Smart Playlist with these two conditions and select 'Match [ALL] of the following'. However, I also want these two conditions to be passed through a final filter of songs which are at least 2 minutes long. I can't do that. They have to be either on of 'Indie' or 'Rock' or at least 2 minutes long. Or, they can be 'Indie' and 'Rock' and at least 2 minutes long. (Which is obviously impossible; songs can not have more than one genre in the field) My suggestion is the ability to perhaps add another GUI frame (I think that's what GTK calls them, the border surrounding the 'Match [Any/All] of the following' section of the Smart Playlist editor; I have no idea what this is in Mono/Forms) and allow connection of AND & OR logic statements. There we go, rather long-winded but I like to be verbose. I hope it's simple enough to understand and translate into working code. I know this sort of thing is already doable in the filter/search box, but I would like the ability to put this logic into a Smart Playlist that I don't have to construct the filter for each time I want to use it. Alternatively I could conceive of constructing a filter in the search box and 'saving' that filter (which Banshee could simply remember as a database query I'd imagine) as a Smart Playlist. Happy Implementing! ;)
I agree completely. Several times I've wished I could create complex playlists like this, especially now with the Score category. I want a playlists with only artist1 OR artist2 OR artist3 Or artist4 AND I want all of the songs to have a score of at least 85. So there's my enthusiastic +1.
Bulk changing the assignee to banshee-maint@gnome.bugs to make it easier for people to get updated on all banshee bugs by following that address. It's usually quite apparent who is working on a given bug by the comments and/or patches attached.
I think any music player should have this functionality. It's sad to see that this feature hasn't been implemented yet. I've always wished to create complex playlists as described above. Interestingly, I was able to construct these complex filters in the search box. So the search filter already allows for the creation of complex playlists. It should be possible to save these search queries in a Smart Playlist. If you can do that, than this issue would be solved. This is an example for a search query. This matches any tracks whose genre contains "ambient", or, any tracks whose genre equals "industrial". Further restrict the search to match tracks whose rating is *also* not "1": (genre:ambient or genre==industrial) -rating=1 Would it be difficult to save queries like these as a Smart Playlist?
No, it's not hard - smart playlists can already contain arbitrarily complicated queries, but we just don't have a UI for creating/editing them yet. Long ago I started adding support for this via an alternative UI, just a search-like entry where you could type whatever you wanted, ideally with a way to switch to/from the old, visual UI (and not allowing you to if your query is too complicated). Feel free to continue this effort - see src/Libraries/Hyena.Gui/Hyena.Query.Gui/
This would be a great feature to have in banshee. +1 from me.
*** Bug 651804 has been marked as a duplicate of this bug. ***
Count my vote in for this feature as well. As a workaround you can at least base one smart playlist on another to simulate the AND + OR behaviour by using "Smart Playlist" as one of the rules of the second playlist. This can get messy with more complex rules though.
Is there a possibility to edit a smart playlist manually? Perhaps by editing the db?
(In reply to comment #8) > Is there a possibility to edit a smart playlist manually? Perhaps by editing > the db? According to comment#4, yes.
(In reply to comment #9) > (In reply to comment #8) > > Is there a possibility to edit a smart playlist manually? Perhaps by editing > > the db? > > According to comment#4, yes. I just tested this, and it works fine. I first created a regular smart playlist in Banshee. Then I extracted the smart playlist definition from the database with `sqlite`: $ sqlite ~/.config/banshee-1/banshee.db sqlite> SELECT Condition FROM CoreSmartPlaylists WHERE name='Favorite Rock'; Then manually edited the smart playlist definition in a text editor: <request><query banshee-version="1"> <and> <or> <contains><field name="genre" /><string>rock</string></contains> <contains><field name="genre" /><string>metal</string></contains> </or> <greaterThan><field name="rating" /><int>3</int></greaterThan> </and> </query></request> And finally updated the definition of the smart playlist in the database: $ sqlite ~/.config/banshee-1/banshee.db sqlite> UPDATE CoreSmartPlaylists SET Condition='<request><query banshee-version="1"><and><or><contains><field name="genre" /><string>rock</string></contains><contains><field name="genre" /><string>metal</string></contains></or><greaterThan><field name="rating" /><int>3</int></greaterThan></and></query></request>' WHERE name='Favorite Rock'; Restart Banshee and you're done. I now use this as a temporary solution until the GUI can handle complicated queries. I wanted to implement this part of the GUI myself, but I'm just too busy with school and other things.
*** Bug 666413 has been marked as a duplicate of this bug. ***
Any chance of working on the UI for this again? This is the only thing stopping me from using Banshee.
Banshee is not under active development anymore and had its last code changes more than three years ago. Its codebase has been archived. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is being shut down) if anyone takes the responsibility for active development again. See https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/264 for more info.