Update extension column when filepath is updated.
This commit is contained in:
		
							parent
							
								
									6522bda09c
								
							
						
					
					
						commit
						5d11b0cfeb
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -1098,6 +1098,7 @@ class Photo(ObjectBase): | ||||||
|             'id': self.id, |             'id': self.id, | ||||||
|             'filepath': new_filepath.absolute_path, |             'filepath': new_filepath.absolute_path, | ||||||
|             'basename': new_filepath.basename, |             'basename': new_filepath.basename, | ||||||
|  |             'extension': new_filepath.extension.no_dot, | ||||||
|         } |         } | ||||||
|         self.photodb.sql_update(table='photos', pairs=data, where_key='id') |         self.photodb.sql_update(table='photos', pairs=data, where_key='id') | ||||||
|         self.real_path = new_filepath |         self.real_path = new_filepath | ||||||
|  | @ -1184,6 +1185,7 @@ class Photo(ObjectBase): | ||||||
|             'id': self.id, |             'id': self.id, | ||||||
|             'filepath': new_path.absolute_path, |             'filepath': new_path.absolute_path, | ||||||
|             'basename': new_path.basename, |             'basename': new_path.basename, | ||||||
|  |             'extension': new_path.extension.no_dot, | ||||||
|         } |         } | ||||||
|         self.photodb.sql_update(table='photos', pairs=data, where_key='id') |         self.photodb.sql_update(table='photos', pairs=data, where_key='id') | ||||||
|         self.real_path = new_path |         self.real_path = new_path | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue