Comments (7)
At the moment, Stash doesn't touch files on purpose and that functionality is covered by plugins.
If I rename the file directly ( via File-Explorer), Stash has to rescan the path, and I loose any Stash metadata which I may have manually added.
Re-scan should just remap the file to the correct path, and all the Stash metadata should still be there. Are you also embedding the metadata and not just renaming the file? That would change the hash. Stash keeps track of files by hash and path. You can change one of them and Stash will be able to successfully find the file, but if both gets changed, Stash will see it as a new file.
There is also https://github.com/Serechops/Serechops-Stash/tree/main/plugins/Renamer which might be easier to set up compared to https://github.com/stashapp/CommunityScripts/tree/main/plugins/renamerOnUpdate.
renamerOnUpdate should work. Tested up to v0.26.2 on Windows.
from stash.
That would change the hash. Stash keeps track of files by hash and path.
I didn't realized it used the hash to keep track of the file in case of rename.
However, there's still problems with that approach. 1st user has to go to fileinfo tab to copy and paste the path, and access it in file explorer. If the user is watching the video at the time, renaming the file is blocked, so the user has to refresh the URL in-order to unlock the file.
At that time, the file can be renamed, however, after renaming the file, it can no longer be played, until a re-scan is performed.
It would be far better if the user can renamed the file on the fly, and be able to make multiple changes while reviewing a video without having to continuously perform a rescan.
https://github.com/Serechops/Serechops-Stash/tree/main/plugins/Renamer
That plugin is not listed in the official or unofficial list. Is there another list of plugins?
The Renamer plugin seems to be similar to the renamerOnUpdate in that it seams to be made for pattern changes, instead of a feature to just change a single file on the fly.
At the moment, Stash doesn't touch files on purpose and that functionality is covered by plugins.
I would agree with that if Stash didn't have a [Delete] button, which is the most harm you can do to a file. If it has a delete function, then it should be able to support a rename function.
Am I able to add a button next to the [Delete] button by creating a plugin?
If so, am I correct in assuming I would have to create an Embedded Plugin in order to do this, or would an External Plugin be the correct approach?
Can a plugin stop the scene being played on the same page?
Any help you can give me to implement this would be appreciated.
Thank you
from stash.
If the user is watching the video at the time, renaming the file is blocked, so the user has to refresh the URL in-order to unlock the file.
I've never experienced issues renaming or moving a file that was simultaneously playing, other than the video eventually stops playing of course. Just tested this in fact to verify, no issues (stash-linux).
from stash.
I've never experienced issues renaming or moving a file
This is easy to reproduce on Windows 11 (x64). It even happen when I was using the Renamer plugin.
Here's what I got from the renamer.log file:
2024-07-19 13:00:45,898 - Failed to rename file: B:\V\V\1\VideoTestFile.mp4. Error: [WinError 32] The process cannot access the file because it is being used by another process:
New Plugin [RenameFileName]
I'm happy to say, I've been able to modify the Renamer plugin, and I'm able to get it to do most of what I was looking for.
I'm creating a new plugin based on it.
By default the new plugin does the following:
- Renames the file in the following format {title}-{tags}.ext.
- If the title field is empty, it will use the original file name.
- It only adds tags which do not already exist in the original file name.
- The user will be able to change how it works from the settings file.
If a user wants to rename the file, they only have to populate the title field with the desired new name.
This plugin will still have the problem with renaming a file while the user is playing it. I'll have to check if moving the file creates the same issue as renaming it.
from stash.
I've finished with the RenameFile plugin, and I would like to add it to the Community Scripts.
Do you have any issues with adding RenameFile to the Community Scripts list?
See following link to read what it does, and usage.
https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/RenameFile
To add it, do I have to create a new repository based on https://github.com/stashapp/CommunityScripts?
Or do you have another method to allow users to add to the list?
from stash.
@David-Maisonave added stashapp/CommunityScripts#369.
Generally, submitting via PR from the fork is easiest.
from stash.
Closing feature request since it's been largely accomplish using plugin RenameFile.
Thanks for the help in creating the plugin.
from stash.
Related Issues (20)
- [Feature] Change default transcoding format
- [Bug Report] Disable "onwheel" parameter for performer page input forms using numerical values HOT 1
- [Bug Report] Newly generated Image Clip Previews won't show in wall or grid view HOT 2
- [Feature]hope the menu bar can hover in selection mode, making it easier to operate on the selected content
- [RFC] Make ffmpeg loglevel configurable HOT 1
- [Feature] Support non-unique Studio names HOT 2
- [Bug Report] Card move target effect displayed when not moving cards
- [Bug Report] Problems in the calculation of the values of the "red", "green", and "blue" video filter.
- [Bug Report] Migrating to develop builds does not update config menu items for groups
- [RFC] stash url localhost:9999 should instead be localhost:6969 HOT 2
- [Bug Report] Preview scrubber broken on Firefox HOT 1
- [Bug Report] Modal footers getting clipped HOT 4
- [Bug Report] Usability issue with updated scrape with menu
- [Bug Report] Anonymise database not anonymising all sensitive values
- [Bug Report] Naming issue for Taiwan in list of countries HOT 5
- [Bug Report] URLs should be sorted
- [Bug Report] Unexpected scroll to top when clicking page-count button. HOT 1
- [Bug Report] Database locked error returned and more persistent HOT 11
- [Feature] Drag and drop allocation of performer and scene covers or automatic detection HOT 2
- [RFC] Migrating from macos binary to docker compose
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stash.