Compare commits

...

2 Commits

Author SHA1 Message Date
JG
b8594f81a8 Merge pull request #417 from GuitarXY/fix/loader-directory-excludes
Handle loader datasets without excludes
2026-06-17 09:56:08 +08:00
xiaoyao
72969c501e Handle loader datasets without excludes 2026-06-16 21:37:58 +08:00

View File

@@ -31,9 +31,10 @@ class PlainDataLoader():
body += poem[tag]
return body
# a dir, probably with a skip list
subpaths = os.listdir(full_path)
excludes = set(configs.get("excludes", []))
subpaths = sorted(os.listdir(full_path))
for filename in subpaths:
if filename in configs["excludes"]:
if filename in excludes:
continue
with open(os.path.join(full_path, filename), mode='r', encoding='utf-8') as file:
data = json.load(file)