Sou um desenvolvedor e adiciono 'classificar por artista' a 'rhythmdb_query_model_album_sort_func' - veja abaixo.
Se você é um usuário final capaz de preparar seu sistema para a construção de pacotes, corrigir o código-fonte, criar novos pacotes, instalar, então vá em frente! ; -) .
Este patch foi feito com o rb v2.97, versões mais novas podem ter números de linha diferentes (não verificaram isso ainda) mas basicamente o código deve ser o mesmo.
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] == '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] == '%pre%') {
+ 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] == '%pre%') {
+ 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);
') {
+ 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] == '%pre%') {
+ 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);
Mais instruções sobre o desenvolvimento de pacotes aqui e < a href="https://raphaelhertzog.com/2012/08/08/how-to-use-quilt-to-manage-patches-in-debian-packages/"> aqui