New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Dynamic document storage paths #916
Conversation
I add the missing documentation part, once you're willing to integrate this. |
Thanks for the PR! We will take a look asap. In the meantime this should be targeted to |
Sure. Please take a look and give an indication if you're willing to integrate. If yes, I retarget it - should not be a big thing. |
This was closed automatically because it was targeting that outdated branch, I will change it to dev Edit: still needs a re-base |
@shamoon I merged with dev |
Thank you, but I think it needs a re-base, theres still a lot of changes that arent yours. As for the PR itself, I was waiting for others to chime in. Personally, I dont think this is a feature I would use. My preference is to just store docs in some simple way and let paperless handle things from there rather than complicate the file storage. I bet there are some that would, perhaps a vocal group, but IMHO if its not going to get very wide use I dont think I would be in favor of including it as-is since its so prominent, etc (in that case perhaps it could be made optional or something like that?). Obviously its not like we have telemetry data or something to have a real clear answer for this, so again, I'd love to hear others' thoughts. |
I think it does? E.g. if you edit a storage path with this feature it doesnt move immediately but then running |
I> I think it does? E.g. if you edit a storage path with this feature it doesnt move immediately but then running It does - as you described it. It always compares the calculated path with db values and acts if required. It only touches files with non-compliant pathes. The implementation is unchanged. |
Right, I see that (emphasis mine). However I don't see the documents move when they are uploaded before the Storage Path rule. For example:
The same document is matched and renamed according to the Storage Path rule if I upload it after the rule is created. |
This is only available for tags - the command is called I would propose to not implement this, as this would require conflict resolution - priorities of rules. That’s not the case for tags - there can be many. That’s probably also why it doesn’t exist for correspondents, and types, too. |
Nevermind, I see your comment above. That's news to me, I was under the misconception we could have multiple. |
I saw many comments of people wanting to have many correspondents (sender, receivers). Definitely worth thinking about 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is much more straightforward than I initially expected. Of course I'll defer to shamoon on the remaining UI stuff but I've tested this a bit and I personally don't have any more concerns.
src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts
Outdated
Show resolved
Hide resolved
Ok great, Im pretty happy with these changes, I do think they were important, appreciate your patience. Also after spending some time with this PR I can see how it will probably be useful to others. My only outstanding concern is about validating the input. On the one hand users can make their own bad decisions =) on the other hand we might want to help prevent people making unintended mistakes. The link to the docs / example in the hint is helpful but especially for variables I still think we should validate them, for example if someone typed Really, thats it! Let me know if theres a better way to do the validation, ofc. |
Syntax wise Possible addition: Show him a formatted example while he types. Than we might also catch the unexpected result. Really appreciate your work 👍 |
Yes that would be cool or I even thought about some kind of visual drag-and-drop tool to build the path but that seems like another PR. As long as you Python folks are OK with my |
* Added devcontainer * Add feature storage pathes * Exclude tests and add versioning * Check escaping * Check escaping * Check quoting * Echo * Escape * Escape : * Double escape \ * Escaping * Remove if * Escape colon * Missing \ * Esacpe : * Escape all * test * Remove sed * Fix exclude * Remove SED command * Add LD_LIBRARY_PATH * Adjusted to v1.7 * Updated test-cases * Remove devcontainer * Removed internal build-file * Run pre-commit * Corrected flak8 error * Adjusted to v1.7 * Updated test-cases * Corrected flak8 error * Adjusted to new plural translations * Small adjustments due to code-review backend * Adjusted line-break * Removed PAPERLESS prefix from settings variables * Corrected style change due to search+replace * First documentation draft * Revert changes to Pipfile * Add sphinx-autobuild with keep-outdated * Revert merge error that results in wrong storage path is evaluated * Adjust styles of generated files ... * Adds additional testing to cover dynamic storage path functionality * Remove unnecessary condition * Add hint to edit storage path dialog * Correct spelling of pathes to paths * Minor documentation tweaks * Minor typo * improving wrapping of filter editor buttons with new storage path button * Update .gitignore * Fix select border radius in non input-groups * Better storage path edit hint * Add note to edit storage path dialog re document_renamer * Add note to bulk edit storage path re document_renamer * Rename FILTER_STORAGE_DIRECTORY to PATH * Fix broken filter rule parsing * Show default storage if unspecified * Remove note re storage path on bulk edit * Add basic validation of filename variables Co-authored-by: Markus Kling <markus@markus-kling.net> Co-authored-by: Trenton Holmes <holmes.trenton@gmail.com> Co-authored-by: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Co-authored-by: Quinn Casey <quinn@quinncasey.com>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns. |
Proposed change
What I like about Paperless is the flexibility to provide a file-based document structure, as this allows for easy consumption of the documents with file-based replication. But, the "one size fits all" solution with
PAPERLESS_FILENAME_FORMAT
is not enough.The change is simple:
file_handling.py
has been modified to use the per document filename formatUsage
I use specific type of storage layouts for different purposes:
Everything related to warranty claims is a flat directory with file names like
Warranty/2022-04 Correspondent Title.pdf
Insurance communication go into
Insurance/Correspondent/...
, whereas related receipts get sorted by yearInsurance/Correspondent/Year/...
This also allows easy file-based consumption of related documents. The maintenance/assignment gets a no-brainer with auto learning enabled.
Compatibility
The change is non-intrusive and fully backward compatible.
Not using storage pathes or not having one assigned forces the system into using
PAPERLESS_FILENAME_FORMAT
.Known limitations
document_renamer
againnone
. This is feature-flagged with PAPERLESS_FILENAME_REMOVE_NONE, defaulting toNo
and such being backward compatible with the existing behaviour.Type of change
Checklist:
pre-commit
hooks, see documentation.