From 5d11b0cfeb2f7dd9cf6685380689b1e154d0cc7d Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 30 Dec 2020 15:30:37 -0800 Subject: [PATCH] Update extension column when filepath is updated. --- etiquette/objects.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etiquette/objects.py b/etiquette/objects.py index 303df69..de51c07 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -1098,6 +1098,7 @@ class Photo(ObjectBase): 'id': self.id, 'filepath': new_filepath.absolute_path, 'basename': new_filepath.basename, + 'extension': new_filepath.extension.no_dot, } self.photodb.sql_update(table='photos', pairs=data, where_key='id') self.real_path = new_filepath @@ -1184,6 +1185,7 @@ class Photo(ObjectBase): 'id': self.id, 'filepath': new_path.absolute_path, 'basename': new_path.basename, + 'extension': new_path.extension.no_dot, } self.photodb.sql_update(table='photos', pairs=data, where_key='id') self.real_path = new_path