First and foremost, I'm putting this out there that:
I have no freakin' clue when it comes to coding or what is inside of these scripts.
It doesn't autodetect the playlists that I have in the XBMC Music Library.
If I had to pick one playlist for it to play on bootup if I couldn't get it to read all of my playlists in my XBMC music library, it is in a simple directory.
E:/Main.m3u
I have the 6/6/06 build of XBMC.
That's the address for the playlist. Here is the script before any editing:
# ---------------------------------------- #
# Code
# ---------------------------------------- #
# Function for adding files to playlist
def add_files(pl, dirname, names):
for filename in names:
if (os.path.isfile(dirname + "\\" + filename)):
add = 0
# Check extension of file.
if (filename[-4:] == ".mp3"): add = 1
if (filename[-4:] == ".ogg"): add = 1
if (filename[-4:] == ".wav"): add = 1
if (filename[-5:] == ".flac"): add = 1
# If file is to be added, do it.
if (add == 1): pl.add(dirname + "\\" + filename)
elif (os.path.isdir(dirname + "\\" + filename)):
os.path.walk(dirname + "\\" + filename, add_files, pl)
# Get music playlist from XBMC
plist = xbmc.PlayList(0)
plist.clear()
# Load playlist if it exists
for playlist_file in playlist_files:
if (os.path.isfile(playlist_file)):
plist.load(playlist_file)
# Else, find all available music
else:
for music_dir in music_dirs:
os.path.walk(music_dir, add_files, plist)
# Do the shuffle!
if (shuffle_files == 1): plist.shuffle()
xbmc.Player().play(plist)
Now, what do I need to copy and paste in there to get this thing working?