Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds Rating Folders, a plugin that moves a scene's file to a folder you pick for its rating, with optional renaming. For example: 9-10 goes to
Top, 7-8 toKeep, 1-4 toTrash.How it works
Scene.Update.Post. It only acts whenrating100is among the changed fields.moveFilesmutation, so Stash keeps tracking the file without a rescan.{performers} - {studio} - {date} - {title}, plus{year},{code},{rating}and{original}. Empty fields are dropped along with their separator..funscriptand subtitle sidecars with the same name move along with the video. A setting turns this off.Safety
(2),(3)and so on, and Stash's own existing-file check stays in place as a backstop.Dependencies: Python standard library only, so there's nothing to pip install and it doesn't need PythonDepManager.
Testing: 34 automated end-to-end tests run the plugin as Stash does (JSON on stdin, encoded log lines on stderr) against a local mock of the GraphQL endpoints it uses. The mock follows the
moveFilesbehaviour inresolver_mutation_file.goandpkg/file/move.go.Testing on a real Stash: I ran it on Stash v0.32.0 for Windows (the official release binary), on a separate test instance bound to 127.0.0.1 with its own config and database, with small generated test videos (no real content), Top/Keep/Trash folders and a .funscript and .srt next to one video. Scripted checks against the real web UI (Playwright) and the GraphQL API covered: stars set on the scene page moving the file (5 stars to Top, 1 star to Trash), a title edit not moving it, dry run (log only), sidecars, a name clash (" (2)"), a missing destination folder (not moved, warning logged), removing a rating, bulkSceneUpdate (the hook fires once per scene), the rename template, the Preview and Apply tasks (a second Apply changed nothing), and a rescan afterwards. This found three issues, now fixed with tests: renamed .srt/.vtt files lost their link in Stash (the plugin now asks Stash to rescan the video and then the subtitles), the preview could announce the same target name for two scenes, and two misleading task log messages.
Human check: I rated a scene with 5 stars in the Stash web UI on that test instance and its file moved from
Library\InboxtoLibrary\Top, with the new path shown in File Info.Disclosure: I'm the developer of ReelTier (https://reeltier.com), a free Windows app with the same "rate it and it moves" idea for VR players. This plugin doesn't need ReelTier and doesn't talk to it. It was written with the help of an LLM coding assistant. I tested it myself as described above and I take full responsibility for the code, including license compliance, and for maintaining it. It's under the repository's AGPL-3.0 license.