]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Enhancement: Add {original_filename}, {added_time} to title placeholders (#4972)
authorTTT7275 <126439983+TTT7275@users.noreply.github.com>
Mon, 18 Dec 2023 05:38:24 +0000 (12:38 +0700)
committerGitHub <noreply@github.com>
Mon, 18 Dec 2023 05:38:24 +0000 (21:38 -0800)
---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
docs/usage.md
src/documents/consumer.py

index fed7412b373549136ce872dc0340213562d5c7c9..2412e3cbeb111975f63f697401f2d964102da6d6 100644 (file)
@@ -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}
 
index 4f97881ef995c9d68a83bd379e75626248e1c37a..6a0d1ec02cf40351efafa9efb89087ecbd8c14dd 100644 (file)
@@ -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(