I have both Greatest Hits by the Offspring and Greatest Hits by Queen in my Rhythmbox library. When I sort by album, it looks like this:

enter image description here

How can I tell get rhythmbox to sort by album in such a way that it doesn't interleave albums by different artists with the same name?

  • 2
    I'm not aware of any way of doing this, however as this is a great question and I'm quite curious myself if this could be solved I'd suggest you mail this question to the Rhythmbox developers their site being here as they'll be either able to tell you a way to do it if it does already work, or tell you it doesn't and you can suggest it as an addition in a future release and contribute to making it a better music player ;) – Oyibo Dec 24 '12 at 20:16

Out of the box, rhythmbox does not have the ability to differentiate between different "greatest hits" albums because it treats album titles as the unique identifier.

Through the rhythmbox plugin coverart-browser, we treat both the album-title AND the album-artist as the unique identifier.


As the picture shows - two artists with the same "greatest hits" titles but the albums are shown separately since the two albums are by different artists.

You should note - when ripping CD's, often the album-artist is not ripped and is left blank.

Worse still, for multi-artist albums (compilations), both the album-artist and artist fields are also left empty. Thus you can be left with two albums with exactly the same title.

The trick here is to select all the tracks for an album, right-click and choose properties and then fill in the album-artist field to make it unique

enter image description here

See the links below for installation instructions.

Linked Question:


I have seen this problem on a variety of systems and with different players and the only solution I have come up with is to name the albums prefixed by the artist.

For example:

"Red Hot Chilli Peppers Greatest Hits " instead of just "Greatest Hits".

I know its a lot of work but if someone has a better way I would love to hear it.

  • I have recieved 2 downvotes for my answer which I find perplexing considering at the moment mine is the only posiility to achieve what was asked in the question. Answering that it's not possible is fine but I have offered an alternative that works. – CoalaWeb Dec 26 '12 at 10:11
  • Changing the album names to something that is incorrect is not a solution for everyone. It's a workaround that is very likely to break, as it makes the album title incorrect. Anyone who uses any tools which automatically fixes metadata, will have such changes overwritten. Your answer also invites further discussion. The only correct answer is that it is currently a bug this doesn't work, and it needs to be reported as such, and fixed upstream. – dobey Dec 29 '12 at 18:52
  • I don't agree I have been using this system for years and as such is a viable solution in the current circumstances. You make sweeping statements such as the "the only correct answer" which is to submit a bug report that more than likely will take months or even years to implement so I'm offering an alternative while this process takes place (I'm not forcing anyone to use it). My original comment stands that I feel two negative votes are un warranted, feel free to not vote for my answer but that is very different to giving it a negative. – CoalaWeb Dec 29 '12 at 22:34

You cannot do this in Rhythmbox. However, I would consider it a bug that this happens. You should open a bug about it upstream, if one is not already opened. What it should do, is sort by album, then album artist, then artist, then disc number, then by track number, when you sort by album. However, it is not currently doing this.


Select all the tracks from the album, right click, choose properties. Don't change the artist or album tag. Set "album artist" if you like, or click on the "sorting" tab. Here, you can set an artist and album tag that will not be displayed, but will be used specifically for sorting. If you set "Album sort order" to "greatest hits 1" for example, and set it to "greatest hits 2" for the other album, they would still both show up as "Greatest Hits" in the library, but would be sorted as separate albums. Better solution would be to change the "artist sort order" field to the corresponding artist's name. This is also a good solution for albums with multiple artists.

You can also use this if you like your albums sorted chronologically, as Rhythmbox doesn't have the "album by year" feature that I've only ever seen in iTunes.

Sorting your library using the "Artist" heading rather than "Album" would solve this problem much more easily; your albums will still be sorted alphabetically, with their tracks in order, and albums by the same artist will be grouped together. That way Offspring and Queen wouldn't even be near each other, let alone all mixed up like that.

I know this question is pretty old, but no one seems to have posted this solution. Hope I helped someone.


I'm a developer and added 'sort by artist' to 'rhythmdb_query_model_album_sort_func' - see below.

If you are an end user able to prepare your system for package building, patch the source, build new packages, install then go ahead! ;-).

This patch was done with rb v2.97, newer versions may have different line numbers (didn't check that yet) but basically the code should be the same.

Description: sort albums with same title first by artist, remove unnecesary space and tab
--- rhythmbox-2.97.orig/rhythmdb/rhythmdb-query-model.c
+++ rhythmbox-2.97/rhythmdb/rhythmdb-query-model.c
@@ -2192,7 +2192,7 @@ rhythmdb_query_model_drag_data_received
        return FALSE;

  * determines whether reordering is possible by checking up
  * the chain for a model with a sort function set.
@@ -2921,7 +2921,7 @@
  * @data: nothing
  * Sort function for sorting by album.  Sorts by album, then
- * disc number, then track number, then title.
+ * artist, then disc number, then track number, then title.
  * Returns: result of sort comparison between a and b.
@@ -2959,6 +2959,31 @@ rhythmdb_query_model_album_sort_func (Rh
        if (ret != 0)
                return ret;

+       /* Then by artist */
+        a_val = rhythmdb_entry_get_string (a, RHYTHMDB_PROP_ARTIST_SORTNAME_SORT_KEY);
+        if (a_val[0] == '\0') {
+                a_val = rhythmdb_entry_get_string (a, RHYTHMDB_PROP_ARTIST_SORT_KEY);
+        }
+        b_val = rhythmdb_entry_get_string (b, RHYTHMDB_PROP_ARTIST_SORTNAME_SORT_KEY);
+        if (b_val[0] == '\0') {
+                b_val = rhythmdb_entry_get_string (b, RHYTHMDB_PROP_ARTIST_SORT_KEY);
+        }
+        if (a_val == NULL) {
+                if (b_val == NULL)
+                        ret = 0;
+                else
+                        ret = -1;
+        } else if (b_val == NULL)
+                ret = 1;
+        else
+                ret = strcmp (a_val, b_val);
+        if (ret != 0)
+                return ret;
+        /*else
+                return rhythmdb_query_model_album_sort_func (a, b, data); */
        /* Then by disc number (assume 1 if non-existent) */
        a_num = rhythmdb_entry_get_ulong (a, RHYTHMDB_PROP_DISC_NUMBER);
        b_num = rhythmdb_entry_get_ulong (b, RHYTHMDB_PROP_DISC_NUMBER);
@@ -3168,7 +3193,7 @@
                                    gpointer data)
        gulong a_val, b_val;
        if (rhythmdb_entry_is_lossless (a)) {
                if (rhythmdb_entry_is_lossless (b))
                        return rhythmdb_query_model_location_sort_func (a, b, data);

Further instructions on package building here and here

  • 1
    Welcome to Ask Ubuntu! ;-) Could you elaborate how the end-user can activate this function for his distribution? (think end-user) – Fabby Apr 3 '16 at 21:15
  • Next time, don't propose these changes as an anonymous user, but log in and then edit, so it doesn't have to go through the review process. Now you were lucky to get the same reviewer twice in a row, but there are a few 100 of us and next time you won't be so lucky! :P – Fabby Apr 5 '16 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.