Add hdr attribute to media export

This commit is contained in:
JonnyWong16 2020-09-20 12:27:42 -07:00
parent d609c0daeb
commit 35cdef1340
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 23 additions and 8 deletions

View file

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# This file is part of Tautulli.
#
@ -1267,14 +1267,26 @@ 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
def get_dict_value_by_path(root, attr):
split_attr = attr.split('.')
value = get_by_path(root, split_attr)
for _attr in reversed(split_attr):
value = {_attr: value}
return value
# https://stackoverflow.com/a/7205107
def dict_merge(a, b, path=None):
if path is None: