From ed5ed4b768fa7a912ac19c92c6e99f803843ad26 Mon Sep 17 00:00:00 2001 From: Dooho Yi Date: Thu, 30 Sep 2021 13:09:48 +0900 Subject: [PATCH] upd --- service.autoexec/autoexec.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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()