mirror of
https://github.com/ManiMatter/decluttarr.git
synced 2026-04-21 16:25:35 +02:00
Major refactor & code-cleanup
Improved Slow Downloads (more accurate determining of progress) Added possiblity to exclude private Trackers from cleaning
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
async def nested_set(dic, keys, value, matchConditions=None):
|
||||
def nested_set(dic, keys, value, matchConditions=None):
|
||||
# Sets the value of a key in a dictionary to a certain value.
|
||||
# If multiple items are present, it can filter for a matching item
|
||||
for key in keys[:-1]:
|
||||
@@ -21,7 +21,7 @@ async def nested_set(dic, keys, value, matchConditions=None):
|
||||
dic[keys[-1]] = value
|
||||
|
||||
|
||||
async def add_keys_nested_dict(d, keys, defaultValue = None):
|
||||
def add_keys_nested_dict(d, keys, defaultValue = None):
|
||||
# Creates a nested value if key does not exist
|
||||
for key in keys[:-1]:
|
||||
if key not in d:
|
||||
@@ -29,7 +29,7 @@ async def add_keys_nested_dict(d, keys, defaultValue = None):
|
||||
d = d[key]
|
||||
d.setdefault(keys[-1], defaultValue)
|
||||
|
||||
async def nested_get(dic, return_attribute, matchConditions):
|
||||
def nested_get(dic, return_attribute, matchConditions):
|
||||
# Retrieves a list contained in return_attribute, found within dic based on matchConditions
|
||||
i = 0
|
||||
match = False
|
||||
|
||||
Reference in New Issue
Block a user