mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-19 23:44:01 +01:00
Add advanced option to ignore folder patterns (#2037).
Applies to post processing folders and library scan folders. There is no configuration option in the web interface (yet), but one can specify the following in the INI file (make sure Headphones is shut down!). [Advances] ... ignored_folders = *.git, *.btsync ...
This commit is contained in:
@@ -1078,10 +1078,22 @@ def forcePostProcess(dir=None, expand_subfolders=True, album_dir=None):
|
||||
else:
|
||||
folders.append(path_to_folder)
|
||||
|
||||
# Scan for ignored folders. A copy of the list is taken because the original
|
||||
# list is modified and list comprehensions don't work because of logging.
|
||||
patterns = headphones.CONFIG.IGNORED_FOLDERS
|
||||
ignored = 0
|
||||
|
||||
for folder in folders[:]:
|
||||
if helpers.path_match_patterns(folder, patterns):
|
||||
logger.debug("Folder ignored by pattern: %s", folder)
|
||||
folders.remove(folder)
|
||||
ignored += 1
|
||||
|
||||
# Log number of folders
|
||||
if folders:
|
||||
logger.info('Found %i folders to process.', len(folders))
|
||||
logger.debug('Expanded post processing folders: %s', folders)
|
||||
logger.info('Found %d folders to process (%d ignored).',
|
||||
len(folders), ignored)
|
||||
else:
|
||||
logger.info('Found no folders to process. Aborting.')
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user