mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
Fix export csv missing dict keys
This commit is contained in:
parent
d5e91801d6
commit
58292067f0
1 changed files with 2 additions and 2 deletions
|
@ -924,9 +924,9 @@ def export(section_id=None, rating_key=None, file_format='json'):
|
|||
|
||||
elif file_format == 'csv':
|
||||
flatten_result = helpers.flatten_dict(result)
|
||||
flatten_attrs = helpers.flatten_dict(attrs)
|
||||
flatten_attrs = set().union(*flatten_result)
|
||||
with open(filepath, 'w', encoding='utf-8', newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, sorted(flatten_attrs[0].keys()))
|
||||
writer = csv.DictWriter(outfile, sorted(flatten_attrs))
|
||||
writer.writeheader()
|
||||
writer.writerows(flatten_result)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue