mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	added a setting: delete duplicate documents
This commit is contained in:
		@@ -143,6 +143,10 @@ PAPERLESS_EMAIL_SECRET=""
 | 
				
			|||||||
####                          Software Tweaks                              ####
 | 
					####                          Software Tweaks                              ####
 | 
				
			||||||
###############################################################################
 | 
					###############################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# When the consumer detects a duplicate document, it will not touch the
 | 
				
			||||||
 | 
					# original document. This default behavior can be changed here.
 | 
				
			||||||
 | 
					#PAPERLESS_CONSUMER_DELETE_DUPLICATES="false"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# After a document is consumed, Paperless can trigger an arbitrary script if
 | 
					# After a document is consumed, Paperless can trigger an arbitrary script if
 | 
				
			||||||
# you like.  This script will be passed a number of arguments for you to work
 | 
					# you like.  This script will be passed a number of arguments for you to work
 | 
				
			||||||
# with.  The default is blank, which means nothing will be executed.  For more
 | 
					# with.  The default is blank, which means nothing will be executed.  For more
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -84,6 +84,8 @@ class Consumer:
 | 
				
			|||||||
                "warning",
 | 
					                "warning",
 | 
				
			||||||
                "Skipping {} as it appears to be a duplicate".format(doc)
 | 
					                "Skipping {} as it appears to be a duplicate".format(doc)
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
 | 
					            if settings.CONSUMER_DELETE_DUPLICATES:
 | 
				
			||||||
 | 
					                self._cleanup_doc(doc)
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.log("info", "Consuming {}".format(doc))
 | 
					        self.log("info", "Consuming {}".format(doc))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -258,6 +258,8 @@ Q_CLUSTER = {
 | 
				
			|||||||
# Paperless Specific Settings                                                 #
 | 
					# Paperless Specific Settings                                                 #
 | 
				
			||||||
###############################################################################
 | 
					###############################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CONSUMER_DELETE_DUPLICATES = __get_boolean("PAPERLESS_CONSUMER_DELETE_DUPLICATES")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The default language that tesseract will attempt to use when parsing
 | 
					# The default language that tesseract will attempt to use when parsing
 | 
				
			||||||
# documents.  It should be a 3-letter language code consistent with ISO 639.
 | 
					# documents.  It should be a 3-letter language code consistent with ISO 639.
 | 
				
			||||||
OCR_LANGUAGE = os.getenv("PAPERLESS_OCR_LANGUAGE", "eng")
 | 
					OCR_LANGUAGE = os.getenv("PAPERLESS_OCR_LANGUAGE", "eng")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user