mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 17:56:11 +00:00
Resolved suggestions
This commit is contained in:
parent
5c93a06e9b
commit
1df9f15859
1 changed files with 7 additions and 9 deletions
|
@ -5,6 +5,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
|
import concurrent.futures
|
||||||
|
|
||||||
from six.moves import range, queue as Queue, zip
|
from six.moves import range, queue as Queue, zip
|
||||||
|
|
||||||
|
@ -273,7 +274,6 @@ def _get_items(query, server_id=None):
|
||||||
# complete all tasks before allowing any results to be processed. ThreadPoolExecutor
|
# complete all tasks before allowing any results to be processed. ThreadPoolExecutor
|
||||||
# allows for completed tasks to be processed while other tasks are completed on other
|
# allows for completed tasks to be processed while other tasks are completed on other
|
||||||
# threads. Dont be a dummy.Pool, be a ThreadPoolExecutor
|
# threads. Dont be a dummy.Pool, be a ThreadPoolExecutor
|
||||||
import concurrent.futures
|
|
||||||
p = concurrent.futures.ThreadPoolExecutor(DTHREADS)
|
p = concurrent.futures.ThreadPoolExecutor(DTHREADS)
|
||||||
|
|
||||||
results = p.map(lambda params: _get(url, params, server_id=server_id), query_params)
|
results = p.map(lambda params: _get(url, params, server_id=server_id), query_params)
|
||||||
|
@ -284,14 +284,12 @@ def _get_items(query, server_id=None):
|
||||||
result = result or {'Items': []}
|
result = result or {'Items': []}
|
||||||
|
|
||||||
# Mitigates #216 till the server validates the date provided is valid
|
# Mitigates #216 till the server validates the date provided is valid
|
||||||
for count in range(0, len(result["Items"])):
|
if result['Items'][0].get('ProductionYear'):
|
||||||
if result["Items"][count].get('ProductionYear'):
|
try:
|
||||||
try:
|
date(result['Items'][0]['ProductionYear'], 1, 1)
|
||||||
from datetime import date
|
except ValueError:
|
||||||
date(result["Items"][count]["ProductionYear"], 1, 1)
|
LOG.info('#216 mitigation triggered. Setting ProductionYear to None')
|
||||||
except ValueError:
|
result['Items'][0]['ProductionYear'] = None
|
||||||
LOG.info("#216 mitigation triggered. Setting ProductionYear to None")
|
|
||||||
result["Items"][count]["ProductionYear"] = None
|
|
||||||
|
|
||||||
items['Items'].extend(result['Items'])
|
items['Items'].extend(result['Items'])
|
||||||
# Using items to return data and communicate a restore point back to the callee is
|
# Using items to return data and communicate a restore point back to the callee is
|
||||||
|
|
Loading…
Reference in a new issue