Revert to the old category processing order

If no category is specified in PATH_METADATA or FILENAME_METADATA,
fall back to USE_FOLDER_AS_CATEGORY, which defaults to True.
This commit is contained in:
Li Jiapeng 2016-09-19 18:29:58 +08:00
commit 0f6b98506e

View file

@ -659,7 +659,7 @@ def parse_path_metadata(source_path, settings=None, process=None):
('PATH_METADATA', source_path)]:
checks.append((settings.get(key, None), data))
if settings.get('USE_FOLDER_AS_CATEGORY', None):
checks.insert(0, ('(?P<category>.*)', subdir))
checks.append(('(?P<category>.*)', subdir))
for regexp, data in checks:
if regexp and data:
match = re.match(regexp, data)