From: TTT7275 <126439983+TTT7275@users.noreply.github.com> Date: Mon, 18 Dec 2023 05:38:24 +0000 (+0700) Subject: Enhancement: Add {original_filename}, {added_time} to title placeholders (#4972) X-Git-Tag: v2.2.0~1^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1197a048bcf3e44fee0f29b8b7eff49ae495b44e;p=thirdparty%2Fpaperless-ngx.git Enhancement: Add {original_filename}, {added_time} to title placeholders (#4972) --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com> --- diff --git a/docs/usage.md b/docs/usage.md index fed7412b37..2412e3cbeb 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -311,6 +311,8 @@ applied. You can use the following placeholders: - `{added_month_name}`: added month name - `{added_month_name_short}`: added month short name - `{added_day}`: added day +- `{added_time}`: added time in HH:MM format +- `{original_filename}`: original file name without extension ## Custom Fields {#custom-fields} diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 4f97881ef9..6a0d1ec02c 100644 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -691,6 +691,8 @@ class Consumer(LoggingMixin): added_month_name_short=local_added.strftime("%b"), added_day=local_added.strftime("%d"), owner_username=owner_username, + original_filename=Path(self.filename).stem, + added_time=local_added.strftime("%H:%M"), ).strip() def _store(