]> git.sesse.net Git - vlc/commitdiff
tmp
authorPierre d'Herbemont <pdherbemont@free.fr>
Wed, 6 Jan 2010 15:38:32 +0000 (16:38 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Wed, 6 Jan 2010 15:38:32 +0000 (16:38 +0100)
modules/misc/lua/Modules.am
modules/misc/lua/vlc.c
modules/misc/lua/vlc.h
share/Makefile.am
src/playlist/fetcher.c

index 22aa829bd557a603a8ab2766d262ef075e2017b7..1f698fcd2a84a890affe342e042862f19abedf33 100644 (file)
@@ -1,6 +1,7 @@
 SOURCES_lua = \
        intf.c \
        meta.c \
+       decrapifier.c \
        demux.c \
        vlc.c \
        vlc.h \
index 275fcc0722a68365a605e09254b798c34dda2f13..4fce984139a29b021c2f8d866cf5de557b103b42 100644 (file)
@@ -63,6 +63,12 @@ vlc_module_begin ()
         set_capability( "art finder", 10 )
         set_callbacks( FindArt, NULL )
 
+    add_submodule ()
+        set_shortname( N_( "Lua Decrapifier" ) )
+        set_description( N_("Remove crappy part of the movie name") )
+        set_capability( "movie name decrapifier", 10 )
+        set_callbacks( Decrapify, NULL )
+
     add_submodule ()
         add_shortcut( "luaplaylist" )
         set_category( CAT_INPUT )
index f455f4e0dc84dda7cd3e7c94592c05d9f29a24c2..68eea0fd4d8fdd4f7d162591bb5fee5097dcc8ea 100644 (file)
@@ -48,6 +48,8 @@
 /*****************************************************************************
  * Module entry points
  *****************************************************************************/
+int Decrapify( vlc_object_t * );
+
 int FindArt( vlc_object_t * );
 
 int Import_LuaPlaylist( vlc_object_t * );
index 43f2347f889d8874415a67baeedc4f81fa7d2d9c..8a43fe9c7ddc95c7a599470a48f2092b798bc377 100644 (file)
@@ -190,6 +190,7 @@ DIST_osdmenu_default = \
 
 DIST_lua= \
        lua/README.txt \
+       lua/decrapifier/standard.lua \
        lua/meta/README.txt \
        lua/meta/01_musicbrainz.lua \
        lua/meta/10_googleimage.lua \
index eaecfd06adb645c228fae58df3d687e31d09e487..dc0edeed7f1cca467aec36f433f5cb306c860118 100644 (file)
@@ -33,6 +33,7 @@
 #include <limits.h>
 #include <vlc_art_finder.h>
 #include <vlc_memory.h>
+#include <vlc_decrapifier.h>
 
 #include "art.h"
 #include "fetcher.h"
@@ -122,10 +123,36 @@ void playlist_fetcher_Delete( playlist_fetcher_t *p_fetcher )
     free( p_fetcher );
 }
 
-
 /*****************************************************************************
  * Privates functions
  *****************************************************************************/
+
+/**
+ * This function's job is to call the movie name decrapifier
+ * Those plugins goal are to fill in information from the file itself.
+ * Without network connection.
+ */
+
+static void Decrapify( playlist_fetcher_t *p_fetcher, input_item_t *p_item )
+{
+    vlc_object_t *p_parent = VLC_OBJECT(p_fetcher->p_playlist);
+
+    decrapifier_t *p_decrapifier =
+    vlc_custom_create( p_parent, sizeof(*p_decrapifier), VLC_OBJECT_GENERIC,
+                      "movie name decrapifier" );
+    if(!p_decrapifier)
+        return;
+
+    vlc_object_attach( p_decrapifier, p_parent );
+    p_decrapifier->p_item = p_item;
+    
+    module_t *p_module = module_need( p_decrapifier,
+                                     "movie name decrapifier", NULL, false );
+    if( p_module )
+        module_unneed( p_decrapifier, p_module );
+    vlc_object_release( p_decrapifier );
+}
+
 /**
  * This function locates the art associated to an input item.
  * Return codes:
@@ -411,6 +438,8 @@ static void *Thread( void *p_data )
         /* Wait that the input item is preparsed if it is being played */
         WaitPreparsed( p_fetcher, p_item );
 
+        Decrapify( p_fetcher, p_item );
+
         /* Find art, and download it if needed */
         int i_ret = FindArt( p_fetcher, p_item );
         if( i_ret == 1 )