Only add delete_file action if the file still exists.
Files deleted out of etiquette can just be removed from the db.
This commit is contained in:
		
							parent
							
								
									1ee73feb6c
								
							
						
					
					
						commit
						5ad4a458de
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -930,7 +930,7 @@ class Photo(ObjectBase): | ||||||
|         self.photodb.sql_delete(table='album_photo_rel', pairs={'photoid': self.id}) |         self.photodb.sql_delete(table='album_photo_rel', pairs={'photoid': self.id}) | ||||||
|         self.photodb.sql_delete(table='photos', pairs={'id': self.id}) |         self.photodb.sql_delete(table='photos', pairs={'id': self.id}) | ||||||
| 
 | 
 | ||||||
|         if delete_file: |         if delete_file and self.real_path.exists: | ||||||
|             path = self.real_path.absolute_path |             path = self.real_path.absolute_path | ||||||
|             if self.photodb.config['recycle_instead_of_delete']: |             if self.photodb.config['recycle_instead_of_delete']: | ||||||
|                 self.photodb.log.debug('Recycling %s.', path) |                 self.photodb.log.debug('Recycling %s.', path) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue