Giter VIP home page Giter VIP logo

Comments (7)

DogmaDragon avatar DogmaDragon commented on September 15, 2024

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.

David-Maisonave avatar David-Maisonave commented on September 15, 2024

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.

echo6ix avatar echo6ix commented on September 15, 2024

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.

David-Maisonave avatar David-Maisonave commented on September 15, 2024

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:

  1. Renames the file in the following format {title}-{tags}.ext.
  2. If the title field is empty, it will use the original file name.
  3. It only adds tags which do not already exist in the original file name.
  4. 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.

David-Maisonave avatar David-Maisonave commented on September 15, 2024

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.

DogmaDragon avatar DogmaDragon commented on September 15, 2024

@David-Maisonave added stashapp/CommunityScripts#369.

Generally, submitting via PR from the fork is easiest.

from stash.

David-Maisonave avatar David-Maisonave commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.