mirror of
https://github.com/iluvcapra/mfbatch.git
synced 2025-12-31 08:50:51 +00:00
Slight tweak to create_batch_file
This commit is contained in:
@@ -30,15 +30,15 @@ def execute_batch_list(batch_list_path: str, dry_run: bool, interactive: bool):
|
|||||||
parser._handle_line(line, line_no, interactive)
|
parser._handle_line(line, line_no, interactive)
|
||||||
|
|
||||||
|
|
||||||
def create_batch_list(command_file: str):
|
def create_batch_list(command_file: str, recursive= True):
|
||||||
"""
|
"""
|
||||||
Read all FLAC files in the cwd recursively and create a batchfile that
|
Read all FLAC files in the cwd and create a batchfile that re-creates all
|
||||||
re-creates all of their metadata.
|
of their metadata.
|
||||||
"""
|
"""
|
||||||
with open(command_file, mode='w', encoding='utf-8') as f:
|
with open(command_file, mode='w', encoding='utf-8') as f:
|
||||||
f.write("# mfbatch\n\n")
|
f.write("# mfbatch\n\n")
|
||||||
metadatums = {}
|
metadatums = {}
|
||||||
flac_files = glob('./**/*.flac', recursive=True)
|
flac_files = glob('./**/*.flac', recursive=recursive)
|
||||||
flac_files = sorted(flac_files)
|
flac_files = sorted(flac_files)
|
||||||
for path in tqdm(flac_files, unit='File', desc='Scanning FLAC files'):
|
for path in tqdm(flac_files, unit='File', desc='Scanning FLAC files'):
|
||||||
this_file_metadata = flac.read_metadata(path)
|
this_file_metadata = flac.read_metadata(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user