diff --git a/service.autoexec/autoexec.py b/service.autoexec/autoexec.py index efc7817..62289da 100644 --- a/service.autoexec/autoexec.py +++ b/service.autoexec/autoexec.py @@ -1,11 +1,20 @@ # Autoplay videodirectory import os, xbmc +import re # set path to dir you want to play path = "/var/media/USB" +# filter out unwanted + +# dot(.) files +PATTERN1 = re.compile(r"^\..+") +# System Volume Information folder +PATTERN2 = re.compile(r"System Volume Information") + dirList = os.listdir(path) -dirList[:] = [d for d in dirList if not os.path.isdir(path + d)] +dirList[:] = [d for d in dirList if not PATTERN1.match(d)] +dirList[:] = [d for d in dirList if not PATTERN2.match(d)] videoList = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) videoList.clear()