diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 1393ad84790ccd9df96ac7266070adf1fd9a71e3..ce5ac1b454377462094449b39c4ab5ef3bbfc36d 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -609,7 +609,8 @@ def chmodAsParent(childPath): logger.log(u"No parent path provided in "+childPath+", unable to get permissions from it", logger.DEBUG) return - parentMode = stat.S_IMODE(os.stat(parentPath)[stat.ST_MODE]) + parentPathStat = ek.ek(os.stat, parentPath) + parentMode = stat.S_IMODE(parentPathStat[stat.ST_MODE]) childPathStat = ek.ek(os.stat, childPath) childPath_mode = stat.S_IMODE(childPathStat[stat.ST_MODE]) @@ -647,7 +648,7 @@ def fixSetGroupID(childPath): return parentPath = ek.ek(os.path.dirname, childPath) - parentStat = os.stat(parentPath) + parentStat = ek.ek(os.stat, parentPath) parentMode = stat.S_IMODE(parentStat[stat.ST_MODE]) if parentMode & stat.S_ISGID: @@ -783,4 +784,4 @@ def md5_for_file(filename, block_size=2**16): f.close() return md5.hexdigest() except Exception: - return None \ No newline at end of file + return None diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index 9797c612ab648b52e4766a4d46d8988113517818..e2a74ef47892ce4355ad7a79c8e5f0d18b78cca2 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -16,18 +16,18 @@ # You should have received a copy of the GNU General Public License # along with Sick Beard. If not, see <http://www.gnu.org/licenses/>. -import sickbeard +import re +import datetime +import sickbeard from sickbeard.common import countryList from sickbeard.helpers import sanitizeSceneName from sickbeard.scene_exceptions import get_scene_exceptions from sickbeard import logger from sickbeard import db - -import re -import datetime - from name_parser.parser import NameParser, InvalidNameException +from lib.unidecode import unidecode + resultFilters = ["sub(pack|s|bed)", "nlsub(bed|s)?", "swesub(bed)?", "(dir|sample|nfo)fix", "sample", "(dvd)?extras", @@ -206,6 +206,7 @@ def isGoodResult(name, show, log=True): all_show_names = allPossibleShowNames(show) showNames = map(sanitizeSceneName, all_show_names) + all_show_names + showNames += map(unidecode, all_show_names) for curName in set(showNames): escaped_name = re.sub('\\\\[\\s.-]', '\W+', re.escape(curName))