Post: Write all ever-obtained metadata into JSON
The Post._asdict() code assumed that Post._node always is a subset of Post._full_metadata_dict. However, it turned out, that `edge_liked_by`, `thumbnail_src` and `thumbnail_resources` may be contained in Post._node, but not in Post._full_metadata_dict. Now the keys of both dictionaries are saved in the JSON file. Fixes #137.
This commit is contained in:
parent
4cf1ae847d
commit
969d4e3aa4
@ -93,10 +93,9 @@ class Post:
|
|||||||
return b64encode(mediaid.to_bytes(9, 'big'), b'-_').decode().replace('A', ' ').lstrip().replace(' ', 'A')
|
return b64encode(mediaid.to_bytes(9, 'big'), b'-_').decode().replace('A', ' ').lstrip().replace(' ', 'A')
|
||||||
|
|
||||||
def _asdict(self):
|
def _asdict(self):
|
||||||
|
node = self._node
|
||||||
if self._full_metadata_dict:
|
if self._full_metadata_dict:
|
||||||
node = self._full_metadata_dict
|
node.update(self._full_metadata_dict)
|
||||||
else:
|
|
||||||
node = self._node
|
|
||||||
if self._owner_profile:
|
if self._owner_profile:
|
||||||
node['owner'] = self.owner_profile._asdict()
|
node['owner'] = self.owner_profile._asdict()
|
||||||
if self._location:
|
if self._location:
|
||||||
|
Loading…
Reference in New Issue
Block a user