From 249f3d20563f3a4a22c9a91214136585f9e390b8 Mon Sep 17 00:00:00 2001 From: Alexander Yakushev Date: Tue, 26 Jul 2011 23:13:05 +0300 Subject: Fixed (?) showing album cover for Ogg streams --- jamendo.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jamendo.lua b/jamendo.lua index f495006..d907f26 100644 --- a/jamendo.lua +++ b/jamendo.lua @@ -360,6 +360,18 @@ function try_get_cover(track_name) if string.find(track_name, "jamendo.com/stream") then return get_album_cover(get_id_from_link(track_name)) else + -- MPD transforms Ogg stream links into normal track names. Good + -- for it but bad for us! We don't know if the song is streamed + -- from Jamendo anymore. The best we can do for now is to look + -- through the whole jamendo_list and compare it with the given + -- track name. + for _, track in pairs(jamendo_list) do + if track.display_name == track_name then + return get_album_cover(track.id) + end + end + -- Seems like it is not a Jamendo stream. And even if it is, we + -- still can't do anything. return nil end end -- cgit v1.2.3