From 956cb324c94d4062408d73ee8bf005b9e6ea3ec2 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 19 Oct 2013 21:34:47 +0200 Subject: artwork: improved album art fetching from last.fm --- plugins/artwork/artwork.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'plugins/artwork') diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index facfd486..44aa68dc 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1144,8 +1144,21 @@ fetcher_thread (void *none) got_pic = 1; } } - if (!got_pic && artwork_enable_lfm && !fetch_from_lastfm (param->artist, param->album, cache_path)) { - got_pic = 1; + if (!got_pic && artwork_enable_lfm) { + if (!fetch_from_lastfm (param->artist, param->album, cache_path)) { + got_pic = 1; + } + else { + // try to fix parentheses + char *fixed_alb = strdupa (param->album); + char *openp = strchr (fixed_alb, '('); + if (openp && openp != fixed_alb) { + *openp = 0; + if (!fetch_from_lastfm (param->artist, fixed_alb, cache_path)) { + got_pic = 1; + } + } + } } if (!got_pic && artwork_enable_aao && !fetch_from_albumart_org (param->artist, param->album, cache_path)) { got_pic = 1; -- cgit v1.2.3