mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
Make commands python 2/3 compatible
This commit is contained in:
parent
0e4458fa75
commit
5479ba2775
1 changed files with 8 additions and 1 deletions
|
@ -15,6 +15,14 @@ from jellyfin import Jellyfin
|
||||||
from jellyfin import api
|
from jellyfin import api
|
||||||
from jellyfin.exceptions import HTTPException
|
from jellyfin.exceptions import HTTPException
|
||||||
|
|
||||||
|
# Python 2/3 Compatible things
|
||||||
|
import sys
|
||||||
|
if sys.version.startswith('3'):
|
||||||
|
xrange = range
|
||||||
|
izip = zip
|
||||||
|
else:
|
||||||
|
from itertools import izip
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
LOG = logging.getLogger("JELLYFIN." + __name__)
|
||||||
|
@ -269,7 +277,6 @@ def _get_items(query, server_id=None):
|
||||||
query_params = [get_query_params(params, offset, LIMIT) \
|
query_params = [get_query_params(params, offset, LIMIT) \
|
||||||
for offset in xrange(params['StartIndex'], items['TotalRecordCount'], LIMIT)]
|
for offset in xrange(params['StartIndex'], items['TotalRecordCount'], LIMIT)]
|
||||||
|
|
||||||
from itertools import izip
|
|
||||||
# multiprocessing.dummy.Pool completes all requests in multiple threads but has to
|
# multiprocessing.dummy.Pool completes all requests in multiple threads but has to
|
||||||
# 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
|
||||||
|
|
Loading…
Reference in a new issue