plexinc-plugins/Scanners.bundle — pull request #23 by mmccurdy07 (2013-06-01 19:45:53+00:00)
Title: Implement .plexignore, refactor some Utils

Allows for a .plexignore file in any directory or in the root(s) of a section. Has a .gitignore-style syntax:

* Blank lines are ignored.
* Lines starting with # are comments.
* Patterns without '/'s (e.g. *.mkv) match filenames in the same directory as the .plexignore file, or anywhere in the tree if .plexignore is a root of the section.
* Patterns with '/'s (e.g. somedir/*) are treated like python-style globs and always match relative to the directory containing the .plexignore file.

Utils refactor consists of:

* Using os.path.split() to implement SplitPath() (which is slightly safer than string searches for delimiters)
* Moving ContainsFile into Utils.py

Note: this version now takes advantage of the "root" param if passed by PMS and behaves exactly the same as the current Scanner if that param is missing.