mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Add hdr attribute to media export
This commit is contained in:
parent
d609c0daeb
commit
35cdef1340
2 changed files with 23 additions and 8 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue