Browse Source

lua: add trusted metadata property

Add function `file_is_playlist` to parse the `trusted` property
of a file. This function will be used to upgrade the metadata
priority from `VLC_META_PRIORITY_BASIC` to `VLC_META_PRIORITY_PLAYLIST`
for files marked as trusted. Set the `trusted` property of CUE files
as they require playlist metadata priority.
Refs #4143
pull/169/head
Ayush Dey 2 years ago
committed by Steve Lhomme
parent
commit
192ae78b27
  1. 12
      modules/lua/vlc.c
  2. 1
      share/lua/playlist/cue.lua

12
modules/lua/vlc.c

@ -95,6 +95,18 @@ static int file_compare( const char **a, const char **b )
return strcmp( *a, *b );
}
/* Function to parse the trusted property of a file */
static bool file_is_playlist( lua_State *L )
{
bool trusted = false;
lua_getfield(L, -1, "trusted");
if( !lua_isnil(L, -1) && lua_isboolean(L, -1) )
trusted = lua_toboolean(L, -1);
lua_pop( L, 1 );
return trusted;
}
static char **vlclua_dir_list_append( char **restrict list, char *basedir,
const char *luadirname )
{

1
share/lua/playlist/cue.lua

@ -74,6 +74,7 @@ function cue_track( global, track )
t.date = track.date or global.date
t.description = global.comment
t.tracknum = track.num
t.trusted = true
t.options = { ":start-time=" .. track.index01}
return t

Loading…
Cancel
Save