Page 1 of 1

Help with automatic selection

Posted: 16 Mar 2019 07:17
by emo_apostolov
Hello! I need some help. I would like to make a script for a simple playlist in VLC where the first file is loaded randomly from folder "A", then the second one randomly from folder "B", then loop from beginning and load different files from the folders. The problem is that the VLC expand the folders and plays all the files in them. How can I make a script for automatic selection?
Another idea would be the player to play an element from all files according to certain criteria in the metadata such as artist, lenght or genre but I think the first idea would be far more easy to do.
Please help :)
Greetings!

Re: Help with automatic selection

Posted: 18 Mar 2019 14:25
by mederi
You could write an extension that would do the advaced shuffle. Check some extensions https://addons.videolan.org that can read and shuffle a playlist (Shuffle Playlist, Sampler PG) and mix playlists (WIP collection: Mix playlists).

Re: Help with automatic selection

Posted: 21 Mar 2019 07:29
by emo_apostolov
Hello! I can't write the extension of my own, that's why I am asking for help here. My general idea is:
1. Read all files from folder A, then play a random file from folder A.
2. Read all files from folder B, then play a random file from folder B.
3. Go to start.

Re: Help with automatic selection

Posted: 26 Mar 2019 14:37
by mederi
1. Read VLC playlist: folder A => list A, folder B => list B
2. Shuffle lists
3. Mix lists (AxB) => list AB
4. Play list AB
Advanced random playback - perhaps it is possible to jump to a next item in VLC playlist according to AB list (input_changed() and meta_changed() functions, vlc.playlist.goto( id )).
Advanced shuffle is simpler and possible for sure - just add AB list into VLC playlist and start to play it or reorder original VLC playlist (vlc.playlist.move( id_item, id_where )).