logging fixes + ich meeeesse

main
dev_alex 1 year ago
parent af36409d50
commit 6f78e17a59

@ -39,12 +39,13 @@ def decrypt_aax_file(aax_path: str, profile:str):
#Erstellen von Profil
with open('profiles.yml', 'w') as profile_yaml:
yaml.dump({profile : profile_id}, profile_yaml, default_flow_style=False)
logging.info(f"Profile-Id in Profil {profile} gespeichert.")
except subprocess.CalledProcessError as err:
logging.info(f"Fehler bei Prozess ausfuehrung. {err}")
def convert_to_m4b(aax_path:str, profile:str):
logging.info("Ich converteeee...")
logging.info("Ich conveeeeerte...")
try:
#Laden des Profils
@ -52,7 +53,7 @@ def convert_to_m4b(aax_path:str, profile:str):
with open('profiles.yml', 'r') as profile_yaml:
profiles = yaml.safe_load(profile_yaml)
profile_id = profiles.get(profile)
logging.info(f'Loaded Profile: {profile}')
logging.debug(f'Loaded Profile: {profile}')
aax_name = aax_path.split('/')[1] # Fuer vollen Datei-Name
aax_name = aax_name.split('.')[0] # Fuer Datei-Namen ohne Endung
@ -119,10 +120,14 @@ if __name__ == "__main__":
convert_to_m4b(aax_file, profile)
elif args.cmd == "convert-all":
logging.info(f"Convert wird fuer alle aax im Input-Ordner durchgefuehrt")
#TODO Implement
if profiles is None or profiles.get(args.profile) is None or args.profile not in profiles:
logging.info(f"Profil {args.profile} existiert nicht. Bitte ueber decrypt anlegen lassen.")
sys.exit()
logging.info(f"Convert wird fuer alle aax im Input-Ordner durchgefuehrt")
aax_inputs_path = "aax_inputs"
for root, dirs, files in os.walk(aax_inputs_path):
for name in files:
if name.endswith((".aax")):
aax_file_path = os.path.join(aax_inputs_path, name)
convert_to_m4b(aax_file_path, args.profile)

Loading…
Cancel
Save