Commit de56dfd5 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

tmp

parent 99017338
SOURCES_lua = \ SOURCES_lua = \
intf.c \ intf.c \
meta.c \ meta.c \
decrapifier.c \
demux.c \ demux.c \
vlc.c \ vlc.c \
vlc.h \ vlc.h \
......
...@@ -63,6 +63,12 @@ vlc_module_begin () ...@@ -63,6 +63,12 @@ vlc_module_begin ()
set_capability( "art finder", 10 ) set_capability( "art finder", 10 )
set_callbacks( FindArt, NULL ) 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_submodule ()
add_shortcut( "luaplaylist" ) add_shortcut( "luaplaylist" )
set_category( CAT_INPUT ) set_category( CAT_INPUT )
......
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
/***************************************************************************** /*****************************************************************************
* Module entry points * Module entry points
*****************************************************************************/ *****************************************************************************/
int Decrapify( vlc_object_t * );
int FindArt( vlc_object_t * ); int FindArt( vlc_object_t * );
int Import_LuaPlaylist( vlc_object_t * ); int Import_LuaPlaylist( vlc_object_t * );
......
...@@ -190,6 +190,7 @@ DIST_osdmenu_default = \ ...@@ -190,6 +190,7 @@ DIST_osdmenu_default = \
DIST_lua= \ DIST_lua= \
lua/README.txt \ lua/README.txt \
lua/decrapifier/standard.lua \
lua/meta/README.txt \ lua/meta/README.txt \
lua/meta/01_musicbrainz.lua \ lua/meta/01_musicbrainz.lua \
lua/meta/10_googleimage.lua \ lua/meta/10_googleimage.lua \
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <limits.h> #include <limits.h>
#include <vlc_art_finder.h> #include <vlc_art_finder.h>
#include <vlc_memory.h> #include <vlc_memory.h>
#include <vlc_decrapifier.h>
#include "art.h" #include "art.h"
#include "fetcher.h" #include "fetcher.h"
...@@ -122,10 +123,36 @@ void playlist_fetcher_Delete( playlist_fetcher_t *p_fetcher ) ...@@ -122,10 +123,36 @@ void playlist_fetcher_Delete( playlist_fetcher_t *p_fetcher )
free( p_fetcher ); free( p_fetcher );
} }
/***************************************************************************** /*****************************************************************************
* Privates functions * 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. * This function locates the art associated to an input item.
* Return codes: * Return codes:
...@@ -411,6 +438,8 @@ static void *Thread( void *p_data ) ...@@ -411,6 +438,8 @@ static void *Thread( void *p_data )
/* Wait that the input item is preparsed if it is being played */ /* Wait that the input item is preparsed if it is being played */
WaitPreparsed( p_fetcher, p_item ); WaitPreparsed( p_fetcher, p_item );
Decrapify( p_fetcher, p_item );
/* Find art, and download it if needed */ /* Find art, and download it if needed */
int i_ret = FindArt( p_fetcher, p_item ); int i_ret = FindArt( p_fetcher, p_item );
if( i_ret == 1 ) if( i_ret == 1 )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment