Update indexa.py

This commit is contained in:
JotaChina 2024-07-25 15:33:22 -03:00 committed by GitHub
parent 807a9cbbe5
commit c0bdb79a42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -80,16 +80,15 @@ def process_mmps_in_folder(folder_path):
print(f'Processando arquivo: {file_path}')
if file.endswith('.mmpz'):
destination_path = os.path.join(mmpz_folder, file)
shutil.move(file_path, destination_path)
print(f'Arquivo {file} movido para {destination_path}')
destination_path = os.path.join(mmpz_folder, file)
file_name = os.path.basename(destination_path)
file_name = os.path.splitext(file_name)[0] + ".mmp"
output_file_path = os.path.join(folder_path, file_name)
lmms_mmpz_convert = f'lmms --dump "{destination_path}" > "{output_file_path}"'
print(output_file_path[-1])
lmms_wav_convert = f'lmms -r {file_name[0]}.mmpz -o {output_file_path[-1]} -f wav'
file_name = file_name.split('.')
print(file_name[0])
lmms_wav_convert = f'lmms -r "{file_name[0]}.mmpz" -o "mmp/wav" -f wav'
try:
#desabilitando os servidores gráficos
os.environ['QT_DEBUG_PLUGINS'] = '1'
@ -99,6 +98,7 @@ def process_mmps_in_folder(folder_path):
print("Comando executado com sucesso!")
except subprocess.CalledProcessError as e:
print(f"Ocorreu um erro ao executar o comando: {e}")
try:
#desabilitando os servidores gráficos
os.environ['QT_DEBUG_PLUGINS'] = '1'
@ -108,6 +108,8 @@ def process_mmps_in_folder(folder_path):
print("Comando executado com sucesso!")
except subprocess.CalledProcessError as e:
print(f"Ocorreu um erro ao executar o comando: {e}")
shutil.move(file_path, destination_path)
print(f'Arquivo {file} movido para {destination_path}')
mmp_data = parse_mmp_file(output_file_path)
#caso tenha algum arquivo .mmp perdido na pasta
elif file.endswith('.mmp'):