Generate a playlist using multiple directories on boot?
#1
Hi! I've been working on a Kodi project detailed in my other thread, and I'm ready to take it to the next level, but I need help because I've hit a wall.

What I'm trying to do: On boot, my Kodi devices use a script in autoexec.py to generate a playlist of every single video file in a single folder in a random order. What I want to do is something closer to a programming lineup for radio or TV - Turn on the Kodi device and then generate a playlist with several directories mixed together in a pattern I define.

So for example, let's say I have a Videos folder, an Ads, folder, and a Shorts folder. On boot I want to be able to define it so the playlist plays, for example, a file from Videos, a file from Ads, a video, an ad, a video, an ad, a file from Shorts, a video, etc. Even if it was as simple as having a Video and then a Short and just repeating like that, that would be fine.

The rub: Any extension that even comes close to this doesn't do it on boot and it always requires scraped media. I want to keep this as simple as possible, because any time I've tried to scrape media some shows are just not recognized (Captain N & the New Super Mario World is the big one that consistently gives me issues) or I just can't get it to work even if I use scrapers that just use the filename. I want to do this via code if I can, reduces the strain.

Current setup: On boot, as mentioned, autoexec.py runs the following code:
import xbmc
xbmc.executebuiltin("PlayMedia(/var/media/My Passport/Videos,isdir)")
xbmc.executebuiltin("PlayerControl(RandomOn)")
xbmc.executebuiltin("PlayerControl(RepeatAll)")


It works well! On boot a playlist is made of every single file in that folder in a random order. When it reaches the end, it repeats. But I'd really like to kick this up a notch and nothing I'm looking up has been helping.

So, yes, any help here would be really nice. If this isn't the right place to put this, let me know where else to put it. Hell, even if I have to somehow generate the playlist file outside of Kodi and import it so it plays on boot, I'm willing to do that. I just need to know what to do. Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Generate a playlist using multiple directories on boot?0