Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugins/RenameFile/StashPluginHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,12 @@ def executeProcess(self, args, ExecDetach=False):
if self.IS_LINUX:
args = ["nohup"] + args
self.Trace(f"Executing detached process using Popen({args})")
# start_new_session puts the child in its own session, so it survives the
# parent task process exiting (needed on macOS; harmless on Linux too).
pid = subprocess.Popen(args, start_new_session=True).pid
else:
self.Trace(f"Executing process using normal Popen({args})")
pid = subprocess.Popen(args).pid # On detach, may need the following for MAC OS subprocess.Popen(args, shell=True, start_new_session=True)
pid = subprocess.Popen(args).pid
self.Trace(f"pid={pid}")
return pid

Expand Down
2 changes: 1 addition & 1 deletion plugins/RenameFile/renamefile.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: RenameFile
description: Renames video (scene) file names when the user edits the [Title] field located in the scene [Edit] tab.
version: 1.0.4
version: 1.0.5
url: https://discourse.stashapp.cc/t/renamefile/1334
ui:
css:
Expand Down
2 changes: 2 additions & 0 deletions plugins/RenameFile/version_history/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
### 1.0.3
- Fixed OSError "File name too long" (macOS) caused by the long-filename truncation logic appending the file extension twice and not reserving space for the hash suffix.
- Rename/move failures now log a single clear error message instead of also dumping a raw Python traceback to the log.
### 1.0.5
- Hardened detached process spawn (executeProcess) with start_new_session=True, so a detached child survives the launching task process exiting on macOS.