From b833ec1b19befe179216ed45116cbb62bb845575 Mon Sep 17 00:00:00 2001 From: yaleman <yaleman@ricetek.net> Date: Wed, 14 Mar 2012 23:44:38 +1000 Subject: [PATCH] Added code to ignore certain files As per issue 1853, ignoring certain OSX metadata. --- sickbeard/postProcessor.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index 0d7c8c1f3..1952328d5 100755 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -50,7 +50,8 @@ class PostProcessor(object): EXISTS_SAME = 2 EXISTS_SMALLER = 3 DOESNT_EXIST = 4 - + + IGNORED_FILESTRINGS = [ "/.AppleDouble/", ".DS_Store" ] def __init__(self, file_path, nzb_name = None): # absolute path to the folder that is being processed self.folder_path = ek.ek(os.path.dirname, ek.ek(os.path.abspath, file_path)) @@ -85,7 +86,7 @@ class PostProcessor(object): # if the new file exists, return the appropriate code depending on the size if ek.ek(os.path.isfile, existing_file): - + # see if it's bigger than our old file if ek.ek(os.path.getsize, existing_file) > ek.ek(os.path.getsize, self.file_path): self._log(u"File "+existing_file+" is larger than "+self.file_path, logger.DEBUG) @@ -597,6 +598,10 @@ class PostProcessor(object): if os.path.isdir( self.file_path ): self._log(u"File "+self.file_path+" seems to be a directory") return False + for ignore_file in self.IGNORED_FILESTRINGS: + if ignore_file in self.file_path: + self._log(u"File {0} is ignored type, skipping".format( self.file_path ) ) + return False # reset per-file stuff self.in_history = False -- GitLab