diff --git a/pkg/scene/delete.go b/pkg/scene/delete.go index 57802d0cb..63672eecb 100644 --- a/pkg/scene/delete.go +++ b/pkg/scene/delete.go @@ -135,6 +135,14 @@ func Destroy(scene *models.Scene, repo models.Repository, fileDeleter *FileDelet if err := fileDeleter.Files([]string{scene.Path}); err != nil { return err } + + funscriptPath := utils.GetFunscriptPath(scene.Path) + funscriptExists, _ := utils.FileExists(funscriptPath) + if funscriptExists { + if err := fileDeleter.Files([]string{funscriptPath}); err != nil { + return err + } + } } if deleteGenerated { diff --git a/ui/v2.5/src/components/Changelog/versions/v0130.md b/ui/v2.5/src/components/Changelog/versions/v0130.md index e2a369c95..342bf0c5a 100644 --- a/ui/v2.5/src/components/Changelog/versions/v0130.md +++ b/ui/v2.5/src/components/Changelog/versions/v0130.md @@ -11,6 +11,7 @@ * Show counts on list tabs in Performer, Studio and Tag pages. ([#2169](https://github.com/stashapp/stash/pull/2169)) ### 🐛 Bug fixes +* Delete funscripts when deleting scene files. ([#2265](https://github.com/stashapp/stash/pull/2265)) * Removed trusted proxies setting. ([#2229](https://github.com/stashapp/stash/pull/2229)) * Allow Stash to be iframed. ([#2217](https://github.com/stashapp/stash/pull/2217)) * Resolve CDP hostname if necessary. ([#2174](https://github.com/stashapp/stash/pull/2174)) diff --git a/ui/v2.5/src/components/Scenes/DeleteScenesDialog.tsx b/ui/v2.5/src/components/Scenes/DeleteScenesDialog.tsx index fc0859821..6534ac1ba 100644 --- a/ui/v2.5/src/components/Scenes/DeleteScenesDialog.tsx +++ b/ui/v2.5/src/components/Scenes/DeleteScenesDialog.tsx @@ -67,11 +67,29 @@ export const DeleteScenesDialog: React.FC = ( props.onClose(true); } + function funscriptPath(scenePath: string) { + const extIndex = scenePath.lastIndexOf("."); + if (extIndex !== -1) { + return scenePath.substring(0, extIndex + 1) + "funscript"; + } + + return scenePath; + } + function maybeRenderDeleteFileAlert() { if (!deleteFile) { return; } + const deletedFiles: string[] = []; + + props.selected.forEach((s) => { + deletedFiles.push(s.path); + if (s.interactive) { + deletedFiles.push(funscriptPath(s.path)); + } + }); + return (

@@ -85,13 +103,13 @@ export const DeleteScenesDialog: React.FC = ( />