mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Fix configfile for pathlib.Path as infile
This commit is contained in:
parent
e8f7f5cece
commit
d889cbdfe3
2 changed files with 9 additions and 9 deletions
|
@ -90,10 +90,10 @@ class Section(configobj.Section):
|
||||||
|
|
||||||
|
|
||||||
class ConfigObj(configobj.ConfigObj, Section):
|
class ConfigObj(configobj.ConfigObj, Section):
|
||||||
def __init__(self, *args, **kw):
|
def __init__(self, infile=None, *args, **kw):
|
||||||
if len(args) == 0:
|
if infile is None:
|
||||||
args = (core.CONFIG_FILE,)
|
infile = core.CONFIG_FILE
|
||||||
super().__init__(*args, **kw)
|
super().__init__(os.fspath(infile), *args, **kw)
|
||||||
self.interpolation = False
|
self.interpolation = False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -115,7 +115,7 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# check for autoProcessMedia.cfg and create if it does not exist
|
# check for autoProcessMedia.cfg and create if it does not exist
|
||||||
if not os.path.isfile(core.CONFIG_FILE):
|
if not core.CONFIG_FILE.is_file():
|
||||||
shutil.copyfile(core.CONFIG_SPEC_FILE, core.CONFIG_FILE)
|
shutil.copyfile(core.CONFIG_SPEC_FILE, core.CONFIG_FILE)
|
||||||
CFG_OLD = config(core.CONFIG_FILE)
|
CFG_OLD = config(core.CONFIG_FILE)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
|
@ -123,7 +123,7 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# check for autoProcessMedia.cfg.spec and create if it does not exist
|
# check for autoProcessMedia.cfg.spec and create if it does not exist
|
||||||
if not os.path.isfile(core.CONFIG_SPEC_FILE):
|
if not core.CONFIG_SPEC_FILE.is_file():
|
||||||
shutil.copyfile(core.CONFIG_FILE, core.CONFIG_SPEC_FILE)
|
shutil.copyfile(core.CONFIG_FILE, core.CONFIG_SPEC_FILE)
|
||||||
CFG_NEW = config(core.CONFIG_SPEC_FILE)
|
CFG_NEW = config(core.CONFIG_SPEC_FILE)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
|
|
|
@ -57,9 +57,9 @@ def is_video_good(video: pathlib.Path, status, require_lan=None):
|
||||||
'TRANSCODER',
|
'TRANSCODER',
|
||||||
)
|
)
|
||||||
if disable:
|
if disable:
|
||||||
if (
|
if status:
|
||||||
status
|
# if the download was 'failed', assume bad.
|
||||||
): # if the download was 'failed', assume bad. If it was successful, assume good.
|
# If it was successful, assume good.
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue