Sfoglia il codice sorgente

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

master
treyzania 6 anni fa
parent
commit
c436597b83
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  1. 7
    1
      booty.py

+ 7
- 1
booty.py Vedi 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…
Annulla
Salva