eikek / eikek/docspell

Automatic re-naming of attachments

Open
#992 3 comments 5 reactions 0 assignees View on GitHub
Dominant language
Elm
Stars
2.3k
Forks
184
Avg merge
8h 2m
Merged PRs (30d)
4

Description

Hello,

in contrast to e.g. paperspell-ng, docspell has two names for a document: the document name (title) and a name per attachment (file name). As docspell displays the file name quiet prominently, I feel an urge to change it to something meaningful beyond `scan_08082021.pdf`. However, in allmost all cases, the new file name does not carry any information that is not already included in the title and other meta data. This leads to the question of automatic renaming. As far as I see, it is not possible to automatically rename the attached files following some pattern from meta data?

I think, such a function would be very beneficial. Not only for the mere reason of displaying the name, but also when downloading and sending a file.

How can this be achieved? My ideas:

* At import: hardly feasible, because meta data is not reliably known yet.
* Whenever the document is confirmed. Meta data should be set at this stage, but later changes to meta data require renaming.
* Whenever meta data is changed. Great to keep it consistent, but problematic if you want to manually rename. Therefore, we should have a per document flag "automatic renaming" with a configurable default.
* A manual job that batch renames all attachments after a given pattern. The set can maybe be restricted by a search query. That should exist anyway, to keep the naming consistent when the pattern has changed. That can be part of the web ui, a part of dsc or a standalone script using the rest api. The latter I might be able to contribute as a python script.

I like the third way most (automatic whenever meta data changes) most.

https://github.com/eikek/docspell/issues/543 is somehow related, but it is about automatic title generation, if I understood it correctly.

What do you think?

Best Regards!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.