Browse Source

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

master
treyzania 6 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



return { 'src': fpath, 'action': action, 'medianame': mname } 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. # Now go over all of the input files and figure out what to do with them.
sources = [] sources = []
rarregex = re.compile('\\.r[0-9][0-9]') rarregex = re.compile('\\.r[0-9][0-9]')


name, ext = os.path.splitext(f) name, ext = os.path.splitext(f)
if ext in video_exts: 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': elif ext == '.rar':


# RARs are a little more complicated to handle. # RARs are a little more complicated to handle.

Loading…
Cancel
Save