]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Also provide the original file name to the post consumption script 1440/head
authorTrenton Holmes <holmes.trenton@gmail.com>
Sun, 21 Aug 2022 23:16:28 +0000 (16:16 -0700)
committerTrenton Holmes <holmes.trenton@gmail.com>
Sun, 21 Aug 2022 23:16:28 +0000 (16:16 -0700)
docs/advanced_usage.rst
src/documents/consumer.py

index ba5b3cbaab7830c2ee1a5e6c4eb421489f128320..7709da1c94b87e684ad24544dea5136c4826453e 100644 (file)
@@ -171,6 +171,7 @@ into paperless. It receives the following environment variables:
 * ``DOCUMENT_THUMBNAIL_URL``
 * ``DOCUMENT_CORRESPONDENT``
 * ``DOCUMENT_TAGS``
+* ``DOCUMENT_ORIGINAL_FILENAME``
 
 The script can be in any language, but for a simple shell script
 example, you can take a look at `post-consumption-example.sh`_ in this project.
index 9cc9b758d09aa1faf68a4d49488dce52dde657e3..d1b01290ab26ee91c5b7b724bc80c3f2893814e3 100644 (file)
@@ -203,6 +203,7 @@ class Consumer(LoggingMixin):
         script_env["DOCUMENT_TAGS"] = str(
             ",".join(document.tags.all().values_list("name", flat=True)),
         )
+        script_env["DOCUMENT_ORIGINAL_FILENAME"] = str(document.original_filename)
 
         try:
             Popen(