[vlc-devel] commit: frenchtv: Add a new lua "art finder". (Pierre d'Herbemont )

git version control git at videolan.org
Thu Jan 7 02:38:28 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Jan  7 02:34:26 2010 +0100| [7e8e215ddc00b6dd64396a843194808b1de71657] | committer: Pierre d'Herbemont 

frenchtv: Add a new lua "art finder".

This will download the free to use original recreation of french
channels logo by Cyril Bourreau.

Note, we can mirror them eventually. (Explicit authorization from the
author).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7e8e215ddc00b6dd64396a843194808b1de71657
---

 share/Makefile.am                  |    1 +
 share/lua/meta/art/02_frenchtv.lua |   54 ++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/share/Makefile.am b/share/Makefile.am
index dce8c2c..3b8469f 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -192,6 +192,7 @@ DIST_lua= \
 	lua/README.txt \
 	lua/meta/art/README.txt \
 	lua/meta/art/01_musicbrainz.lua \
+	lua/meta/art/02_frenchtv.lua \
 	lua/meta/art/10_googleimage.lua \
 	lua/meta/reader/README.txt \
 	lua/meta/reader/filename.lua \
diff --git a/share/lua/meta/art/02_frenchtv.lua b/share/lua/meta/art/02_frenchtv.lua
new file mode 100644
index 0000000..1125800
--- /dev/null
+++ b/share/lua/meta/art/02_frenchtv.lua
@@ -0,0 +1,54 @@
+--[[
+ Gets an artwork from amazon
+
+ $Id$
+ Copyright © 2007 the VideoLAN team
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+--]]
+
+-- Return the artwork
+function fetch_art()
+    local urlsForChannel = {
+    -- on http://cyril.bourreau.free.fr/Vectoriel/
+        ["TF1"] = "TF1-2006.png",
+        ["France 2"] = "FR2-DSK-couleur.png",
+        ["France 3"] = "FR3-DSK-couleur.png",
+        ["France 4"] = "FR4-DSK-couleur.png",
+        ["France 5"] = "FR5-DSK-couleur.png",
+        ["Direct 8"] = "Direct8-2009.png",
+        ["NRJ 12"] = "NRJ12-2009.png",
+        ["iTele"] = "iTELE-2008.png",
+        ["W9"] = "W9.png"
+    }
+    local meta = vlc.item.metas(vlc.item);
+    local channel
+    if meta["title"] then
+        channel = meta["title"]
+    else
+        channel = meta["filename"]
+    end
+
+    -- trim
+    channel = string.gsub(channel, "^%s*(.-)%s*$", "%1")
+
+    local url = urlsForChannel[channel];
+
+    if url then
+        return "http://cyril.bourreau.free.fr/Vectoriel/"..url
+    else
+        return nil
+    end
+end




More information about the vlc-devel mailing list