From 6bccfc6efda00b940bdf1a16791c313c941bf97e Mon Sep 17 00:00:00 2001 From: Timo Hirvonen Date: Sat, 17 May 2008 14:49:38 +0300 Subject: [PATCH] Handle streams separately in tree_add_track() There are no tags in streams so we can skip finding them. --- tree.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/tree.c b/tree.c index 19ede2d..4b7359d 100644 --- a/tree.c +++ b/tree.c @@ -536,35 +536,37 @@ static void update_artist_name(struct artist *artist, char *new_name) void tree_add_track(struct tree_track *track) { const struct track_info *ti = tree_track_info(track); - const char *album_name, *artist_name, *compilation, *artist_name_fancy; + const char *album_name, *artist_name, *artist_name_fancy = NULL; struct artist *artist; struct album *album; int date; - album_name = keyvals_get_val(ti->comments, "album"); - artist_name = keyvals_get_val(ti->comments, "artist"); - compilation = keyvals_get_val(ti->comments, "compilation"); - - artist_name_fancy = keyvals_get_val(ti->comments, "albumartistsort"); - if (!artist_name_fancy) - artist_name_fancy = keyvals_get_val(ti->comments, "albumartist"); - if (!artist_name_fancy) - artist_name_fancy = keyvals_get_val(ti->comments, "artistsort"); - if (is_url(ti->filename)) { artist_name = ""; album_name = ""; - } - - if (artist_name == NULL) - artist_name = ""; - if (album_name == NULL) - album_name = ""; - - if (compilation && (!strcasecmp(compilation, "1") - || !strcasecmp(compilation, "yes"))) { - /* Store all compilations under compilations */ - artist_name = ""; + } else { + const char *compilation; + + artist_name = keyvals_get_val(ti->comments, "artist"); + album_name = keyvals_get_val(ti->comments, "album"); + + artist_name_fancy = keyvals_get_val(ti->comments, "albumartistsort"); + if (!artist_name_fancy) + artist_name_fancy = keyvals_get_val(ti->comments, "albumartist"); + if (!artist_name_fancy) + artist_name_fancy = keyvals_get_val(ti->comments, "artistsort"); + + if (artist_name == NULL) + artist_name = ""; + if (album_name == NULL) + album_name = ""; + + compilation = keyvals_get_val(ti->comments, "compilation"); + if (compilation && (!strcasecmp(compilation, "1") + || !strcasecmp(compilation, "yes"))) { + /* Store all compilations under compilations */ + artist_name = ""; + } } find_artist_and_album(artist_name, album_name, &artist, &album); -- 2.11.4.GIT