diff --git a/src/screen_artist.c b/src/screen_artist.c
index 14d37a5a5a2e1fbfa9fddd2719478e44a7da9689..8ead78c7ddc456af61e2498e7013ded8b5ed4071 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
static GPtrArray *artist_list, *album_list;
static char *artist = NULL;
static char *album = NULL;
+static char ALL_TRACKS[] = "";
static struct screen_browser browser;
mpd_search_db_songs(connection, true);
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
MPD_TAG_ARTIST, artist);
- if (album[0] != 0)
+ if (album != ALL_TRACKS)
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
MPD_TAG_ALBUM, album);
mpd_search_commit(connection);
free_state(void)
{
g_free(artist);
- g_free(album);
+ if (album != ALL_TRACKS)
+ g_free(album);
artist = NULL;
album = NULL;
case LIST_SONGS:
s1 = utf8_to_locale(artist);
- if (*album != 0) {
- s2 = utf8_to_locale(album);
+
+ if (album == ALL_TRACKS)
g_snprintf(str, size,
- _("Album: %s - %s"), s1, s2);
+ _("All tracks of artist: %s"), s1);
+ else if (*album != 0) {
+ s2 = utf8_to_locale(album);
+ g_snprintf(str, size, _("Album: %s - %s"), s1, s2);
g_free(s2);
} else
g_snprintf(str, size,
- _("All tracks of artist: %s"), s1);
+ _("Tracks of no album of artist: %s"), s1);
g_free(s1);
break;
}
str = utf8_to_locale(_filter);
if (table == MPD_TAG_ALBUM)
- screen_status_printf("Adding album %s...", str);
+ screen_status_printf(_("Adding album %s..."), str);
else
- screen_status_printf("Adding %s...", str);
+ screen_status_printf(_("Adding %s..."), str);
g_free(str);
mpd_search_db_songs(connection, true);
mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
table, _filter);
+ if (table == MPD_TAG_ALBUM)
+ mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
+ MPD_TAG_ARTIST, artist);
mpd_search_commit(connection);
addlist = filelist_new_recv(connection);
struct list_window_range range;
char *selected;
char *old;
+ char *old_ptr;
int idx;
switch(cmd) {
}
} else if (browser.lw->selected == album_list->len + 1) {
/* handle "show all" */
- open_song_list(c, g_strdup(artist), g_strdup("\0"));
+ open_song_list(c, g_strdup(artist), ALL_TRACKS);
list_window_reset(browser.lw);
} else {
/* select album */
if (browser.lw->selected == 0) {
/* handle ".." */
old = g_strdup(album);
+ old_ptr = album;
open_album_list(c, g_strdup(artist));
list_window_reset(browser.lw);
/* restore previous list window state */
- idx = *old == 0
+ idx = old_ptr == ALL_TRACKS
? (int)album_list->len
: string_array_find(album_list, old);
g_free(old);
case LIST_SONGS:
old = g_strdup(album);
+ old_ptr = album;
open_album_list(c, g_strdup(artist));
list_window_reset(browser.lw);
/* restore previous list window state */
- idx = *old == 0
+ idx = old_ptr == ALL_TRACKS
? (int)album_list->len
: string_array_find(album_list, old);
g_free(old);