X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fmisc%2Flua%2Fvlclua.c;h=fabbdd9b79e428a9423f8c828e9444d73d25c906;hb=6ee1e193fd896ab9a4729fde14f009d9ce629815;hp=ad05fd8ce34a9ece01f70035959a530bb1d7cabe;hpb=1339174430fab89c9b6401ed51f5d479896e1dba;p=vlc diff --git a/modules/misc/lua/vlclua.c b/modules/misc/lua/vlclua.c index ad05fd8ce3..fabbdd9b79 100644 --- a/modules/misc/lua/vlclua.c +++ b/modules/misc/lua/vlclua.c @@ -1,7 +1,7 @@ /***************************************************************************** - * luameta.c: Get meta/artwork using lua scripts + * vlclua.c: Generic lua inteface functions ***************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2007 the VideoLAN team * $Id$ * * Authors: Antoine Cellerier @@ -43,21 +43,20 @@ *****************************************************************************/ vlc_module_begin(); - add_shortcut( "lua" ); + add_shortcut( "luameta" ); + set_shortname( N_( "Lua Meta" ) ); + set_description( _("Fetch metadata using lua scripts") ); + set_capability( "meta fetcher", 10 ); + set_callbacks( E_(FindMeta), NULL ); add_submodule(); - add_shortcut( "luameta" ); - set_shortname( N_( "Lua Meta" ) ); - set_description( _("Fetch Artwork using lua scripts") ); - set_capability( "meta fetcher", 10 ); - set_callbacks( E_(FindMeta), NULL ); - add_submodule(); - set_capability( "art finder", 10 ); - set_callbacks( E_(FindArt), NULL ); + set_shortname( N_( "Lua Art" ) ); + set_description( _("Fetch artwork using lua scripts") ); + set_capability( "art finder", 10 ); + set_callbacks( E_(FindArt), NULL ); add_submodule(); add_shortcut( "luaplaylist" ); set_category( CAT_INPUT ); set_subcategory( SUBCAT_INPUT_DEMUX ); - set_shortname( _("Lua Playlist") ); set_description( _("Lua Playlist Parser Interface") ); set_capability( "demux2", 9 ); @@ -245,8 +244,8 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this, char *ppsz_dir_list[] = { NULL, NULL, NULL, NULL }; char **ppsz_dir; - if( asprintf( &ppsz_dir_list[0], "%s" DIR_SEP CONFIG_DIR DIR_SEP "%s", p_this->p_libvlc->psz_homedir, - luadirname ) < 0 ) + if( asprintf( &ppsz_dir_list[0], "%s" DIR_SEP "%s", + p_this->p_libvlc->psz_datadir, luadirname ) < 0 ) return VLC_ENOMEM; # if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32) @@ -259,18 +258,18 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this, return VLC_ENOMEM; } # else - if( asprintf( &ppsz_dir_list[1], + if( asprintf( &ppsz_dir_list[1], "share" DIR_SEP "%s", luadirname ) < 0 ) return VLC_ENOMEM; # ifdef HAVE_SYS_STAT_H - { + { struct stat stat_info; if( ( utf8_stat( ppsz_dir_list[1], &stat_info ) == -1 ) || !S_ISDIR( stat_info.st_mode ) ) { free(ppsz_dir_list[1]); - if( asprintf( &ppsz_dir_list[1], + if( asprintf( &ppsz_dir_list[1], DATA_PATH DIR_SEP "%s", luadirname ) < 0 ) return VLC_ENOMEM; } @@ -307,13 +306,13 @@ int vlclua_scripts_batch_execute( vlc_object_t *p_this, for( ppsz_file = ppsz_filelist; ppsz_file < ppsz_fileend; ppsz_file++ ) { char *psz_filename; - if( asprintf( &psz_filename, + if( asprintf( &psz_filename, "%s" DIR_SEP "%s", *ppsz_dir, *ppsz_file ) < 0) return VLC_ENOMEM; msg_Dbg( p_this, "Trying Lua playlist script %s", psz_filename ); - + i_ret = func( p_this, psz_filename, p_state, user_data ); - + free( psz_filename ); if( i_ret == VLC_SUCCESS ) break;