Skip to content

Commit

Permalink
Change "Artist/Album" view to an "Album" view
Browse files Browse the repository at this point in the history
Patch taken from
  cmus#535 (comment)
  • Loading branch information
asnr committed Apr 10, 2020
1 parent 65d36d5 commit 7bd5567
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions comment.c
Expand Up @@ -60,6 +60,7 @@ int track_is_compilation(const struct keyval *comments)

int track_is_va_compilation(const struct keyval *comments)
{
/*
const char *c, *a, *aa;
aa = keyvals_get_val(comments, "albumartist");
Expand All @@ -77,26 +78,31 @@ int track_is_va_compilation(const struct keyval *comments)
c = keyvals_get_val(comments, "partofacompilation");
if (c && is_freeform_true(c))
return 1;
*/

return 0;
}

const char *comments_get_albumartist(const struct keyval *comments)
{
/*
const char *val = keyvals_get_val(comments, "albumartist");
if (!val || strcmp(val, "") == 0)
val = keyvals_get_val(comments, "artist");
return val;
*/
return "<Various Albums>";
}

const char *comments_get_artistsort(const struct keyval *comments)
{
const char *val;
/*
const char *val;
if (track_is_va_compilation(comments))
return NULL;
return NULL;
val = keyvals_get_val(comments, "albumartistsort");
if (!track_is_compilation(comments)) {
Expand All @@ -106,8 +112,9 @@ const char *comments_get_artistsort(const struct keyval *comments)
if (!val || strcmp(val, "") == 0)
return NULL;
*/

return val;
return NULL;
}

int comments_get_int(const struct keyval *comments, const char *key)
Expand Down
2 changes: 1 addition & 1 deletion tree.c
Expand Up @@ -519,7 +519,7 @@ static struct artist *artist_new(const char *name, const char *sort_name, int is
a->collkey_name = u_strcasecoll_key(a->name);
a->collkey_sort_name = u_strcasecoll_key0(a->sort_name);
a->collkey_auto_sort_name = u_strcasecoll_key0(a->auto_sort_name);
a->expanded = 0;
a->expanded = 1;
a->is_compilation = is_compilation;
rb_root_init(&a->album_root);

Expand Down
2 changes: 1 addition & 1 deletion ui_curses.c
Expand Up @@ -1014,7 +1014,7 @@ static void update_window(struct window *win, int x, int y, int w, const char *t
static void update_tree_window(void)
{
update_window(lib_tree_win, tree_win_x, 0, tree_win_w,
"Artist / Album", print_tree);
"Album", print_tree);
}

static void update_track_window(void)
Expand Down

0 comments on commit 7bd5567

Please sign in to comment.