Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (11)
......@@ -44,6 +44,14 @@ static void vlclua_ml_push_media( lua_State *L, const vlc_ml_media_t *media )
lua_setfield( L, -2, "duration" );
lua_pushboolean( L, media->thumbnails[VLC_ML_THUMBNAIL_SMALL].i_status == VLC_ML_THUMBNAIL_STATUS_AVAILABLE );
lua_setfield( L, -2, "hasThumbnail" );
lua_pushinteger( L, media->i_playcount );
lua_setfield( L, -2, "playcount" );
lua_pushnumber( L, media->f_progress );
lua_setfield( L, -2, "progress" );
lua_pushboolean( L, media->b_is_favorite );
lua_setfield( L, -2, "isFavorite" );
lua_pushinteger( L, media->i_last_played_date );
lua_setfield( L, -2, "lastPlayedDate" );
switch ( media->i_subtype )
{
case VLC_ML_MEDIA_SUBTYPE_ALBUMTRACK:
......@@ -110,11 +118,11 @@ static void vlclua_ml_push_media( lua_State *L, const vlc_ml_media_t *media )
if ( media->i_type != VLC_ML_MEDIA_TYPE_VIDEO )
return;
const char* quality = NULL;
const char *quality = NULL;
uint32_t maxChannels = 0;
for ( size_t i = 0; i < media->p_tracks->i_nb_items; ++i )
{
vlc_ml_media_track_t* track = &media->p_tracks->p_items[i];
vlc_ml_media_track_t *track = &media->p_tracks->p_items[i];
if ( track->i_type == VLC_ML_TRACK_TYPE_VIDEO && quality == NULL )
{
uint32_t width = track->v.i_width > track->v.i_height ?
......@@ -150,6 +158,32 @@ static void vlclua_ml_push_media( lua_State *L, const vlc_ml_media_t *media )
lua_setfield( L, -2, "nbChannels" );
}
static void vlclua_ml_push_folder( lua_State *L, const vlc_ml_folder_t *folder )
{
lua_newtable( L );
lua_pushinteger( L, folder->i_id );
lua_setfield( L, -2, "id" );
lua_pushstring( L, folder->psz_name );
lua_setfield( L, -2, "title" );
lua_pushstring( L, folder->psz_mrl );
lua_setfield( L, -2, "mrl" );
lua_pushinteger( L, folder->i_nb_media );
lua_setfield( L, -2, "nbMedia" );
lua_pushinteger( L, folder->i_nb_video );
lua_setfield( L, -2, "nbVideos" );
lua_pushinteger( L, folder->i_nb_audio );
lua_setfield( L, -2, "nbAudios" );
lua_pushinteger( L, folder->i_duration );
lua_setfield( L, -2, "duration" );
lua_pushboolean( L, folder->b_present );
lua_setfield( L, -2, "isPresent" );
lua_pushboolean( L, folder->b_banned );
lua_setfield( L, -2, "isBanned" );
lua_pushboolean( L, folder->b_is_favorite );
lua_setfield( L, -2, "isFavorite" );
}
static void vlclua_ml_push_show( lua_State *L, const vlc_ml_show_t *show )
{
lua_newtable( L );
......@@ -171,7 +205,7 @@ static void vlclua_ml_push_show( lua_State *L, const vlc_ml_show_t *show )
lua_setfield( L, -2, "nbSeason" );
}
static void vlclua_ml_push_album( lua_State* L, const vlc_ml_album_t *album )
static void vlclua_ml_push_album( lua_State *L, const vlc_ml_album_t *album )
{
lua_newtable( L );
lua_pushinteger( L, album->i_id );
......@@ -190,14 +224,16 @@ static void vlclua_ml_push_album( lua_State* L, const vlc_ml_album_t *album )
lua_setfield( L, -2, "duration" );
lua_pushinteger( L, album->i_year );
lua_setfield( L, -2, "releaseYear" );
lua_pushboolean( L, album->b_is_favorite );
lua_setfield( L, -2, "isFavorite" );
}
static void vlclua_ml_push_artist( lua_State* L, const vlc_ml_artist_t* artist )
static void vlclua_ml_push_artist( lua_State *L, const vlc_ml_artist_t *artist )
{
lua_newtable( L );
lua_pushinteger( L, artist->i_id );
lua_setfield( L, -2, "id" );
lua_pushstring( L, artist->psz_name);
lua_pushstring( L, artist->psz_name );
lua_setfield( L, -2, "name" );
lua_pushboolean( L, artist->thumbnails[VLC_ML_THUMBNAIL_SMALL].i_status == VLC_ML_THUMBNAIL_STATUS_AVAILABLE );
lua_setfield( L, -2, "hasThumbnail" );
......@@ -205,9 +241,11 @@ static void vlclua_ml_push_artist( lua_State* L, const vlc_ml_artist_t* artist )
lua_setfield( L, -2, "nbTracks" );
lua_pushinteger( L, artist->i_nb_album );
lua_setfield( L, -2, "nbAlbums" );
lua_pushboolean( L, artist->b_is_favorite );
lua_setfield( L, -2, "isFavorite" );
}
static void vlclua_ml_push_genre( lua_State* L, const vlc_ml_genre_t* genre )
static void vlclua_ml_push_genre( lua_State *L, const vlc_ml_genre_t *genre )
{
lua_newtable( L );
lua_pushinteger( L, genre->i_id );
......@@ -216,9 +254,91 @@ static void vlclua_ml_push_genre( lua_State* L, const vlc_ml_genre_t* genre )
lua_setfield( L, -2, "name" );
lua_pushinteger( L, genre->i_nb_tracks );
lua_setfield( L, -2, "nbTracks" );
lua_pushboolean( L, genre->thumbnails[VLC_ML_THUMBNAIL_SMALL].i_status == VLC_ML_THUMBNAIL_STATUS_AVAILABLE );
lua_setfield( L, -2, "hasThumbnail");
lua_pushboolean(L, genre->b_is_favorite );
lua_setfield( L, -2, "isFavorite" );
}
static void vlclua_ml_push_playlist( lua_State *L, const vlc_ml_playlist_t *playlist )
{
lua_newtable( L );
lua_pushinteger( L, playlist->i_id );
lua_setfield( L, -2, "id" );
lua_pushstring( L, playlist->psz_name );
lua_setfield( L, -2, "name" );
lua_pushstring( L, playlist->psz_mrl );
lua_setfield( L, -2, "mrl" );
lua_pushstring( L, playlist->psz_artwork_mrl );
lua_setfield( L, -2, "artworkMrl" );
lua_pushinteger( L, playlist->i_nb_media );
lua_setfield( L, -2, "nbMedia" );
lua_pushinteger( L, playlist->i_nb_video );
lua_setfield( L, -2, "nbVideo" );
lua_pushinteger( L, playlist->i_nb_audio );
lua_setfield( L, -2, "nbAudio" );
lua_pushinteger( L, playlist->i_nb_unknown );
lua_setfield( L, -2, "nbUnknown" );
lua_pushinteger( L, playlist->i_nb_present_media );
lua_setfield( L, -2, "nbPresentMedia" );
lua_pushinteger( L, playlist->i_nb_present_video );
lua_setfield( L, -2, "nbPresentVideo" );
lua_pushinteger( L, playlist->i_nb_present_audio );
lua_setfield( L, -2, "nbPresentAudio" );
lua_pushinteger( L, playlist->i_nb_present_unknown );
lua_setfield( L, -2, "nbPresentUnknown" );
lua_pushinteger( L, playlist->i_creation_date );
lua_setfield( L, -2, "creationDate" );
lua_pushinteger( L, playlist->i_duration );
lua_setfield( L, -2, "duration" );
lua_pushinteger( L, playlist->i_nb_duration_unknown );
lua_setfield( L, -2, "nbDurationUnknown" );
lua_pushboolean( L, playlist->b_is_read_only );
lua_setfield( L, -2, "isReadOnly" );
lua_pushboolean( L, playlist->b_is_favorite );
lua_setfield( L, -2, "isFavorite" );
}
static void vlclua_ml_push_bookmark( lua_State *L, const vlc_ml_bookmark_t *bookmark )
{
lua_newtable( L );
lua_pushinteger( L, bookmark->i_media_id );
lua_setfield( L, -2, "mediaid" );
lua_pushinteger( L, bookmark->i_time );
lua_setfield( L, -2, "time" );
lua_pushstring( L, bookmark->psz_name );
lua_setfield( L, -2, "name" );
lua_pushstring( L, bookmark->psz_description );
lua_setfield( L, -2, "description" );
}
static int vlclua_ml_get_media( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
lua_Integer mediaId = luaL_checkinteger( L, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_t *media = vlc_ml_get_media( ml, mediaId );
if ( media == NULL )
return luaL_error( L, "Failed to get media" );
vlclua_ml_push_media( L, media );
vlc_ml_release( media );
return 1;
}
static int vlclua_ml_get_media_by_mrl( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
const char *mediaMrl = luaL_checkstring( L, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_t *media = vlc_ml_get_media_by_mrl( ml, mediaMrl );
if ( media == NULL )
return luaL_error( L, "Failed to get media" );
vlclua_ml_push_media( L, media );
vlc_ml_release( media );
return 1;
}
static int vlclua_ml_list_media( lua_State* L, vlc_ml_media_list_t* list )
static int vlclua_ml_list_media( lua_State *L, vlc_ml_media_list_t *list )
{
if ( list == NULL )
return luaL_error( L, "Failed to list media" );
......@@ -232,7 +352,21 @@ static int vlclua_ml_list_media( lua_State* L, vlc_ml_media_list_t* list )
return 1;
}
static int vlclua_ml_list_show( lua_State* L, vlc_ml_show_list_t* list )
static int vlclua_ml_list_folder( lua_State *L, vlc_ml_folder_list_t *list )
{
if ( list == NULL )
return luaL_error( L, "Failed to list folders" );
lua_createtable( L, list->i_nb_items, 0 );
for ( size_t i = 0; i < list->i_nb_items; ++i )
{
vlclua_ml_push_folder( L, &list->p_items[i] );
lua_rawseti( L, -2, i + 1 );
}
vlc_ml_release( list );
return 1;
}
static int vlclua_ml_list_show( lua_State *L, vlc_ml_show_list_t *list )
{
if ( list == NULL )
return luaL_error( L, "Failed to list show" );
......@@ -246,25 +380,40 @@ static int vlclua_ml_list_show( lua_State* L, vlc_ml_show_list_t* list )
return 1;
}
static int vlclua_ml_list_bookmark( lua_State *L, vlc_ml_bookmark_list_t *list )
{
if ( list == NULL )
return luaL_error( L, "Failed to list bookmarks" );
lua_createtable( L, list->i_nb_items, 0 );
for ( size_t i = 0; i < list->i_nb_items; ++i )
{
vlclua_ml_push_bookmark( L, &list->p_items[i] );
lua_rawseti( L, -2, i + 1 );
}
vlc_ml_release( list );
return 1;
}
static void vlclua_ml_assign_params( lua_State *L, vlc_ml_query_params_t *params, uint8_t paramIndex )
{
*params = vlc_ml_query_params_create();
if (!lua_istable(L, paramIndex))
if (!lua_istable( L, paramIndex ))
return;
lua_getfield(L, 1, "public_only" );
lua_getfield(L, 1, "favorite_only" );
lua_getfield(L, 1, "limit" );
lua_getfield(L, 1, "offset" );
lua_getfield(L, 1, "desc" );
lua_getfield(L, 1, "sort" );
lua_getfield(L, 1, "pattern" );
params->b_public_only = lua_toboolean( L, -7 );
lua_getfield( L, 1, "favorite_only" );
lua_getfield( L, 1, "limit" );
lua_getfield( L, 1, "offset" );
lua_getfield( L, 1, "desc" );
lua_getfield( L, 1, "sort" );
lua_getfield( L, 1, "pattern" );
//impose public_only to true until something is done about permissions
params->b_public_only = true;
params->b_favorite_only = lua_toboolean( L, -6 );
params->i_nbResults = lua_tointeger( L, -5 );
params->i_offset = lua_tointeger( L, -4 );
params->b_desc = lua_toboolean( L, -3 );
params->i_sort = lua_tointeger(L, -2);
params->psz_pattern = lua_tostring(L, -1);
params->i_sort = lua_tointeger( L, -2);
params->psz_pattern = lua_tostring( L, -1);
}
static int vlclua_ml_video( lua_State *L )
......@@ -272,18 +421,39 @@ static int vlclua_ml_video( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_media_list_t* list = vlc_ml_list_video_media( ml, &params );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_list_t *list = vlc_ml_list_video_media( ml, &params );
return vlclua_ml_list_media( L, list );
}
static int vlclua_ml_folder( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_folder_list_t *list = vlc_ml_list_folders( ml, &params );
return vlclua_ml_list_folder( L, list );
}
static int vlclua_ml_folders_by_type( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_ml_media_type_t mediaType = luaL_checkinteger( L, 2 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_folder_list_t *list = vlc_ml_list_folders_by_type( ml, &params, mediaType );
return vlclua_ml_list_folder( L, list );
}
static int vlclua_ml_list_shows( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_show_list_t* list = vlc_ml_list_shows( ml, &params );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_show_list_t *list = vlc_ml_list_shows( ml, &params );
return vlclua_ml_list_show( L, list );
}
......@@ -292,8 +462,8 @@ static int vlclua_ml_audio( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_media_list_t* list = vlc_ml_list_audio_media( ml, &params );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_list_t *list = vlc_ml_list_audio_media( ml, &params );
return vlclua_ml_list_media( L, list );
}
......@@ -316,8 +486,8 @@ static int vlclua_ml_list_all_albums( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_album_list_t* list = vlc_ml_list_albums( ml, &params );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_album_list_t *list = vlc_ml_list_albums( ml, &params );
return vlclua_ml_list_albums( L, list );
}
......@@ -326,9 +496,9 @@ static int vlclua_ml_list_artist_albums( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 2 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
lua_Integer artistId = luaL_checkinteger( L, 1 );
vlc_ml_album_list_t* list = vlc_ml_list_artist_albums( ml, &params, artistId );
vlc_ml_album_list_t *list = vlc_ml_list_artist_albums( ml, &params, artistId );
return vlclua_ml_list_albums( L, list );
}
......@@ -337,9 +507,9 @@ static int vlclua_ml_list_genre_albums( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 2 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
lua_Integer genreId = luaL_checkinteger( L, 1 );
vlc_ml_album_list_t* list = vlc_ml_list_genre_albums( ml, &params, genreId );
vlc_ml_album_list_t *list = vlc_ml_list_genre_albums( ml, &params, genreId );
return vlclua_ml_list_albums( L, list );
}
......@@ -347,8 +517,8 @@ static int vlclua_ml_get_album( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
lua_Integer albumId = luaL_checkinteger( L, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_album_t* album = vlc_ml_get_album( ml, albumId );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_album_t *album = vlc_ml_get_album( ml, albumId );
if ( album == NULL )
return luaL_error( L, "Failed to get album" );
vlclua_ml_push_album( L, album );
......@@ -356,6 +526,19 @@ static int vlclua_ml_get_album( lua_State *L )
return 1;
}
static int vlclua_ml_get_folder( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
lua_Integer folderId = luaL_checkinteger( L, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_folder_t *folder = vlc_ml_get_folder( ml, folderId );
if ( folder == NULL )
return luaL_error( L, "Failed to get folder" );
vlclua_ml_push_folder( L, folder );
vlc_ml_release( folder );
return 1;
}
static int vlclua_ml_list_artists( lua_State *L, vlc_ml_artist_list_t *list )
{
if ( list == NULL )
......@@ -375,8 +558,8 @@ static int vlclua_ml_list_all_artists( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_artist_list_t* list = vlc_ml_list_artists( ml, &params, true );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_artist_list_t *list = vlc_ml_list_artists( ml, &params, true );
return vlclua_ml_list_artists( L, list );
}
......@@ -385,9 +568,9 @@ static int vlclua_ml_list_genre_artists( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 2 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
lua_Integer genreId = luaL_checkinteger( L, 1 );
vlc_ml_artist_list_t* list = vlc_ml_list_genre_artists( ml, &params, genreId );
vlc_ml_artist_list_t *list = vlc_ml_list_genre_artists( ml, &params, genreId );
return vlclua_ml_list_artists( L, list );
}
......@@ -395,8 +578,8 @@ static int vlclua_ml_get_artist( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
lua_Integer artistId = luaL_checkinteger( L, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_artist_t* artist = vlc_ml_get_artist( ml, artistId );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_artist_t *artist = vlc_ml_get_artist( ml, artistId );
if ( artist == NULL )
return luaL_error( L, "Failed to get artist" );
vlclua_ml_push_artist( L, artist );
......@@ -409,8 +592,8 @@ static int vlclua_ml_list_genres( lua_State *L )
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_genre_list_t* list = vlc_ml_list_genres( ml, &params );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_genre_list_t *list = vlc_ml_list_genres( ml, &params );
if ( list == NULL )
return luaL_error( L, "Failed to list genres" );
lua_createtable( L, list->i_nb_items, 0 );
......@@ -427,8 +610,8 @@ static int vlclua_ml_get_genre( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
lua_Integer genreId = luaL_checkinteger( L, 1 );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_genre_t* genre = vlc_ml_get_genre( ml, genreId );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_genre_t *genre = vlc_ml_get_genre( ml, genreId );
if ( genre == NULL )
return luaL_error( L, "Failed to get genre" );
vlclua_ml_push_genre( L, genre );
......@@ -436,14 +619,51 @@ static int vlclua_ml_get_genre( lua_State *L )
return 1;
}
static int vlclua_ml_list_playlists( lua_State *L, vlc_ml_playlist_list_t *list )
{
if ( list == NULL )
return luaL_error( L, "Failed to list playlists" );
lua_createtable( L, list->i_nb_items, 0 );
for ( size_t i = 0; i < list->i_nb_items; ++i )
{
vlclua_ml_push_playlist( L, &list->p_items[i] );
lua_rawseti( L, -2, i + 1 );
}
vlc_ml_release( list );
return 1;
}
static int vlclua_ml_list_all_playlists( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_playlist_list_t *list = vlc_ml_list_playlists( ml, &params, true );
return vlclua_ml_list_playlists( L, list );
}
static int vlclua_ml_get_playlist( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
lua_Integer playlistId = luaL_checkinteger( L, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_playlist_t *playlist = vlc_ml_get_playlist( ml, playlistId );
if ( playlist == NULL )
return luaL_error( L, "Failed to get playlist" );
vlclua_ml_push_playlist( L, playlist );
vlc_ml_release( playlist );
return 1;
}
static int vlclua_ml_get_media_thumbnail( lua_State *L )
{
if( lua_gettop( L ) < 1 ) return vlclua_error( L );
lua_Integer mediaId = luaL_checkinteger( L, 1 );
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_media_t* media = vlc_ml_get_media( ml, mediaId );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_t *media = vlc_ml_get_media( ml, mediaId );
if ( media == NULL ||
media->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl == NULL )
{
......@@ -461,10 +681,10 @@ static int vlclua_ml_get_artist_thumbnail( lua_State *L )
lua_Integer artistId = luaL_checkinteger( L, 1 );
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_artist_t* artist = vlc_ml_get_artist( ml, artistId );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_artist_t *artist = vlc_ml_get_artist( ml, artistId );
if ( artist == NULL ||
artist->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl == NULL )
artist->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl == NULL )
{
vlc_ml_release( artist );
return 0;
......@@ -480,8 +700,8 @@ static int vlclua_ml_get_album_thumbnail( lua_State *L )
lua_Integer albumId = luaL_checkinteger( L, 1 );
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_ml_album_t* album = vlc_ml_get_album( ml, albumId );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_album_t *album = vlc_ml_get_album( ml, albumId );
if ( album == NULL ||
album->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl == NULL )
{
......@@ -493,10 +713,29 @@ static int vlclua_ml_get_album_thumbnail( lua_State *L )
return 1;
}
static int vlclua_ml_get_genre_thumbnail( lua_State *L )
{
if( lua_gettop( L ) < 1 ) return vlclua_error( L );
lua_Integer genreId = luaL_checkinteger( L, 1 );
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_genre_t *genre = vlc_ml_get_genre( ml, genreId );
if ( genre == NULL ||
genre->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl == NULL )
{
vlc_ml_release( genre );
return 0;
}
lua_pushstring( L, genre->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl );
vlc_ml_release( genre );
return 1;
}
static int vlclua_ml_list_album_tracks( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 2 );
lua_Integer albumId = luaL_checkinteger( L, 1 );
......@@ -504,16 +743,98 @@ static int vlclua_ml_list_album_tracks( lua_State *L )
return vlclua_ml_list_media( L, list );
}
static int vlclua_ml_list_artist_tracks( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 2 );
lua_Integer artistId = luaL_checkinteger( L, 1 );
vlc_ml_media_list_t *list = vlc_ml_list_artist_tracks( ml, &params, artistId );
return vlclua_ml_list_media( L, list );
}
static int vlclua_ml_list_genre_tracks( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 2 );
lua_Integer genreId = luaL_checkinteger( L, 1 );
vlc_ml_media_list_t *list = vlc_ml_list_genre_tracks( ml, &params, genreId );
return vlclua_ml_list_media( L, list );
}
static int vlclua_ml_list_playlist_tracks( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 2 );
lua_Integer playlistId = luaL_checkinteger( L, 1 );
vlc_ml_media_list_t *list = vlc_ml_list_playlist_media( ml, &params, playlistId );
return vlclua_ml_list_media( L, list );
}
static int vlclua_ml_reload( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_medialibrary_t* ml = vlc_ml_instance_get( p_this );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_reload_folder( ml, NULL );
return 0;
}
static int vlclua_ml_history( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_ml_history_type_t historyType = luaL_checkinteger( L, 2 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_list_t *list = vlc_ml_list_history( ml, &params, historyType );
return vlclua_ml_list_media( L, list );
}
static int vlclua_ml_video_history( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_list_t *list = vlc_ml_list_video_history( ml, &params );
return vlclua_ml_list_media( L, list );
}
static int vlclua_ml_audio_history( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_media_list_t *list = vlc_ml_list_audio_history( ml, &params );
return vlclua_ml_list_media( L, list );
}
static int vlclua_media_bookmarks( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_ml_query_params_t params;
vlclua_ml_assign_params( L, &params, 1 );
int64_t mediaId = luaL_checkinteger( L, 2 );
vlc_medialibrary_t *ml = vlc_ml_instance_get( p_this );
vlc_ml_bookmark_list_t *list = vlc_ml_list_media_bookmarks( ml, &params, mediaId );
return vlclua_ml_list_bookmark( L, list );
}
static const luaL_Reg vlclua_ml_reg[] = {
{ "video", vlclua_ml_video },
{ "media", vlclua_ml_get_media },
{ "media_by_mrl", vlclua_ml_get_media_by_mrl },
{ "folder", vlclua_ml_folder },
{ "folders_by_type", vlclua_ml_folders_by_type },
{ "get_folder", vlclua_ml_get_folder },
{ "show_episodes", vlclua_ml_list_shows },
{ "audio", vlclua_ml_audio },
{ "media_thumbnail", vlclua_ml_get_media_thumbnail },
......@@ -523,13 +844,23 @@ static const luaL_Reg vlclua_ml_reg[] = {
{ "artist", vlclua_ml_get_artist },
{ "genres", vlclua_ml_list_genres },
{ "genre", vlclua_ml_get_genre },
{ "playlists", vlclua_ml_list_all_playlists },
{ "playlist", vlclua_ml_get_playlist },
{ "album_tracks", vlclua_ml_list_album_tracks },
{ "artist_tracks", vlclua_ml_list_artist_tracks },
{ "genre_tracks", vlclua_ml_list_genre_tracks },
{ "playlist_tracks", vlclua_ml_list_playlist_tracks },
{ "artist_albums", vlclua_ml_list_artist_albums },
{ "genre_albums", vlclua_ml_list_genre_albums },
{ "genre_artists", vlclua_ml_list_genre_artists },
{ "artist_thumbnail", vlclua_ml_get_artist_thumbnail },
{ "album_thumbnail", vlclua_ml_get_album_thumbnail },
{ "genre_thumbnail", vlclua_ml_get_genre_thumbnail },
{ "reload", vlclua_ml_reload },
{ "history", vlclua_ml_history },
{ "video_history",vlclua_ml_video_history },
{ "audio_history",vlclua_ml_audio_history },
{ "media_bookmarks", vlclua_media_bookmarks },
{ NULL, NULL }
};
......
......@@ -424,6 +424,7 @@ d:set_trackid(): the item's TrackID (OPTIONAL, meta data)
Medialibrary
------------
The `public_only` query parameter is enforced to be true by default.
query_params = {
"limit": integer,
......@@ -432,10 +433,14 @@ query_params = {
"sort": integer,
"pattern": string,
"favorite_only": boolean,
"public_only": boolean,
}
vlc.ml.video(query_params): Get video media list
vlc.ml.media(mediaId: integer): Get media with media id parameter
vlc.ml.media_by_mrl(mediaMrl: string): Get media with media mrl parameter
vlc.ml.folder(query_params): Get folder list
vlc.ml.folders_by_type(query_params, mediaType: integer): Get folders by type
vlc.ml.get_folder(folderId: integer): Get folder with folder id parameter
vlc.ml.show_episodes(query_params): Get the list of show episodes
vlc.ml.audio(query_params): Get audio media list
vlc.ml.media_thumbnail(mediaId: integer): Get media thumbnail with media id parameter
......@@ -446,12 +451,22 @@ vlc.ml.artists(query_params): Get artist list
vlc.ml.artist(artistId: integer): Get artist with artist id
vlc.ml.genres(query_params): Get genres list
vlc.ml.genre(genreId: integer): Get genre with genre id parameter
vlc.ml.playlists(query_params): Get playlist list
vlc.ml.playlist(playlistId: integer): Get playlist with playlist id
vlc.ml.artist_tracks(artistId: integer, query_params): Get artist tracks with artist id parameter
vlc.ml.genre_tracks(genreId: integer, query_params): Get genre tracks with genre id parameter
vlc.ml.playlist_tracks(playlistId: integer, query_params): Get playlist tracks with playlist id parameter
vlc.ml.artist_albums(artistId: integer, query_params): Get artist albums with artist id parameter
vlc.ml.genre_albums(genreId: integer, query_params): Get albums with genre id parameter
vlc.ml.genre_artists(genreId: integer, query_params): Get artists with genre id parameter
vlc.ml.artist_thumbnail(artistId: integer): Get artist thumbnail with artist id parameter
vlc.ml.album_thumbnail(albumId: integer): Get album thumbnail with album id parameter
vlc.ml.genre_thumbnail(genreId: integer): Get genre thumbnail with genre id parameter
vlc.ml.reload(): Reload folder
vlc.ml.history(historyType: integer, query_params): Get history list
vlc.ml.video_history(query_params): Get video history list
vlc.ml.audio_history(query_params): Get audio history list
vlc.ml.media_bookmarks(mediaId: integer, query_params): Get media bookmarks with media id parameter
Stream
------
......