this is the one i use which selects playlists at random, and shuffles the the playlist on start up too- i didn't write it though not sure if it is up at the xbmc site or not
CODE |
# Lit une playlist aleatoirement ################################################################### # Ce code est les propriété de [email protected] # # version 0.1 # ###################################################################
import os.path, string import glob, random import xbmc, xbmcgui
filename = [] Repertoire = 'Q:\\albums\\playlists'
def listRep ( args, dirname, filenames ): global filename filename[:0] = glob.glob(dirname + '\*.m3u') os.path.walk(Repertoire, listRep, None ) a = len(filename) if a > 0: nb = random.randint(0,a-1) pls = xbmc.PlayList(0) pls.load(filename[nb]) pls.shuffle() xbmc.Player().play(pls) else: dialog = xbmcgui.Dialog() dialog.ok(" Error", " No list found") |
Just remember to edit the path to your playlists- the script i've got is called "RandomPlay.py"
copy the code paste it in notepad and saves a whatever.py, but then change the autoexec.py to reference whatever.py
HTH
This post has been edited by nimbles on Aug 5 2004, 10:42 AM