Commit 30cd5db5 authored by Wieland Hoffmann's avatar Wieland Hoffmann Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ab7c22aa
...@@ -63,7 +63,13 @@ function fetch_art() ...@@ -63,7 +63,13 @@ function fetch_art()
local releaseid = nil 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"] .. "\"" query = "artist:\"" .. meta["artist"] .. "\" AND release:\"" .. meta["album"] .. "\""
relquery = "http://mb.videolan.org/ws/2/release/?query=" .. vlc.strings.encode_uri_component( query ) relquery = "http://mb.videolan.org/ws/2/release/?query=" .. vlc.strings.encode_uri_component( query )
releaseid = get_releaseid( relquery ) releaseid = get_releaseid( relquery )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment