You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: comprehensive permission error handling and UI improvements
- Enhanced directory creation with proper permissions (0o755)
- Added pre-conversion permission checks and test writes
- Improved error messages for permission issues
- Fixed File column to show output filename with new extension
- Added right-click context menu for Active Conversions table:
* Play Media - opens converted file with default player
* Open Output Folder - opens folder containing output file
- Added permission verification before FFmpeg execution
- Attempts to fix permissions automatically when possible
- Better handling of existing files during overwrite operations
Fixes permission denied errors when writing to output directory
# Verify output directory is writable before proceeding
84
+
output_dir=os.path.dirname(dst)
85
+
ifnotos.access(output_dir, os.W_OK):
86
+
self.sig_done.emit(self.wid, False, f"Output directory is not writable: {output_dir}. Please check permissions or choose a different output directory.", "")
87
+
return
78
88
79
89
# Check if output exists
80
90
ifos.path.exists(dst):
@@ -88,6 +98,15 @@ def run(self):
88
98
whileos.path.exists(dst):
89
99
dst=f"{base} ({counter}){ext}"
90
100
counter+=1
101
+
elifon_exists=="overwrite":
102
+
# Try to make existing file writable if we're overwriting
103
+
try:
104
+
importstat
105
+
current_mode=os.stat(dst).st_mode
106
+
os.chmod(dst, current_mode|stat.S_IWUSR)
107
+
except (PermissionError, OSError):
108
+
# If we can't fix permissions, FFmpeg will fail with a clear error
109
+
pass
91
110
92
111
# For two-pass encoding, first pass outputs to null device
93
112
first_pass_dst=dst
@@ -150,6 +169,22 @@ def run(self):
150
169
# Run FFmpeg
151
170
start_time=time.time()
152
171
172
+
# Verify we can write to the output location before starting FFmpeg
173
+
output_dir=os.path.dirname(dst)
174
+
try:
175
+
# Test write permission by trying to create a temporary file
self.sig_done.emit(self.wid, False, f"Cannot write to output directory '{output_dir}': {e}. Please check permissions or choose a different output directory.", "")
184
+
return
185
+
exceptExceptionase:
186
+
self.sig_log.emit(self.wid, f"Warning: Could not verify write permissions: {e}")
0 commit comments