From: Trenton Holmes Date: Sun, 21 Aug 2022 23:16:28 +0000 (-0700) Subject: Also provide the original file name to the post consumption script X-Git-Tag: v1.9.0-beta.rc1~35^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1440%2Fhead;p=thirdparty%2Fpaperless-ngx.git Also provide the original file name to the post consumption script --- diff --git a/docs/advanced_usage.rst b/docs/advanced_usage.rst index ba5b3cbaab..7709da1c94 100644 --- a/docs/advanced_usage.rst +++ b/docs/advanced_usage.rst @@ -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. diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 9cc9b758d0..d1b01290ab 100644 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -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(