summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-01-14 15:10:38 +0100
committerGravatar waker <wakeroid@gmail.com>2012-01-14 15:10:38 +0100
commitdb16ddcadfa8ad2d6c0f0ce3ba187e18ee2f0ddd (patch)
treeda120921595751780b0ea39e09efcbd68ca49913
parent60dd90151e1cf38521e28c2d9970320f87699c10 (diff)
lastfm: added option to prefer album artist over artist field for scrobbling
-rw-r--r--plugins/lastfm/lastfm.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c
index 8a5af425..5135822b 100644
--- a/plugins/lastfm/lastfm.c
+++ b/plugins/lastfm/lastfm.c
@@ -318,15 +318,29 @@ fail:
static int
lfm_fetch_song_info (DB_playItem_t *song, const char **a, const char **t, const char **b, float *l, const char **n, const char **m) {
- *a = deadbeef->pl_find_meta (song, "artist");
- if (!(*a)) {
+ if (deadbeef->conf_get_int ("lastfm.prefer_album_artist", 0)) {
*a = deadbeef->pl_find_meta (song, "band");
+ if (!(*a)) {
+ *a = deadbeef->pl_find_meta (song, "album artist");
+ }
+ if (!(*a)) {
+ *a = deadbeef->pl_find_meta (song, "albumartist");
+ }
+ if (!(*a)) {
+ *a = deadbeef->pl_find_meta (song, "artist");
+ }
}
- if (!(*a)) {
- *a = deadbeef->pl_find_meta (song, "album artist");
- }
- if (!(*a)) {
- *a = deadbeef->pl_find_meta (song, "albumartist");
+ else {
+ *a = deadbeef->pl_find_meta (song, "artist");
+ if (!(*a)) {
+ *a = deadbeef->pl_find_meta (song, "band");
+ }
+ if (!(*a)) {
+ *a = deadbeef->pl_find_meta (song, "album artist");
+ }
+ if (!(*a)) {
+ *a = deadbeef->pl_find_meta (song, "albumartist");
+ }
}
if (!*a) {
return -1;
@@ -930,6 +944,7 @@ static const char settings_dlg[] =
"property Username entry lastfm.login \"\";\n"
"property Password password lastfm.password \"\";"
"property \"Scrobble URL\" entry lastfm.scrobbler_url \""SCROBBLER_URL_LFM"\";"
+ "property \"Prefer Album Artist over Artist field\" checkbox lastfm.prefer_album_artist 0;"
;
// define plugin interface