Browse Source

Added support for overriding the simple-rename action via envvar.

master
treyzania 3 years ago
parent
commit
c436597b83
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      booty.py

+ 7
- 1
booty.py View File

@@ -76,6 +76,12 @@ def gen_title_action(fpath, action):

return { 'src': fpath, 'action': action, 'medianame': mname }

def get_simple_rename_action():
if 'BOOTY_SIMPLE_RENAME_ACTION' in os.environ:
return os.environ['BOOTY_SIMPLE_RENAME_ACTION']
else:
return cfg['simpleaction']

# Now go over all of the input files and figure out what to do with them.
sources = []
rarregex = re.compile('\\.r[0-9][0-9]')
@@ -85,7 +91,7 @@ for f in os.listdir(os.getcwd()):

name, ext = os.path.splitext(f)
if ext in video_exts:
sources.append(gen_title_action(f, cfg['simpleaction']))
sources.append(gen_title_action(f, get_simple_rename_action()))
elif ext == '.rar':

# RARs are a little more complicated to handle.

Loading…
Cancel
Save