{"title", {.smpl = set_item_info}, false },
{"creator", {.smpl = set_item_info}, false },
{"annotation", {.smpl = set_item_info}, false },
- {"info", {NULL}, false },
+ {"info", {.smpl = set_item_info}, false },
{"image", {.smpl = set_item_info}, false },
{"album", {.smpl = set_item_info}, false },
{"trackNum", {.smpl = set_item_info}, false },
}
else if (!strcmp(psz_name, "annotation"))
input_item_SetDescription(p_input, psz_value);
+ else if (!strcmp(psz_name, "info"))
+ input_item_SetURL(p_input, psz_value);
else if (!strcmp(psz_name, "image"))
input_item_SetArtURL(p_input, psz_value);
return true;
/* 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 */
+ 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 )
+ {
+ EnsureUTF8( psz_oldurl );
+ msg_Dbg( p_this, "meta-URL: %s", psz_oldurl );
+ input_item_SetURL ( p_input, psz_oldurl );
+ }
+ free( url );
+ free( psz_oldurl );
+
+ /* 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 );
fprintf( p_file, "\t\t\t<annotation>%s</annotation>\n", psz );
free( psz );
+ psz = input_xml( p_input, input_item_GetURL );
+ if( psz && *psz )
+ fprintf( p_file, "\t\t\t<info>%s</info>\n", psz );
+ free( psz );
+
psz = input_xml( p_input, input_item_GetArtURL );
if( psz && *psz )
fprintf( p_file, "\t\t\t<image>%s</image>\n", psz );