diff --git a/main.py b/main.py index e868cdc..c79f397 100644 --- a/main.py +++ b/main.py @@ -868,7 +868,8 @@ class MainWindow(QMainWindow): output_name = output_name.replace("{series}", series) output_name = output_name.replace("{season}", season) output_name = output_name.replace("{episode}", episode) - output_name = output_name.replace("{path}", custom_path) + # Entferne {path} Platzhalter, da custom_path jetzt als output_dir verwendet wird + output_name = output_name.replace("{path}", "") # {extension} durch .%(ext)s ersetzen (auch rückwärtskompatibel) output_name = output_name.replace("{extension}", ".%(ext)s") # Falls jemand %(ext)s nicht im Template hat, ergänzen wir es am Ende @@ -889,14 +890,10 @@ class MainWindow(QMainWindow): return output_name # Debug-Ausgabe auch im Nicht-Serienfall output_name = "%(title)s.%(ext)s" - custom_path = self.custom_path_input.text() or preset.get("custom_path", "") - if custom_path and not custom_path.endswith("/") and not custom_path.endswith("\\"): - custom_path += "/" - if custom_path: - output_name = custom_path + output_name + # Kein custom_path mehr in output_name, da dies bereits als output_dir verwendet wird self.log_output.append("Ausgabedatei-Komponenten:") self.log_output.append(f" Template: {output_name}") - self.log_output.append(f" Eigener Pfad: {custom_path}") + self.log_output.append(f" Eigener Pfad: {self.custom_path_input.text() or preset.get('custom_path', '')}") self.log_output.append(f"Generierter Dateiname: {output_name}") return output_name @@ -955,7 +952,11 @@ class MainWindow(QMainWindow): if current_arg: args.append(current_arg) cmd.extend(args) - output_dir = self.config["output_dir"] + + # Wenn ein eigener Pfad im Preset definiert ist, diesen verwenden + custom_path = self.custom_path_input.text() or preset.get("custom_path", "") + output_dir = custom_path if custom_path else self.config["output_dir"] + output_filename = self.get_output_filename(preset) if output_dir: output_path = os.path.join(output_dir, output_filename) @@ -981,7 +982,12 @@ class MainWindow(QMainWindow): if not preset: QMessageBox.warning(self, "Fehler", "Bitte wählen Sie ein Preset aus.") return - output_dir = self.config["output_dir"] + + # Wenn im Preset ein eigener Pfad definiert ist, diesen bevorzugen + custom_path = self.custom_path_input.text() or preset.get("custom_path", "") + # Wenn custom_path gesetzt ist, verwenden wir diesen anstelle des standard output_dir + output_dir = custom_path if custom_path else self.config["output_dir"] + use_local_ytdlp = self.config["use_local_ytdlp"] flags = self.config.get("ytdlp_flags", {}) is_audio = preset.get("is_audio", False)