Browse Source

Use correct ordering for request arrays. fix #2810

pull/2875/head
Ruud 11 years ago
parent
commit
886a271d19
  1. 5
      couchpotato/core/helpers/request.py

5
couchpotato/core/helpers/request.py

@ -44,7 +44,10 @@ def dictToList(params):
new = {}
for x, value in params.items():
try:
new_value = [dictToList(value[k]) for k in sorted(value.keys(), cmp = natcmp)]
convert = lambda text: int(text) if text.isdigit() else text.lower()
alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]
sorted_keys = sorted(value.keys(), key = alphanum_key)
new_value = [dictToList(value[k]) for k in sorted_keys]
except:
new_value = value

Loading…
Cancel
Save