Add movie export levels

This commit is contained in:
JonnyWong16 2020-08-04 20:51:39 -07:00
parent 07a9bdbde3
commit 906aedd2f1
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 141 additions and 29 deletions

View file

@ -6490,7 +6490,8 @@ class WebInterface(object):
@cherrypy.tools.json_out()
@requireAuth(member_of("admin"))
@addtoapi()
def export_metadata(self, section_id=None, rating_key=None, file_format='json', **kwargs):
def export_metadata(self, section_id=None, rating_key=None, file_format='json',
export_level=1, **kwargs):
""" Export library or media metadata to a file
```
@ -6500,6 +6501,7 @@ class WebInterface(object):
Optional parameters:
file_format (str): 'json' (default) or 'csv'
export_level (int): The level of metadata to export
Returns:
json:
@ -6508,7 +6510,10 @@ class WebInterface(object):
}
```
"""
result = exporter.export(section_id=section_id, rating_key=rating_key, file_format=file_format)
result = exporter.export(section_id=section_id,
rating_key=rating_key,
file_format=file_format,
level=export_level)
if result:
return {'result': 'success', 'message': 'Metadata export has started.'}