]> gitweb.fluxo.info Git - awesompd.git/commitdiff
Recognize jamstore.radiohomy.net links
authorAlexander Yakushev <yakushev.alex@gmail.com>
Mon, 21 Nov 2011 15:42:53 +0000 (17:42 +0200)
committerAlexander Yakushev <yakushev.alex@gmail.com>
Mon, 21 Nov 2011 15:42:53 +0000 (17:42 +0200)
Streams to jamstore.radiohomy.net are new and were not supported yet.
Awesompd couldn't recognize them as Jamendo streams and replace them
with normal track names.

awesompd.lua
jamendo.lua

index 617d9cfc0306b273ba25c648a2d6d89d0ee5c785..6183e8ef26bb6888d9cdd360c2757d936d8f551f 100644 (file)
@@ -1,7 +1,7 @@
 ---------------------------------------------------------------------------
 -- @author Alexander Yakushev <yakushev.alex@gmail.com>
 -- @copyright 2010-2011 Alexander Yakushev
--- @release v1.1.0
+-- @release v1.1.1
 ---------------------------------------------------------------------------
 
 awesompd = {}
index 26d4815d9bcba244c3e3e794ddc1a5aed82637e8..953adf6b5f698a9a86cc58e245547bde7407f2af 100644 (file)
@@ -1,7 +1,7 @@
 ---------------------------------------------------------------------------
 -- @author Alexander Yakushev <yakushev.alex@gmail.com>
 -- @copyright 2011 Alexander Yakushev
--- @release v1.1.0
+-- @release v1.1.1
 ---------------------------------------------------------------------------
 
 -- Grab environment
@@ -105,6 +105,9 @@ end
 -- given text is not the Jamendo stream returns nil.
 function get_id_from_link(link)
    local _, _, id = string.find(link,"jamendo.com/stream/(%d+)")
+   if not id then -- Handle streams from jamstore.radionomy.net
+      _, _, id = string.find(link,"jamstore.radionomy.net/%?trackid=(%d+)")
+   end
    return id
 end
 
@@ -427,7 +430,7 @@ end
 -- Checks if track_name is actually a link to Jamendo stream. If true
 -- returns the file with album cover for the track.
 function try_get_cover(track_name)
-   local id = get_id_from_link(track_name, true)
+   local id = get_id_from_link(track_name)
    if id then 
       return get_album_cover(id)
    end