Entferne den {path} Platzhalter aus dem Dateinamen und verwende custom_path als output_dir. Aktualisiere die Log-Ausgabe, um den aktuellen Pfad korrekt anzuzeigen. Bevorzuge den im Preset definierten Pfad, wenn vorhanden.

This commit is contained in:
Akamaru
2025-05-04 20:41:16 +02:00
parent 9934a305f8
commit db81185657

24
main.py
View File

@@ -868,7 +868,8 @@ class MainWindow(QMainWindow):
output_name = output_name.replace("{series}", series) output_name = output_name.replace("{series}", series)
output_name = output_name.replace("{season}", season) output_name = output_name.replace("{season}", season)
output_name = output_name.replace("{episode}", episode) 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) # {extension} durch .%(ext)s ersetzen (auch rückwärtskompatibel)
output_name = output_name.replace("{extension}", ".%(ext)s") output_name = output_name.replace("{extension}", ".%(ext)s")
# Falls jemand %(ext)s nicht im Template hat, ergänzen wir es am Ende # Falls jemand %(ext)s nicht im Template hat, ergänzen wir es am Ende
@@ -889,14 +890,10 @@ class MainWindow(QMainWindow):
return output_name return output_name
# Debug-Ausgabe auch im Nicht-Serienfall # Debug-Ausgabe auch im Nicht-Serienfall
output_name = "%(title)s.%(ext)s" output_name = "%(title)s.%(ext)s"
custom_path = self.custom_path_input.text() or preset.get("custom_path", "") # Kein custom_path mehr in output_name, da dies bereits als output_dir verwendet wird
if custom_path and not custom_path.endswith("/") and not custom_path.endswith("\\"):
custom_path += "/"
if custom_path:
output_name = custom_path + output_name
self.log_output.append("Ausgabedatei-Komponenten:") self.log_output.append("Ausgabedatei-Komponenten:")
self.log_output.append(f" Template: {output_name}") 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}") self.log_output.append(f"Generierter Dateiname: {output_name}")
return output_name return output_name
@@ -955,7 +952,11 @@ class MainWindow(QMainWindow):
if current_arg: if current_arg:
args.append(current_arg) args.append(current_arg)
cmd.extend(args) 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) output_filename = self.get_output_filename(preset)
if output_dir: if output_dir:
output_path = os.path.join(output_dir, output_filename) output_path = os.path.join(output_dir, output_filename)
@@ -981,7 +982,12 @@ class MainWindow(QMainWindow):
if not preset: if not preset:
QMessageBox.warning(self, "Fehler", "Bitte wählen Sie ein Preset aus.") QMessageBox.warning(self, "Fehler", "Bitte wählen Sie ein Preset aus.")
return 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"] use_local_ytdlp = self.config["use_local_ytdlp"]
flags = self.config.get("ytdlp_flags", {}) flags = self.config.get("ytdlp_flags", {})
is_audio = preset.get("is_audio", False) is_audio = preset.get("is_audio", False)