Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion flac2all_pkg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ def clustered_encode(localworkers=False):
sys.exit(1)
# log.print(list(set([x[0] for x in inlist]) - set([x[0] for x in results])))
# generate_summary(start_time, end_time, incount, results)
baseI.write_logfile(opts['outdir'], results)
# Write logfile unless disabled by user
if not opts.get('nolog', False):
baseI.write_logfile(opts['outdir'], results)


def build_parser():
Expand Down Expand Up @@ -366,6 +368,11 @@ def build_parser():
default=False, help="Don't create Directories, if \"-n d\" put everything together, if \"-n m\" don't create mode dirs"
)

parser.add_option(
"--nolog", dest="nolog", action="store_true",
default=False, help="Do not write conversion_results.log at the end"
)

parser.add_option(
"-m", "--master", dest="master_enable", action="store_true",
default=False, help="Start flac2all in master mode (for clustering)."
Expand Down Expand Up @@ -435,6 +442,12 @@ def main():
# As the copy folder is created in the shell module, we
# do not have to do anything else here
continue

# Only create per-mode directories if the user did not request
# "-n m" (i.e. don't create mode directories)
if opts['nodirs'] == "m":
continue

try:
os.mkdir(os.path.join(opts['outdir'], mode))
except OSError as e:
Expand Down
1 change: 1 addition & 0 deletions flac2all_pkg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ def __init__(self):
"flacopts": "", # your flac encoder settings
"aacplusopts": "-a 1 -t 29",
"opusencopts": "vbr",
"nolog": False, # do not write conversion_results.log at the end
}
4 changes: 2 additions & 2 deletions flac2all_pkg/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ def encode(self, infile, mode, opts):
# $execution_time¬
# ]

if opts['nodirs'] is "d":
if opts['nodirs'] == "d":
# We don't want any directories, put everything in one place
# 1. Get file name from infile
outfile = infile.rsplit('/', 1)[-1]
outfile = os.path.join(opts['outdir'], outfile) # This removes the mode folders as well
elif opts['nodirs'] is "m":
elif opts['nodirs'] == "m":
# We want to keep directory structure, but not output "per mode" folders. This puts all difference encodings
# In the same folders
outfile = infile.replace(opts['dirpath'], os.path.join(opts['outdir']))
Expand Down