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

Blacklist doesn't process full_path correctly #120

Open
felciano opened this issue Oct 4, 2015 · 1 comment
Open

Blacklist doesn't process full_path correctly #120

felciano opened this issue Oct 4, 2015 · 1 comment

Comments

@felciano
Copy link

felciano commented Oct 4, 2015

The blacklist feature doesn't correctly allow you to filter out files based on path components. For example, I believe the following should tell tvnamer to ignore any files under the .AppleDouble directory:

{
    "is_regex": false,
    "full_path": true,
    "match": ".AppleDouble"
}

This doesn't work -- any media files (or rather their corresponding resource forks, which I believe is what ends up being created by OSX in AppleDouble directories) are processed by tvnamer as if they were real media files.

I believe the culprit is _findFilesInPath which incorrectly checks the blacklist with a file basename instead of full pathname:

        for subf in os.listdir(string_type(startpath)):
            newpath = os.path.join(startpath, subf)
            newpath = os.path.abspath(newpath)
            if os.path.isfile(newpath):
                if not self._checkExtension(subf):
                    continue
                elif self._blacklistedFilename(subf):
                    continue
                else:
                    allfiles.append(newpath)
            else:
                if self.recursive:
                    allfiles.extend(self._findFilesInPath(newpath))
                #end if recursive
            #end if isfile
        #end for sf

The line in the middle should read:

                elif self._blacklistedFilename(newpath):

instead of

                elif self._blacklistedFilename(subf):
@queeup
Copy link

queeup commented Nov 13, 2016

Yes you are right. @dbr could you check this pls.

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

No branches or pull requests

2 participants