Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignore directories functionality. #262

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

SalvaChiLlo
Copy link

@SalvaChiLlo SalvaChiLlo commented Apr 15, 2023

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 way find 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant