After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 352637 - automatic playlist editor cannot edit general boolean combinations
automatic playlist editor cannot edit general boolean combinations
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: User Interface
0.9.5
Other Linux
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 621784 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-24 05:48 UTC by Colin Macdonald
Modified: 2018-05-24 11:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Colin Macdonald 2006-08-24 05:48:09 UTC
Motivation: I wanted to make an automatic playlist with:
 (genre==metal || genre==rock) && (rating >= 3)

I couldn't do this with the automatic playlist dialog because it can only do either A&&B&&..&&Z or A||B||..||Z but not more general combinations of boolean operators.

I looked in the playlist.xml file and tried modifying it directly:
<playlist name="Hip-hop (top rated)" type="automatic" sort-key="Artist" sort-direction="0">
    <conjunction>
      <equals prop="type">song</equals>
      <subquery>
        <conjunction>
          <like prop="genre-folded">hip</like>
          <disjunction/>
          <like prop="genre-folded">rap</like>
        </conjunction>
      </subquery>
      <subquery>
        <conjunction>
          <greater prop="rating">3.000000</greater>
        </conjunction>
      </subquery>
    </conjunction>
  </playlist>

In this case, it is supposed to match hip-hop or rap, rated >=3.  And it works!

Back in rhythmbox, if I try to edit the automatic playlist I get the following warning:
(rhythmbox:15105): Rhythmbox-CRITICAL **: rb_query_creator_load_query: assertion `query->len == 2' failed
sys:1: Warning: invalid (NULL) pointer instance
sys:1: Warning: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
sys:1: GtkWarning: gtk_window_present_with_time: assertion `GTK_IS_WINDOW (window)' failed
sys:1: GtkWarning: widget `GtkTable' isn't suitable for mnemonic activation

Very cool! (I figured it would just crash.)

I suppose a GUI that could handle very general cases might be too complicated.  However, it seems to me that users might commonly want to be able to create the sort of playlist that I wanted.

My only suggestion would be to allow the user to edit the xml structure directly through an "advanced" button.

At the very least, if a user does manually edit the xml file, there should be a popup dialog that says "this playlist cannot be edited within Rhythmbox" or something like that when the query->len == 2 assertion fails.
Comment 1 Alex Lancaster 2006-08-24 06:39:57 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

This is a known issue, there is (probably outdated) patch on bug #320243 that might help.   As you say the problem is the developing a GUI that could handle the different possible conditions.  Closing as a duplicate.

*** This bug has been marked as a duplicate of 320243 ***
Comment 2 Jonathan Matthew 2006-08-24 09:23:00 UTC
Bug 320243 is about the search box, not the query editor.
Comment 3 Alex Lancaster 2006-08-24 10:42:58 UTC
So it is.  Hmm, I was sure that there was an open bug on this in the auto playlist context, it could have been discussed under some other bug.

Either way, they are both related because currently the query engine handles these more complex queries, but we currently have no way of exposing that to the user (either via the search box or the auto playlist editors).
Comment 4 Alex Lancaster 2006-08-24 10:55:18 UTC
If there was a way of converting the XML representation back to the format (and  used in the rhythmdb_query_to_string() and from this representation back to XML then maybe the query box could be toggled to display a user-editable text representation like:

"(artist =~ foo) || (genre != bar)"

Of course that would need to be parsed, and the parser would refuse to save syntatically incorrect queries.  For already created playlists, it would open up the query in the regular GUI window only if it was simple enough to be represented that way, otherwise it would show the above representation.

Anyway, simple enough conceptually but would probably be a considerable amount of work.  I don't think editing the XML directly would be a good idea though.
Comment 5 Colin Macdonald 2006-08-24 18:08:39 UTC
Re: comment #4.  If we're going to do all that, why bother with the XML syntax at all?  Why not save the queries in the format you suggest or as regex's or as SQL queries or whatever?
Comment 6 Alex Lancaster 2006-08-25 03:52:09 UTC
Because it ultimately needs to be translated into format like XML to be parsed, plus the serialisation/deserialisation code is already written.  The syntax I propose is already used in debugging and is human readable/typeable in a way that the XML is not.  From what I can tell of the code, syntax is already isomorphic to the existing XML and converting from one to the other shouldn't be too much of a problem.  

Jonathan Matthew or James Livingston, who are the primary maintainers should be able to say more than I can. (I'm not an official developer, just a tester and occasional patch contributor and I still learning the code).
Comment 7 Serrano Pereira 2010-03-13 23:55:46 UTC
I can't believe this feature hasn't been implemented yet. I think the idea proposed by Alex in comment #4 would be the best solution. 

I'm craving for this functionality so much that I'm actually willing to create a patch myself. If only I knew where to start..

Can anyone tell me if there has been any progress on this issue?
Comment 8 Jonathan Matthew 2010-03-13 23:57:42 UTC
There has been no progress on this.  No one is working on it.
Comment 9 Jonathan Matthew 2010-06-16 16:22:35 UTC
*** Bug 621784 has been marked as a duplicate of this bug. ***
Comment 10 GNOME Infrastructure Team 2018-05-24 11:47:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/229.