[vlc-commits] musicbrainz.lua: Use MBIDs from files, if they exist

Wieland Hoffmann git at videolan.org
Sun Jan 19 00:49:28 CET 2014


vlc/vlc-2.1 | branch: master | Wieland Hoffmann <themineo at gmail.com> | Sun Jan 12 23:04:09 2014 +0100| [5cc747e80b2e45f73533cf561244c481f2518d0c] | committer: Jean-Baptiste Kempf

musicbrainz.lua: Use MBIDs from files, if they exist

If the MBID of the album is already in the `meta` table, use it to query
the MusicBrainz web service, instead of doing extra requests to the
search server.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 30cd5db56a0002cb9d6e080022e22d28cac0ec3b)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=5cc747e80b2e45f73533cf561244c481f2518d0c
---

 share/lua/meta/art/00_musicbrainz.lua |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/share/lua/meta/art/00_musicbrainz.lua b/share/lua/meta/art/00_musicbrainz.lua
index 67648d7..0523ec4 100644
--- a/share/lua/meta/art/00_musicbrainz.lua
+++ b/share/lua/meta/art/00_musicbrainz.lua
@@ -63,7 +63,13 @@ function fetch_art()
 
     local releaseid = nil
 
-    if meta["artist"] and meta["album"] then
+    for _, k in ipairs({"MUSICBRAINZ_ALBUMID", "MusicBrainz Album Id"}) do
+        if meta[k] then
+            releaseid = meta[k]
+        end
+    end
+
+    if not releaseid and meta["artist"] and meta["album"] then
         query = "artist:\"" .. meta["artist"] .. "\" AND release:\"" .. meta["album"] .. "\""
         relquery = "http://mb.videolan.org/ws/2/release/?query=" .. vlc.strings.encode_uri_component( query )
         releaseid = get_releaseid( relquery )



More information about the vlc-commits mailing list