Discussion:
[PATCH] Treat simply 'Various' artists same as 'Various Artists'
Gregory Petrosyan
2012-06-13 08:26:42 UTC
Permalink
This improves the handling of compilations, which often have 'Various' in their
tags.

Signed-off-by: Gregory Petrosyan <***@gmail.com>
---
comment.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/comment.c b/comment.c
index 011d3e5..fc7daed 100644
--- a/comment.c
+++ b/comment.c
@@ -24,6 +24,12 @@
#include <string.h>
#include <strings.h>

+static int is_various_artists(const char *a)
+{
+ return strcasecmp(a, "Various Artists") == 0 ||
+ strcasecmp(a, "Various") == 0;
+}
+
int track_is_compilation(const struct keyval *comments)
{
const char *c, *a, *aa;
@@ -33,7 +39,7 @@ int track_is_compilation(const struct keyval *comments)
return 1;

aa = keyvals_get_val(comments, "albumartist");
- if (aa && strcasecmp(aa, "Various Artists") == 0)
+ if (aa && is_various_artists(aa))
return 1;

a = keyvals_get_val(comments, "artist");
@@ -49,7 +55,7 @@ int track_is_va_compilation(const struct keyval *comments)

aa = keyvals_get_val(comments, "albumartist");
if (aa)
- return strcasecmp(aa, "Various Artists") == 0;
+ return is_various_artists(aa);

c = keyvals_get_val(comments, "compilation");
--
1.7.10.4
Johannes Weißl
2012-06-14 16:30:25 UTC
Permalink
Post by Gregory Petrosyan
+ return strcasecmp(a, "Various Artists") == 0 ||
+ strcasecmp(a, "Various") == 0;
This improves the handling of compilations, which often have 'Various' in their
tags.
+1... I'm only using "Various Artists", but I don't have a band called
"Various" in my collection either :-).


Johannes;

Loading...