mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-02 18:47:10 -05:00 
			
		
		
		
	update thumbnail in archiver, since page rotation might have changed
This commit is contained in:
		
							parent
							
								
									7751755399
								
							
						
					
					
						commit
						65b37f61ca
					
				@ -39,6 +39,12 @@ def handle_document(document_id):
 | 
				
			|||||||
            mime_type,
 | 
					            mime_type,
 | 
				
			||||||
            document.get_public_filename())
 | 
					            document.get_public_filename())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        thumbnail = parser.get_optimised_thumbnail(
 | 
				
			||||||
 | 
					            document.source_path,
 | 
				
			||||||
 | 
					            mime_type,
 | 
				
			||||||
 | 
					            document.get_public_filename()
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if parser.get_archive_path():
 | 
					        if parser.get_archive_path():
 | 
				
			||||||
            with transaction.atomic():
 | 
					            with transaction.atomic():
 | 
				
			||||||
                with open(parser.get_archive_path(), 'rb') as f:
 | 
					                with open(parser.get_archive_path(), 'rb') as f:
 | 
				
			||||||
@ -58,6 +64,7 @@ def handle_document(document_id):
 | 
				
			|||||||
                    create_source_path_directory(document.archive_path)
 | 
					                    create_source_path_directory(document.archive_path)
 | 
				
			||||||
                    shutil.move(parser.get_archive_path(),
 | 
					                    shutil.move(parser.get_archive_path(),
 | 
				
			||||||
                                document.archive_path)
 | 
					                                document.archive_path)
 | 
				
			||||||
 | 
					                    shutil.move(thumbnail, document.thumbnail_path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        with AsyncWriter(index.open_index()) as writer:
 | 
					        with AsyncWriter(index.open_index()) as writer:
 | 
				
			||||||
            index.update_document(writer, document)
 | 
					            index.update_document(writer, document)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user