fixup! fixup! Fix edit metadata

This commit is contained in:
Cédric Leporcq 2022-07-27 03:18:24 +02:00
parent f21331889c
commit 6d040b4ba6
1 changed files with 3 additions and 3 deletions

View File

@ -273,7 +273,7 @@ class CollectionDb:
def __init__(self, root):
self.sqlite = Sqlite(root)
def _set_row_data(self, table, metadata):
def _get_row_data(self, table, metadata):
row_data = {}
for title in self.sqlite.tables[table]['header']:
key = utils.camel2snake(title)
@ -284,11 +284,11 @@ class CollectionDb:
def add_file_data(self, metadata):
"""Save metadata informations to db"""
if metadata['latitude'] and metadata['longitude']:
loc_values = self._set_row_data('location', metadata)
loc_values = self._get_row_data('location', metadata)
metadata['location_id'] = self.sqlite.upsert_location(loc_values)
if metadata['file_path']:
row_data = self._set_row_data('metadata', metadata)
row_data = self._get_row_data('metadata', metadata)
self.sqlite.upsert_metadata(row_data)