diff options
author | Alexander Yakushev <yakushev.alex@gmail.com> | 2011-07-26 23:13:05 +0300 |
---|---|---|
committer | Alexander Yakushev <yakushev.alex@gmail.com> | 2011-07-26 23:13:05 +0300 |
commit | 249f3d20563f3a4a22c9a91214136585f9e390b8 (patch) | |
tree | 09fe6d1b960f3a7019cfa98ba141aec264889c2b | |
parent | 8d0ed9774285084d0a55e5c30ae18680186db76a (diff) | |
download | awesompd-249f3d20563f3a4a22c9a91214136585f9e390b8.tar.gz awesompd-249f3d20563f3a4a22c9a91214136585f9e390b8.tar.bz2 |
Fixed (?) showing album cover for Ogg streams
-rw-r--r-- | jamendo.lua | 12 |
1 files changed, 12 insertions, 0 deletions
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 |