diff --git a/CHANGES.md b/CHANGES.md index 15b11a9..79fe28a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -30,6 +30,11 @@ * Change remove deprecated `buildNameCache` +### 0.21.18 (2020-03-04 19:20:00 UTC) + +* Fix NotifierFactory AttributeError on first run init + + ### 0.21.17 (2020-03-03 21:35:00 UTC) * Fix do not process magnet links in search results diff --git a/lib/sg_helpers.py b/lib/sg_helpers.py index 11ad797..f2cae55 100644 --- a/lib/sg_helpers.py +++ b/lib/sg_helpers.py @@ -465,13 +465,13 @@ def chmod_as_parent(child_path): logger.error(u'Failed to set permission for %s to %o' % (child_path, child_mode)) -def make_dirs(path, syno=True): +def make_dirs(path, syno=False): """ Creates any folders that are missing and assigns them the permissions of their parents :param path: path :type path: AnyStr - :param syno: + :param syno: whether to trigger a syno library update for path :type syno: bool :return: success :rtype: bool @@ -504,7 +504,6 @@ def make_dirs(path, syno=True): ek.ek(os.mkdir, sofar) # use normpath to remove end separator, otherwise checks permissions against itself chmod_as_parent(ek.ek(os.path.normpath, sofar)) - # todo: reenable if syno: # do the library update for synoindex NOTIFIERS.NotifierFactory().get('SYNOINDEX').addFolder(sofar) @@ -534,7 +533,7 @@ def write_file(filepath, # type: AnyStr """ result = False - if make_dirs(ek.ek(os.path.dirname, filepath), False): + if make_dirs(ek.ek(os.path.dirname, filepath)): try: if raw: with ek.ek(io.FileIO, filepath, 'wb') as fh: diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index e1ef82f..23eb44f 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -600,7 +600,7 @@ def rename_ep_file(cur_path, new_path, old_path_length=0): # put the extension on the incoming file new_path += cur_file_ext - make_dirs(ek.ek(os.path.dirname, new_path)) + make_dirs(ek.ek(os.path.dirname, new_path), syno=True) # move the file try: diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index a309600..c56db53 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -1141,7 +1141,7 @@ class PostProcessor(object): self._log(u'Destination folder for this episode is ' + dest_path, logger.DEBUG) # create any folders we need - if not helpers.make_dirs(dest_path): + if not helpers.make_dirs(dest_path, syno=True): raise exceptions_helper.PostProcessingFailed(u'Unable to create destination folder: ' + dest_path) # figure out the base name of the resulting episode file