set_capability( "interface", 25 )
set_description( N_("Command-line interface") )
set_callbacks( Open_LuaCLI, Close_LuaIntf )
-#ifndef WIN32
+#ifndef _WIN32
add_shortcut( "luacli", "luarc", "cli", "rc" )
#else
add_shortcut( "luacli", "luarc" )
i++;
free( datadir );
-#if !(defined(__APPLE__) || defined(WIN32) || defined(__OS2__))
+#if !(defined(__APPLE__) || defined(_WIN32) || defined(__OS2__))
char *psz_libpath = config_GetLibDir();
if( likely(psz_libpath != NULL) )
{
return i_ret;
}
-char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const char *psz_name )
+char *vlclua_find_file( const char *psz_luadirname, const char *psz_name )
{
char **ppsz_dir_list = NULL;
vlclua_dir_list( psz_luadirname, &ppsz_dir_list );
/* playlist key item path */
if( lua_isstring( L, -1 ) )
{
+ char *psz_oldurl = NULL;
const char *psz_path = NULL;
char *psz_u8path = NULL;
const char *psz_name = NULL;
input_item_t *p_input;
/* Read path and name */
+ if (p_parent) {
+ psz_oldurl = input_item_GetURI( p_parent );
+ msg_Dbg( p_this, "old path: %s", psz_oldurl );
+ }
psz_path = lua_tostring( L, -1 );
msg_Dbg( p_this, "Path: %s", psz_path );
lua_getfield( L, -2, "name" );
/* Read meta data: item must be on top of stack */
vlclua_read_meta_data( p_this, L, p_input );
+ /* copy the original URL to the meta data, if "URL" is still empty */
+ char* url = input_item_GetURL( p_input );
+ if( url == NULL && p_parent)
+ {
+ EnsureUTF8( psz_oldurl );
+ msg_Dbg( p_this, "meta-URL: %s", psz_oldurl );
+ input_item_SetURL ( p_input, psz_oldurl );
+ }
+ free( psz_oldurl );
+ free( url );
+
+ /* copy the psz_name to the meta data, if "Title" is still empty */
+ char* title = input_item_GetTitle( p_input );
+ if( title == NULL )
+ input_item_SetTitle ( p_input, psz_name );
+ free( title );
+
/* Read custom meta data: item must be on top of stack*/
vlclua_read_custom_meta_data( p_this, L, p_input );
goto error;
}
luaL_openlibs( L );
- if( vlclua_add_modules_path( probe, L, psz_filename ) )
+ if( vlclua_add_modules_path( L, psz_filename ) )
{
msg_Err( probe, "Error while setting the module search path for %s",
psz_filename );
return count;
}
-#undef vlclua_add_modules_path
-int vlclua_add_modules_path( vlc_object_t *obj, lua_State *L, const char *psz_filename )
+int vlclua_add_modules_path( lua_State *L, const char *psz_filename )
{
/* Setup the module search path:
* * "The script's directory"/modules