mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
Refactor exporter into Export class
This commit is contained in:
parent
ca06154805
commit
7eedb14834
3 changed files with 1285 additions and 1081 deletions
2358
plexpy/exporter.py
2358
plexpy/exporter.py
File diff suppressed because it is too large
Load diff
|
@ -1267,15 +1267,11 @@ def flatten_tree(obj, key=''):
|
|||
# https://stackoverflow.com/a/14692747
|
||||
def get_by_path(root, items):
|
||||
"""Access a nested object in root by item sequence."""
|
||||
if isinstance(items, str):
|
||||
items = items.split('.')
|
||||
return reduce(operator.getitem, items, root)
|
||||
|
||||
|
||||
def set_by_path(root, items, value):
|
||||
"""Set a value in a nested object in root by item sequence."""
|
||||
if isinstance(items, str):
|
||||
items = items.split('.')
|
||||
get_by_path(root, items[:-1])[items[-1]] = value
|
||||
|
||||
|
||||
|
|
|
@ -6511,11 +6511,11 @@ class WebInterface(object):
|
|||
}
|
||||
```
|
||||
"""
|
||||
result = exporter.export(section_id=section_id,
|
||||
result = exporter.Export(section_id=section_id,
|
||||
rating_key=rating_key,
|
||||
file_format=file_format,
|
||||
metadata_level=metadata_level,
|
||||
media_info_level=media_info_level)
|
||||
media_info_level=media_info_level).export()
|
||||
|
||||
if result:
|
||||
return {'result': 'success', 'message': 'Metadata export has started.'}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue