Add ignore directories functionality. #262
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First commit
Add ignore directories functionality
Added the ability to ignore folders.
A new environmental variable
AUTOMATED_CONVERSION_IGNORE_DIRECTORIES
has been added.This variable expects to receive a space-separated list of directories which will be ignored.
This is useful in the case that you need to transcode many files across multiple directories, which will be changing, so this way you can exclude cache folders or anything that is not really necessary to find or spend time on.
Basically, I added a dynamic list of parameters in the necessary find calls. This list is generated based on a new method which I refactored where I moved the initialization of all the environmental variables which now makes it all easier to understand (method
set_default_settings
).My use case:
I needed to transcode every .avi file from a Nextcloud deployment. Watching files was really exhausting because it used to "find" files in thumbnail folders which took a really long time, plus the time spent doing
AUTOMATED_CONVERSION_SOURCE_STABLE_TIME
which after many files can be a huge amount of time.Second commit
If AUTOMATED_CONVERSION_VIDEO_FILE_EXTENSIONS is set, find returns files with these extensions
This basically follows the same idea as before, improve efficiency on big file systems. In the
find
calls, dynamic parameters have been added, this wayfind
just returns files which have one of the extensions of AUTOMATED_CONVERSION_VIDEO_FILE_EXTENSIONS.This way, we completely ignore files that we do not care about. Again, we do not spend time doing
AUTOMATED_CONVERSION_SOURCE_STABLE_TIME
which after many files can be a huge amount of time.Third commit
Fix find for using -o(or) while filtering by extensions
Minor fix. Just what the commit message states.