Commit eca1d42f authored by echel0n's avatar echel0n

Refactored naming convention of misc helper functions.

Added ability to disable stripping of special permissions from files.
parent 63f98ef0
# Changelog
- * fec82ca - 2018-11-11: Cleaned up subtitles code.
- * 23957a3 - 2018-11-11: Refactored naming convention of misc helper functions. Added ability to disable stripping of special permissions from files.
- * 63f98ef - 2018-11-11: Cleaned up subtitles code.
- * 1558dce - 2018-11-10: Fixed issue with displaying language flags in views
- * 0173a0f - 2018-11-10: Release v9.4.28
- * c5ea143 - 2018-11-10: Release v9.4.27
......
......@@ -204,14 +204,14 @@ class Core(object):
# migrate old database file names to new ones
if os.path.isfile(os.path.abspath(os.path.join(self.data_dir, 'sickbeard.db'))):
if os.path.isfile(os.path.join(self.data_dir, 'sickrage.db')):
helpers.moveFile(os.path.join(self.data_dir, 'sickrage.db'),
os.path.join(self.data_dir, '{}.bak-{}'
helpers.move_file(os.path.join(self.data_dir, 'sickrage.db'),
os.path.join(self.data_dir, '{}.bak-{}'
.format('sickrage.db',
datetime.datetime.now().strftime(
'%Y%m%d_%H%M%S'))))
helpers.moveFile(os.path.abspath(os.path.join(self.data_dir, 'sickbeard.db')),
os.path.abspath(os.path.join(self.data_dir, 'sickrage.db')))
helpers.move_file(os.path.abspath(os.path.join(self.data_dir, 'sickbeard.db')),
os.path.abspath(os.path.join(self.data_dir, 'sickrage.db')))
# load config
self.config.load()
......
......@@ -28,7 +28,7 @@ from hachoir_metadata import extractMetadata
from hachoir_parser import guessParser
import sickrage
from sickrage.core.helpers import copyFile
from sickrage.core.helpers import copy_file
from sickrage.metadata import GenericMetadata
......@@ -226,7 +226,7 @@ class ImageCache(object):
os.makedirs(self._thumbnails_dir())
sickrage.app.log.info("Copying from " + image_path + " to " + dest_path)
copyFile(image_path, dest_path)
copy_file(image_path, dest_path)
return True
......
......@@ -433,6 +433,7 @@ class Config(object):
self.calendar_icons = False
self.no_restart = False
self.allowed_video_file_exts = []
self.strip_special_file_bits = False
self.thetvdb_apitoken = ""
self.trakt_api_key = '5c65f55e11d48c35385d9e8670615763a605fad28374c8ae553a7b7a50651ddd'
self.trakt_api_secret = 'b53e32045ac122a445ef163e6d859403301ffe9b17fb8321d428531b69022a82'
......@@ -830,7 +831,8 @@ class Config(object):
'keep_processed_dir': True,
'processor_follow_symlinks': False,
'allowed_extensions': 'srt,nfo,srr,sfv',
'view_changelog': False
'view_changelog': False,
'strip_special_file_bits': True
},
'NZBget': {
'nzbget_host': '',
......@@ -1517,6 +1519,7 @@ class Config(object):
self.random_user_agent = self.check_setting_bool('General', 'random_user_agent')
self.allowed_extensions = self.check_setting_str('General', 'allowed_extensions')
self.view_changelog = self.check_setting_bool('General', 'view_changelog')
self.strip_special_file_bits = self.check_setting_bool('General', 'strip_special_file_bits')
# GUI SETTINGS
self.gui_lang = self.check_setting_str('GUI', 'gui_lang')
......@@ -2018,7 +2021,8 @@ class Config(object):
'processor_follow_symlinks': int(self.processor_follow_symlinks),
'delete_non_associated_files': int(self.delete_non_associated_files),
'allowed_extensions': self.allowed_extensions,
'view_changelog': int(self.view_changelog)
'view_changelog': int(self.view_changelog),
'strip_special_file_bits': int(self.strip_special_file_bits)
},
'GUI': {
'gui_lang': self.gui_lang,
......
This diff is collapsed.
......@@ -31,7 +31,8 @@ from sickrage.core.common import Quality, ARCHIVED, DOWNLOADED
from sickrage.core.exceptions import EpisodeNotFoundException, EpisodePostProcessingFailedException, \
NoFreeSpaceException
from sickrage.core.helpers import findCertainShow, show_names, replaceExtension, makeDir, \
chmodAsParent, moveFile, copyFile, hardlinkFile, moveAndSymlinkFile, remove_non_release_groups, remove_extension, \
chmod_as_parent, move_file, copy_file, hardlink_file, move_and_symlink_file, remove_non_release_groups, \
remove_extension, \
isFileLocked, verify_freespace, delete_empty_folders, make_dirs, symlink, is_rar_file, glob_escape
from sickrage.core.nameparser import InvalidNameException, InvalidShowException, \
NameParser
......@@ -365,7 +366,7 @@ class PostProcessor(object):
if not dir_exists:
sickrage.app.log.warning("Unable to create subtitles folder " + subs_new_path)
else:
chmodAsParent(subs_new_path)
chmod_as_parent(subs_new_path)
new_file_path = os.path.join(subs_new_path, new_file_name)
else:
new_file_path = os.path.join(new_path, new_file_name)
......@@ -386,8 +387,8 @@ class PostProcessor(object):
self._log("Moving file from " + cur_file_path + " to " + new_file_path, sickrage.app.log.DEBUG)
try:
moveFile(cur_file_path, new_file_path)
chmodAsParent(new_file_path)
move_file(cur_file_path, new_file_path)
chmod_as_parent(new_file_path)
except (IOError, OSError) as e:
self._log("Unable to move file {} to {}: {}".format(cur_file_path, new_file_path, e),
sickrage.app.log.WARNING)
......@@ -410,8 +411,8 @@ class PostProcessor(object):
self._log("Copying file from " + cur_file_path + " to " + new_file_path, sickrage.app.log.DEBUG)
try:
copyFile(cur_file_path, new_file_path)
chmodAsParent(new_file_path)
copy_file(cur_file_path, new_file_path)
chmod_as_parent(new_file_path)
except (IOError, OSError) as e:
self._log("Unable to copy file {} to {}: {}".format(cur_file_path, new_file_path, e),
sickrage.app.log.WARNING)
......@@ -438,8 +439,8 @@ class PostProcessor(object):
if os.path.exists(new_file_path):
os.remove(new_file_path)
hardlinkFile(cur_file_path, new_file_path)
chmodAsParent(new_file_path)
hardlink_file(cur_file_path, new_file_path)
chmod_as_parent(new_file_path)
except (IOError, OSError) as e:
self._log("Unable to hardlink file {} to {}: {}".format(cur_file_path, new_file_path, e),
sickrage.app.log.WARNING)
......@@ -463,8 +464,8 @@ class PostProcessor(object):
self._log("Moving then symbolic linking file from " + cur_file_path + " to " + new_file_path,
sickrage.app.log.DEBUG)
try:
moveAndSymlinkFile(cur_file_path, new_file_path)
chmodAsParent(new_file_path)
move_and_symlink_file(cur_file_path, new_file_path)
chmod_as_parent(new_file_path)
except (IOError, OSError) as e:
self._log("Unable to move and symlink file {} to {}: {}".format(cur_file_path, new_file_path, e),
sickrage.app.log.WARNING)
......@@ -492,7 +493,7 @@ class PostProcessor(object):
os.remove(new_file_path)
symlink(cur_file_path, new_file_path)
chmodAsParent(cur_file_path)
chmod_as_parent(cur_file_path)
except (IOError, OSError) as e:
self._log("Unable to symlink file {} to {}: {}".format(cur_file_path, new_file_path, e),
sickrage.app.log.WARNING)
......@@ -1050,7 +1051,7 @@ class PostProcessor(object):
try:
os.mkdir(ep_obj.show.location)
chmodAsParent(ep_obj.show.location)
chmod_as_parent(ep_obj.show.location)
# do the library update for synoindex
sickrage.app.notifier_providers['synoindex'].addFolder(ep_obj.show.location)
......
......@@ -26,7 +26,7 @@ from datetime import date
import sickrage
from sickrage.core.common import Quality
from sickrage.core.common import SKIPPED, WANTED, UNKNOWN
from sickrage.core.helpers import findCertainShow, sanitizeFileName, makeDir, chmodAsParent
from sickrage.core.helpers import findCertainShow, sanitizeFileName, makeDir, chmod_as_parent
from sickrage.core.queues.search import BacklogQueueItem
from sickrage.core.traktapi import srTraktAPI
from sickrage.indexers import IndexerApi
......@@ -428,7 +428,7 @@ class TraktSearcher(object):
sickrage.app.log.warning("Unable to create the folder %s , can't add the show" % showPath)
return
else:
chmodAsParent(showPath)
chmod_as_parent(showPath)
sickrage.app.show_queue.addShow(int(indexer), int(indexer_id), showPath,
default_status=status,
......
......@@ -34,7 +34,7 @@ from sickrage.core.exceptions import NoNFOException, \
EpisodeNotFoundException, EpisodeDeletedException
from sickrage.core.helpers import is_media_file, try_int, replaceExtension, \
touchFile, sanitizeSceneName, remove_non_release_groups, remove_extension, sanitizeFileName, \
safe_getattr, make_dirs, moveFile, delete_empty_folders
safe_getattr, make_dirs, move_file, delete_empty_folders
from sickrage.core.nameparser import NameParser, InvalidNameException, InvalidShowException
from sickrage.core.processors.post_processor import PostProcessor
from sickrage.core.scene_numbering import get_scene_absolute_numbering, get_scene_numbering
......@@ -1390,7 +1390,7 @@ class TVEpisode(object):
# move the file
try:
sickrage.app.log.info("Renaming file from %s to %s" % (cur_path, new_path))
moveFile(cur_path, new_path)
move_file(cur_path, new_path)
except (OSError, IOError) as e:
sickrage.app.log.warning("Failed renaming %s to %s : %r" % (cur_path, new_path, e))
return False
......
......@@ -46,7 +46,7 @@ from sickrage.core.common import ARCHIVED, DOWNLOADED, IGNORED, \
WANTED, dateFormat, dateTimeFormat, get_quality_string, statusStrings, \
timeFormat
from sickrage.core.exceptions import CantUpdateShowException, CantRemoveShowException, CantRefreshShowException
from sickrage.core.helpers import chmodAsParent, findCertainShow, makeDir, \
from sickrage.core.helpers import chmod_as_parent, findCertainShow, makeDir, \
pretty_filesize, sanitizeFileName, srdatetime, try_int, readFileBuffered, app_statistics
from sickrage.core.media.banner import Banner
from sickrage.core.media.fanart import FanArt
......@@ -2075,7 +2075,7 @@ class CMD_ShowAddNew(ApiCall):
return _responds(RESULT_FAILURE, {"path": showPath},
"Unable to create the folder " + showPath + ", can't add the show")
else:
chmodAsParent(showPath)
chmod_as_parent(showPath)
sickrage.app.show_queue.addShow(
int(indexer), int(self.indexerid), showPath, default_status=newStatus, quality=newQuality,
......
......@@ -58,7 +58,7 @@ from sickrage.core.common import FAILED, IGNORED, Overview, Quality, SKIPPED, \
from sickrage.core.exceptions import CantRefreshShowException, \
CantUpdateShowException, EpisodeDeletedException, \
NoNFOException, CantRemoveShowException
from sickrage.core.helpers import argToBool, backupSR, chmodAsParent, findCertainShow, generateApiKey, \
from sickrage.core.helpers import argToBool, backupSR, chmod_as_parent, findCertainShow, generateApiKey, \
getDiskSpaceUsage, makeDir, readFileBuffered, \
remove_article, restoreConfigZip, \
sanitizeFileName, clean_url, try_int, torrent_webui_url, checkbox_to_value, clean_host, \
......@@ -74,7 +74,7 @@ from sickrage.core.scene_exceptions import get_scene_exceptions, update_scene_ex
from sickrage.core.scene_numbering import get_scene_absolute_numbering, \
get_scene_absolute_numbering_for_show, get_scene_numbering, \
get_scene_numbering_for_show, get_xem_absolute_numbering_for_show, \
get_xem_numbering_for_show, set_scene_numbering
get_xem_numbering_for_show, set_scene_numbering, xem_refresh
from sickrage.core.traktapi import srTraktAPI
from sickrage.core.tv.episode import TVEpisode
from sickrage.core.tv.show.coming_episodes import ComingEpisodes
......@@ -1428,7 +1428,8 @@ class Home(WebHandler):
else:
showObj.release_groups.set_black_keywords([])
errors = []
warnings, errors = [], []
with showObj.lock:
newQuality = try_int(quality_preset, None)
if not newQuality:
......@@ -1465,7 +1466,7 @@ class Home(WebHandler):
if os.path.normpath(showObj.location) != os.path.normpath(location):
sickrage.app.log.debug(os.path.normpath(showObj.location) + " != " + os.path.normpath(location))
if not os.path.isdir(location) and not sickrage.app.config.create_missing_show_dirs:
errors.append("New location {} does not exist".format(location))
warnings.append("New location {} does not exist".format(location))
# don't bother if we're going to update anyway
elif not do_update:
......@@ -1480,7 +1481,7 @@ class Home(WebHandler):
# showObj.loadEpisodesFromIndexer()
# rescan the episodes in the new folder
except NoNFOException:
errors.append(
warnings.append(
_("The folder at %s doesn't contain a tvshow.nfo - copy your files to that folder before "
"you change the directory in SiCKRAGE.") % location)
......@@ -1500,17 +1501,23 @@ class Home(WebHandler):
update_scene_exceptions(showObj.indexerid, exceptions_list)
time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
except CantUpdateShowException as e:
errors.append(_("Unable to force an update on scene exceptions of the show."))
warnings.append(_("Unable to force an update on scene exceptions of the show."))
# if do_update_scene_numbering:
# try:
# xem_refresh(showObj.indexerid, showObj.indexer)
# time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
# except CantUpdateShowException as e:
# errors.append(_("Unable to force an update on scene numbering of the show."))
if do_update_scene_numbering:
try:
xem_refresh(showObj.indexerid, showObj.indexer)
time.sleep(cpu_presets[sickrage.app.config.cpu_preset])
except CantUpdateShowException as e:
warnings.append(_("Unable to force an update on scene numbering of the show."))
if directCall:
return map(str, errors)
return map(str, warnings + errors)
if len(warnings) > 0:
sickrage.app.alerts.warning(
_('{num_warnings:d} warning{plural} while saving changes:').format(num_warnings=len(warnings),
plural="" if len(warnings) == 1 else "s"),
'<ul>' + '\n'.join(['<li>{0}</li>'.format(warning) for warning in warnings]) + "</ul>")
if len(errors) > 0:
sickrage.app.alerts.error(
......@@ -2559,7 +2566,7 @@ class HomeAddShows(Home):
sickrage.app.log.warning("Unable to create the folder " + show_dir + ", can't add the show")
return
chmodAsParent(show_dir)
chmod_as_parent(show_dir)
sickrage.app.show_queue.addShow(indexer=1,
indexer_id=int(indexer_id),
......@@ -2669,7 +2676,7 @@ class HomeAddShows(Home):
# Don't redirect to default page because user wants to see the new show
return self.redirect("/home/")
else:
chmodAsParent(show_dir)
chmod_as_parent(show_dir)
# prepare the inputs for passing along
scene = checkbox_to_value(scene)
......@@ -3762,7 +3769,8 @@ class ConfigGeneral(Config):
indexer_timeout=None, download_url=None, rootDir=None, theme_name=None, default_page=None,
git_reset=None, git_username=None, git_password=None, git_autoissues=None, gui_language=None,
display_all_seasons=None, showupdate_stale=None, notify_on_login=None, allowed_video_file_exts=None,
enable_api_providers_cache=None, enable_upnp=None, web_external_port=None, **kwargs):
enable_api_providers_cache=None, enable_upnp=None, web_external_port=None,
strip_special_file_bits=None, **kwargs):
results = []
......@@ -3825,6 +3833,8 @@ class ConfigGeneral(Config):
sickrage.app.config.allowed_video_file_exts = [x.lower() for x in allowed_video_file_exts.split(',')]
sickrage.app.config.strip_special_file_bits = checkbox_to_value(strip_special_file_bits)
# sickrage.app.config.change_web_external_port(web_external_port)
if date_preset:
......
......@@ -1216,6 +1216,21 @@
</div>
</div>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('Strip special filesystem bits from files')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<label class="form-check-label">
<input type="checkbox" class="toggle color-primary is-material" name="strip_special_file_bits"
id="strip_special_file_bits" ${('', 'checked')[bool(sickrage.app.config.strip_special_file_bits)]}/>
${_('Strips special filesystem bits from files, if disabled will leave special bits intact.')}<br/>
<div class="text-info">
<b>${_('NOTE:')}</b> ${_('This will strip inherited permissions')}</div>
</label>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<input type="submit" class="btn config_submitter" value="${_('Save Changes')}"/>
......
......@@ -32,7 +32,7 @@ from requests.utils import dict_from_cookiejar
from urllib3 import disable_warnings
import sickrage
from sickrage.core.helpers import chmodAsParent, remove_file_failed
from sickrage.core.helpers import chmod_as_parent, remove_file_failed
from sickrage.core.helpers.encoding import to_unicode
......@@ -113,7 +113,7 @@ class WebSession(Session):
if chunk:
f.write(chunk)
chmodAsParent(filename)
chmod_as_parent(filename)
except Exception as e:
sickrage.app.log.debug("Failed to download file from {} - ERROR: {}".format(url, e))
remove_file_failed(filename)
......
......@@ -26,7 +26,7 @@ from xml.etree.ElementTree import ElementTree
import fanart
import sickrage
from sickrage.core.helpers import chmodAsParent, replaceExtension, try_int
from sickrage.core.helpers import chmod_as_parent, replaceExtension, try_int
from sickrage.indexers import IndexerApi
from sickrage.indexers.exceptions import indexer_error, indexer_episodenotfound, indexer_seasonnotfound
from sickrage.metadata.helpers import getShowImage
......@@ -374,14 +374,14 @@ class GenericMetadata(object):
if not os.path.isdir(nfo_file_dir):
sickrage.app.log.debug("Metadata dir didn't exist, creating it at " + nfo_file_dir)
os.makedirs(nfo_file_dir)
chmodAsParent(nfo_file_dir)
chmod_as_parent(nfo_file_dir)
sickrage.app.log.debug("Writing show nfo file to " + nfo_file_path)
with io.open(nfo_file_path, 'wb') as nfo_file:
data.write(nfo_file, encoding='utf-8')
chmodAsParent(nfo_file_path)
chmod_as_parent(nfo_file_path)
except IOError as e:
sickrage.app.log.warning(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
......@@ -418,14 +418,14 @@ class GenericMetadata(object):
if not os.path.isdir(nfo_file_dir):
sickrage.app.log.debug("Metadata dir didn't exist, creating it at " + nfo_file_dir)
os.makedirs(nfo_file_dir)
chmodAsParent(nfo_file_dir)
chmod_as_parent(nfo_file_dir)
sickrage.app.log.debug("Writing episode nfo file to " + nfo_file_path)
with io.open(nfo_file_path, 'wb') as nfo_file:
data.write(nfo_file, encoding='utf-8')
chmodAsParent(nfo_file_path)
chmod_as_parent(nfo_file_path)
except IOError as e:
sickrage.app.log.warning(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
......@@ -603,12 +603,12 @@ class GenericMetadata(object):
if not os.path.isdir(image_dir):
sickrage.app.log.debug("Metadata dir didn't exist, creating it at " + image_dir)
os.makedirs(image_dir)
chmodAsParent(image_dir)
chmod_as_parent(image_dir)
with io.open(image_path, 'wb') as outFile:
outFile.write(image_data)
chmodAsParent(image_path)
chmod_as_parent(image_path)
except IOError as e:
sickrage.app.log.warning(
"Unable to write image to " + image_path + " - are you sure the show folder is writable? {}".format(e))
......
......@@ -27,7 +27,7 @@ import sickrage
from mediabrowser import MediaBrowserMetadata
from sickrage.core.common import dateFormat
from sickrage.core.exceptions import ShowNotFoundException
from sickrage.core.helpers import replaceExtension, indentXML, chmodAsParent
from sickrage.core.helpers import replaceExtension, indentXML, chmod_as_parent
from sickrage.indexers import IndexerApi
from sickrage.indexers.exceptions import indexer_episodenotfound, \
indexer_error, indexer_seasonnotfound, indexer_shownotfound
......@@ -369,7 +369,7 @@ class Mede8erMetadata(MediaBrowserMetadata):
if not os.path.isdir(nfo_file_dir):
sickrage.app.log.debug("Metadata dir didn't exist, creating it at " + nfo_file_dir)
os.makedirs(nfo_file_dir)
chmodAsParent(nfo_file_dir)
chmod_as_parent(nfo_file_dir)
sickrage.app.log.debug("Writing show nfo file to " + nfo_file_path)
......@@ -377,7 +377,7 @@ class Mede8erMetadata(MediaBrowserMetadata):
data.write(nfo_file)
nfo_file.close()
chmodAsParent(nfo_file_path)
chmod_as_parent(nfo_file_path)
except IOError as e:
sickrage.app.log.error(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
......@@ -414,7 +414,7 @@ class Mede8erMetadata(MediaBrowserMetadata):
if not os.path.isdir(nfo_file_dir):
sickrage.app.log.debug("Metadata dir didn't exist, creating it at " + nfo_file_dir)
os.makedirs(nfo_file_dir)
chmodAsParent(nfo_file_dir)
chmod_as_parent(nfo_file_dir)
sickrage.app.log.debug("Writing episode nfo file to " + nfo_file_path)
......@@ -422,7 +422,7 @@ class Mede8erMetadata(MediaBrowserMetadata):
data.write(nfo_file)
nfo_file.close()
chmodAsParent(nfo_file_path)
chmod_as_parent(nfo_file_path)
except IOError as e:
sickrage.app.log.warning(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
......
......@@ -24,7 +24,7 @@ import os
import sickrage
from sickrage.core.exceptions import ShowNotFoundException
from sickrage.core.helpers import chmodAsParent
from sickrage.core.helpers import chmod_as_parent
from sickrage.indexers import IndexerApi
from sickrage.indexers.exceptions import indexer_episodenotfound, \
indexer_error, indexer_seasonnotfound, indexer_shownotfound
......@@ -312,7 +312,7 @@ class TIVOMetadata(GenericMetadata):
if not os.path.isdir(nfo_file_dir):
sickrage.app.log.debug("Metadata dir didn't exist, creating it at " + nfo_file_dir)
os.makedirs(nfo_file_dir)
chmodAsParent(nfo_file_dir)
chmod_as_parent(nfo_file_dir)
sickrage.app.log.debug("Writing episode nfo file to " + nfo_file_path)
......@@ -320,7 +320,7 @@ class TIVOMetadata(GenericMetadata):
# Calling encode directly, b/c often descriptions have wonky characters.
nfo_file.write(data.encode("utf-8"))
chmodAsParent(nfo_file_path)
chmod_as_parent(nfo_file_path)
except EnvironmentError as e:
sickrage.app.log.warning(
......
......@@ -40,7 +40,8 @@ from sickrage.core.api.cache import TorrentCacheAPI
from sickrage.core.caches.tv_cache import TVCache
from sickrage.core.classes import NZBSearchResult, SearchResult, TorrentSearchResult
from sickrage.core.common import MULTI_EP_RESULT, Quality, SEASON_RESULT, cpu_presets
from sickrage.core.helpers import chmodAsParent, findCertainShow, sanitizeFileName, clean_url, bs4_parser, validate_url, \
from sickrage.core.helpers import chmod_as_parent, findCertainShow, sanitizeFileName, clean_url, bs4_parser, \
validate_url, \
try_int, convert_size
from sickrage.core.helpers.show_names import allPossibleShowNames
from sickrage.core.nameparser import InvalidNameException, InvalidShowException, NameParser
......@@ -819,7 +820,7 @@ class NZBProvider(GenericProvider):
with io.open(filename, 'w') as fileOut:
fileOut.write(result.extraInfo[0])
chmodAsParent(filename)
chmod_as_parent(filename)
return True
except EnvironmentError as e:
......@@ -935,7 +936,7 @@ class TorrentRssProvider(TorrentProvider):
with io.open(dumpName, 'wb') as fileOut:
fileOut.write(data)
chmodAsParent(dumpName)
chmod_as_parent(dumpName)
sickrage.app.log.info("Saved custom_torrent html dump %s " % dumpName)
except IOError as e:
......
......@@ -28,7 +28,7 @@ from subliminal import save_subtitles
import sickrage
from sickrage.core import makeDir
from sickrage.core.helpers import chmodAsParent
from sickrage.core.helpers import chmod_as_parent
# register provider
from sickrage.core.scene_exceptions import get_scene_exceptions
from sickrage.subtitles.providers.utils import hash_itasa
......@@ -241,7 +241,7 @@ def get_subtitles_path(video_path):
if not dir_exists:
sickrage.app.log.warning('Unable to create subtitles folder {}'.format(new_subtitles_path))
else:
chmodAsParent(new_subtitles_path)
chmod_as_parent(new_subtitles_path)
else:
new_subtitles_path = os.path.dirname(video_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment