fixup! fixup! Fix edit metadata
This commit is contained in:
parent
f21331889c
commit
6d040b4ba6
|
@ -273,7 +273,7 @@ class CollectionDb:
|
||||||
def __init__(self, root):
|
def __init__(self, root):
|
||||||
self.sqlite = Sqlite(root)
|
self.sqlite = Sqlite(root)
|
||||||
|
|
||||||
def _set_row_data(self, table, metadata):
|
def _get_row_data(self, table, metadata):
|
||||||
row_data = {}
|
row_data = {}
|
||||||
for title in self.sqlite.tables[table]['header']:
|
for title in self.sqlite.tables[table]['header']:
|
||||||
key = utils.camel2snake(title)
|
key = utils.camel2snake(title)
|
||||||
|
@ -284,11 +284,11 @@ class CollectionDb:
|
||||||
def add_file_data(self, metadata):
|
def add_file_data(self, metadata):
|
||||||
"""Save metadata informations to db"""
|
"""Save metadata informations to db"""
|
||||||
if metadata['latitude'] and metadata['longitude']:
|
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)
|
metadata['location_id'] = self.sqlite.upsert_location(loc_values)
|
||||||
|
|
||||||
if metadata['file_path']:
|
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)
|
self.sqlite.upsert_metadata(row_data)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue