diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ecb3d46e0..468029fd3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,6 @@ repos: # - pytest # - types-requests >= 2.31 # - types-PyYAML >= 6.0 - # - types-six >= 1.13 # - types-python-dateutil >= 2.8.1 # - types-setuptools >= 44.1.1 # - types-Pygments diff --git a/jellyfin_kodi/client.py b/jellyfin_kodi/client.py index e38e52f7c..cf8c3315a 100644 --- a/jellyfin_kodi/client.py +++ b/jellyfin_kodi/client.py @@ -5,7 +5,9 @@ import os -from kodi_six import xbmc, xbmcaddon, xbmcvfs +import xbmc +import xbmcaddon +import xbmcvfs from .helper import translate, window, settings, addon_id, dialog, LazyLogger from .helper.utils import create_id, translate_path diff --git a/jellyfin_kodi/connect.py b/jellyfin_kodi/connect.py index 8a3f2b1db..6dac14502 100644 --- a/jellyfin_kodi/connect.py +++ b/jellyfin_kodi/connect.py @@ -3,7 +3,8 @@ ################################################################################################## -from kodi_six import xbmc, xbmcaddon +import xbmc +import xbmcaddon from . import client from .database import get_credentials, save_credentials diff --git a/jellyfin_kodi/database/__init__.py b/jellyfin_kodi/database/__init__.py index b92ff1892..d90f9607c 100644 --- a/jellyfin_kodi/database/__init__.py +++ b/jellyfin_kodi/database/__init__.py @@ -10,8 +10,8 @@ import sys import re -from kodi_six import xbmc, xbmcvfs -from six import text_type +import xbmc +import xbmcvfs from . import jellyfin_db from ..helper import translate, settings, window, dialog @@ -362,7 +362,7 @@ def save_sync(sync): with open(os.path.join(ADDON_DATA, "sync.json"), "wb") as outfile: data = json.dumps(sync, sort_keys=True, indent=4, ensure_ascii=False) - if isinstance(data, text_type): + if isinstance(data, str): data = data.encode("utf-8") outfile.write(data) @@ -411,7 +411,7 @@ def save_credentials(credentials): try: with open(os.path.join(ADDON_DATA, "data.json"), "wb") as outfile: data = json.dumps(credentials, sort_keys=True, indent=4, ensure_ascii=False) - if isinstance(data, text_type): + if isinstance(data, str): data = data.encode("utf-8") outfile.write(data) except Exception: diff --git a/jellyfin_kodi/dialogs/context.py b/jellyfin_kodi/dialogs/context.py index 8e8eb5db2..53ae909d9 100644 --- a/jellyfin_kodi/dialogs/context.py +++ b/jellyfin_kodi/dialogs/context.py @@ -5,8 +5,8 @@ import os -from kodi_six import xbmcgui, xbmcaddon -from six import ensure_text +import xbmcgui +import xbmcaddon from ..helper import window, addon_id from ..helper import LazyLogger @@ -69,7 +69,7 @@ def onAction(self, action): ): option = self.list_.getSelectedItem() - self.selected_option = ensure_text(option.getLabel()) + self.selected_option = option.getLabel() LOG.info("option selected: %s", self.selected_option) self.close() diff --git a/jellyfin_kodi/dialogs/loginmanual.py b/jellyfin_kodi/dialogs/loginmanual.py index c63dd519f..61c89492c 100644 --- a/jellyfin_kodi/dialogs/loginmanual.py +++ b/jellyfin_kodi/dialogs/loginmanual.py @@ -3,8 +3,7 @@ ################################################################################################## -from six import iteritems -from kodi_six import xbmcgui +import xbmcgui from ..helper import translate, LazyLogger, kodi_version @@ -34,7 +33,7 @@ def __init__(self, *args, **kwargs): def set_args(self, **kwargs): # connect_manager, user_image, servers - for key, value in iteritems(kwargs): + for key, value in kwargs.items(): setattr(self, key, value) def is_logged_in(self): diff --git a/jellyfin_kodi/dialogs/resume.py b/jellyfin_kodi/dialogs/resume.py index 0357a413f..9f2cf3ed5 100644 --- a/jellyfin_kodi/dialogs/resume.py +++ b/jellyfin_kodi/dialogs/resume.py @@ -3,7 +3,8 @@ ################################################################################################## -from kodi_six import xbmc, xbmcgui +import xbmc +import xbmcgui from ..helper import LazyLogger diff --git a/jellyfin_kodi/dialogs/serverconnect.py b/jellyfin_kodi/dialogs/serverconnect.py index adeffbe5a..b20b161f6 100644 --- a/jellyfin_kodi/dialogs/serverconnect.py +++ b/jellyfin_kodi/dialogs/serverconnect.py @@ -3,8 +3,8 @@ ################################################################################################## -from six import iteritems -from kodi_six import xbmc, xbmcgui +import xbmc +import xbmcgui from ..helper import translate from ..jellyfin.connection_manager import CONNECTION_STATE @@ -44,7 +44,7 @@ def __init__(self, *args, **kwargs): def set_args(self, **kwargs): # connect_manager, user_image, servers - for key, value in iteritems(kwargs): + for key, value in kwargs.items(): setattr(self, key, value) def is_server_selected(self): diff --git a/jellyfin_kodi/dialogs/servermanual.py b/jellyfin_kodi/dialogs/servermanual.py index 8f4b44bb9..eaaabc884 100644 --- a/jellyfin_kodi/dialogs/servermanual.py +++ b/jellyfin_kodi/dialogs/servermanual.py @@ -5,8 +5,7 @@ import re -from six import iteritems -from kodi_six import xbmcgui +import xbmcgui from ..helper import translate from ..jellyfin.connection_manager import CONNECTION_STATE @@ -41,7 +40,7 @@ def __init__(self, *args, **kwargs): def set_args(self, **kwargs): # connect_manager, user_image, servers, jellyfin_connect - for key, value in iteritems(kwargs): + for key, value in kwargs.items(): setattr(self, key, value) def is_connected(self): diff --git a/jellyfin_kodi/dialogs/usersconnect.py b/jellyfin_kodi/dialogs/usersconnect.py index 1abb8949c..6df02d711 100644 --- a/jellyfin_kodi/dialogs/usersconnect.py +++ b/jellyfin_kodi/dialogs/usersconnect.py @@ -3,8 +3,7 @@ ################################################################################################## -from six import iteritems -from kodi_six import xbmcgui +import xbmcgui from ..helper import LazyLogger from ..helper.utils import kodi_version @@ -36,7 +35,7 @@ def __init__(self, *args, **kwargs): def set_args(self, **kwargs): # connect_manager, user_image, servers - for key, value in iteritems(kwargs): + for key, value in kwargs.items(): setattr(self, key, value) def is_user_selected(self): diff --git a/jellyfin_kodi/downloader.py b/jellyfin_kodi/downloader.py index 899464981..147efece8 100644 --- a/jellyfin_kodi/downloader.py +++ b/jellyfin_kodi/downloader.py @@ -7,7 +7,7 @@ import concurrent.futures from datetime import date -from six.moves import range, queue as Queue +import queue import requests @@ -308,7 +308,7 @@ def run(self): while True: try: item_ids = self.queue.get(timeout=1) - except Queue.Empty: + except queue.Empty: self.is_done = True LOG.info("--<[ q:download/%s ]", id(self)) diff --git a/jellyfin_kodi/entrypoint/context.py b/jellyfin_kodi/entrypoint/context.py index e5d383b8c..572fd7e03 100644 --- a/jellyfin_kodi/entrypoint/context.py +++ b/jellyfin_kodi/entrypoint/context.py @@ -6,7 +6,8 @@ import json import sys -from kodi_six import xbmc, xbmcaddon +import xbmc +import xbmcaddon from .. import database from ..dialogs import context diff --git a/jellyfin_kodi/entrypoint/default.py b/jellyfin_kodi/entrypoint/default.py index e91192044..e2868bb3d 100644 --- a/jellyfin_kodi/entrypoint/default.py +++ b/jellyfin_kodi/entrypoint/default.py @@ -6,10 +6,13 @@ import json import sys import os +from urllib.parse import parse_qsl, urlencode -from six import iteritems -from six.moves.urllib.parse import parse_qsl, urlencode -from kodi_six import xbmc, xbmcvfs, xbmcgui, xbmcplugin, xbmcaddon +import xbmc +import xbmcvfs +import xbmcgui +import xbmcplugin +import xbmcaddon from .. import client from ..database import reset, get_sync, Database, jellyfin_db, get_credentials @@ -1073,7 +1076,7 @@ def create_listitem(item): li.setProperty("dbid", str(item["episodeid"])) li.setProperty("fanart_image", item["art"].get("tvshow.fanart", "")) - for key, value in iteritems(item["streamdetails"]): + for key, value in item["streamdetails"].items(): for stream in value: li.addStreamInfo(key, stream) diff --git a/jellyfin_kodi/entrypoint/service.py b/jellyfin_kodi/entrypoint/service.py index aaf0d03d8..e267571d9 100644 --- a/jellyfin_kodi/entrypoint/service.py +++ b/jellyfin_kodi/entrypoint/service.py @@ -6,11 +6,12 @@ import json import sys from datetime import datetime +from importlib import reload # Workaround for threads using datetime: _striptime is locked import _strptime # noqa:F401 -from kodi_six import xbmc, xbmcgui -from six.moves import reload_module as reload +import xbmc +import xbmcgui from .. import objects from .. import connect diff --git a/jellyfin_kodi/full_sync.py b/jellyfin_kodi/full_sync.py index 6143e960a..36453ada5 100644 --- a/jellyfin_kodi/full_sync.py +++ b/jellyfin_kodi/full_sync.py @@ -6,7 +6,7 @@ from contextlib import contextmanager import datetime -from kodi_six import xbmc +import xbmc from . import downloader as server from .objects import Movies, TVShows, MusicVideos, Music diff --git a/jellyfin_kodi/helper/loghandler.py b/jellyfin_kodi/helper/loghandler.py index 9d234324b..9e57f103e 100644 --- a/jellyfin_kodi/helper/loghandler.py +++ b/jellyfin_kodi/helper/loghandler.py @@ -7,11 +7,11 @@ import logging import traceback -from six import ensure_text -from kodi_six import xbmc, xbmcaddon +import xbmc +import xbmcaddon from .. import database -from . import get_filesystem_encoding, settings, kodi_version +from . import settings, kodi_version from .utils import translate_path ################################################################################################## @@ -92,9 +92,6 @@ def __init__( logging.Formatter.__init__(self, fmt) def format(self, record): - if record.pathname: - record.pathname = ensure_text(record.pathname, get_filesystem_encoding()) - self._gen_rel_path(record) # Call the original formatter class to do the grunt work @@ -107,8 +104,6 @@ def formatException(self, exc_info): res = [] for o in traceback.format_exception(*exc_info): - o = ensure_text(o, get_filesystem_encoding()) - if o.startswith(' File "'): # If this split can't handle your file names, you should seriously consider renaming your files. fn = o.split(' File "', 2)[1].split('", line ', 1)[0] diff --git a/jellyfin_kodi/helper/playutils.py b/jellyfin_kodi/helper/playutils.py index baec4b56e..614f79f0e 100644 --- a/jellyfin_kodi/helper/playutils.py +++ b/jellyfin_kodi/helper/playutils.py @@ -7,7 +7,8 @@ from uuid import uuid4 import requests -from kodi_six import xbmc, xbmcvfs +import xbmc +import xbmcvfs from .. import client from .utils import translate_path diff --git a/jellyfin_kodi/helper/translate.py b/jellyfin_kodi/helper/translate.py index 6844fe7c6..cd6dd037d 100644 --- a/jellyfin_kodi/helper/translate.py +++ b/jellyfin_kodi/helper/translate.py @@ -3,7 +3,8 @@ ################################################################################################## -from kodi_six import xbmc, xbmcaddon +import xbmc +import xbmcaddon from . import LazyLogger diff --git a/jellyfin_kodi/helper/utils.py b/jellyfin_kodi/helper/utils.py index fb651cf68..3e2b58cd1 100644 --- a/jellyfin_kodi/helper/utils.py +++ b/jellyfin_kodi/helper/utils.py @@ -10,12 +10,14 @@ import re import unicodedata from uuid import uuid4 +from urllib.parse import quote_plus from dateutil import tz, parser -from six import text_type, string_types, iteritems, ensure_text, ensure_binary -from six.moves.urllib.parse import quote_plus -from kodi_six import xbmc, xbmcaddon, xbmcgui, xbmcvfs +import xbmc +import xbmcaddon +import xbmcgui +import xbmcvfs from . import LazyLogger from .translate import translate @@ -103,11 +105,12 @@ def create_id(): def find(dict, item): + # FIXME: dead code """Find value in dictionary.""" if item in dict: return dict[item] - for key, value in sorted(iteritems(dict), key=lambda kv: (kv[1], kv[0])): + for key, value in sorted(dict.items(), key=lambda kv: (kv[1], kv[0])): if re.match(key, item, re.I): return dict[key] @@ -119,7 +122,7 @@ def event(method, data=None, sender=None, hexlify=False): sender = sender or "plugin.video.jellyfin" if hexlify: - data = ensure_text(binascii.hexlify(ensure_binary(json.dumps(data)))) + data = str(binascii.hexlify(json.dumps(data).encode())) data = '"[%s]"' % json.dumps(data).replace('"', '\\"') @@ -272,7 +275,7 @@ def values(item, keys): return ( ( item[key.replace("{", "").replace("}", "")] - if isinstance(key, text_type) and key.startswith("{") + if isinstance(key, str) and key.startswith("{") else key ) for key in keys @@ -422,9 +425,7 @@ def normalize_string(text): text = text.strip() text = text.rstrip(".") - text = unicodedata.normalize("NFKD", text_type(text, "utf-8")).encode( - "ascii", "ignore" - ) + text = unicodedata.normalize("NFKD", text).encode("ascii", "ignore") return text @@ -437,7 +438,7 @@ def split_list(itemlist, size): def convert_to_local(date, timezone=tz.tzlocal()): """Convert the local datetime to local.""" try: - date = parser.parse(date) if isinstance(date, string_types) else date + date = parser.parse(date) if isinstance(date, str) else date date = date.replace(tzinfo=tz.tzutc()) date = date.astimezone(timezone) # Bad metadata defaults to date 1-1-1. Catch it and don't throw errors diff --git a/jellyfin_kodi/helper/wrapper.py b/jellyfin_kodi/helper/wrapper.py index 73f19982d..b1cb41991 100644 --- a/jellyfin_kodi/helper/wrapper.py +++ b/jellyfin_kodi/helper/wrapper.py @@ -3,7 +3,7 @@ ################################################################################################# -from kodi_six import xbmcgui +import xbmcgui from . import LazyLogger diff --git a/jellyfin_kodi/helper/xmls.py b/jellyfin_kodi/helper/xmls.py index fdf9e3a9f..9c3fbb5fa 100644 --- a/jellyfin_kodi/helper/xmls.py +++ b/jellyfin_kodi/helper/xmls.py @@ -6,7 +6,8 @@ import os import xml.etree.ElementTree as etree -from kodi_six import xbmc, xbmcvfs +import xbmc +import xbmcvfs from .utils import translate_path from . import translate, dialog, settings, LazyLogger diff --git a/jellyfin_kodi/jellyfin/api.py b/jellyfin_kodi/jellyfin/api.py index 4ec7ce312..1c2bb02fc 100644 --- a/jellyfin_kodi/jellyfin/api.py +++ b/jellyfin_kodi/jellyfin/api.py @@ -4,7 +4,6 @@ import json import requests -from six import ensure_str from ..helper.exceptions import HTTPException from ..helper.utils import settings @@ -416,7 +415,7 @@ def get_default_headers(self): "User-Agent": self.config.data["http.user_agent"] or "%s/%s" % (self.config.data["app.name"], self.config.data["app.version"]), - "x-emby-authorization": ensure_str(auth, "utf-8"), + "x-emby-authorization": auth, } def send_request( diff --git a/jellyfin_kodi/jellyfin/http.py b/jellyfin_kodi/jellyfin/http.py index 0c3282137..a58ad9616 100644 --- a/jellyfin_kodi/jellyfin/http.py +++ b/jellyfin_kodi/jellyfin/http.py @@ -6,7 +6,6 @@ import time import requests -from six import string_types, ensure_str from ..helper.utils import JsonDebugPrinter from ..helper import LazyLogger @@ -218,7 +217,7 @@ def _process_params(self, params): if isinstance(value, dict): self._process_params(value) - if isinstance(value, string_types): + if isinstance(value, str): params[key] = self._replace_user_info(value) def _get_header(self, data): @@ -257,14 +256,14 @@ def _authorization(self, data): ) auth += "Version=%s" % self.config.data.get("app.version", "0.0.0") - data["headers"].update({"x-emby-authorization": ensure_str(auth, "utf-8")}) + data["headers"].update({"x-emby-authorization": auth}) if self.config.data.get("auth.token") and self.config.data.get("auth.user_id"): auth += ", UserId=%s" % self.config.data.get("auth.user_id") data["headers"].update( { - "x-emby-authorization": ensure_str(auth, "utf-8"), + "x-emby-authorization": auth, "X-MediaBrowser-Token": self.config.data.get("auth.token"), } ) diff --git a/jellyfin_kodi/jellyfin/utils.py b/jellyfin_kodi/jellyfin/utils.py index af5cab59e..036859811 100644 --- a/jellyfin_kodi/jellyfin/utils.py +++ b/jellyfin_kodi/jellyfin/utils.py @@ -1,14 +1,12 @@ from collections import namedtuple - -from six import string_types -from six.moves import collections_abc +from collections.abc import Iterable, Mapping, MutableMapping def clean_none_dict_values(obj): """ Recursively remove keys with a value of None """ - if not isinstance(obj, collections_abc.Iterable) or isinstance(obj, string_types): + if not isinstance(obj, Iterable) or isinstance(obj, str): return obj queue = [obj] @@ -16,18 +14,18 @@ def clean_none_dict_values(obj): while queue: item = queue.pop() - if isinstance(item, collections_abc.Mapping): - mutable = isinstance(item, collections_abc.MutableMapping) + if isinstance(item, Mapping): + mutable = isinstance(item, MutableMapping) remove = [] for key, value in item.items(): if value is None and mutable: remove.append(key) - elif isinstance(value, string_types): + elif isinstance(value, str): continue - elif isinstance(value, collections_abc.Iterable): + elif isinstance(value, Iterable): queue.append(value) if mutable: @@ -35,11 +33,11 @@ def clean_none_dict_values(obj): for key in remove: item.pop(key) - elif isinstance(item, collections_abc.Iterable): + elif isinstance(item, Iterable): for value in item: - if value is None or isinstance(value, string_types): + if value is None or isinstance(value, str): continue - elif isinstance(value, collections_abc.Iterable): + elif isinstance(value, Iterable): queue.append(value) return obj diff --git a/jellyfin_kodi/jellyfin/ws_client.py b/jellyfin_kodi/jellyfin/ws_client.py index 38a17f8b4..4c0d91bb7 100644 --- a/jellyfin_kodi/jellyfin/ws_client.py +++ b/jellyfin_kodi/jellyfin/ws_client.py @@ -7,7 +7,7 @@ import threading import time -from kodi_six import xbmc +import xbmc from ..helper import LazyLogger, settings diff --git a/jellyfin_kodi/library.py b/jellyfin_kodi/library.py index a200f37de..452429761 100644 --- a/jellyfin_kodi/library.py +++ b/jellyfin_kodi/library.py @@ -6,9 +6,10 @@ import threading from datetime import datetime, timedelta -from six.moves import queue as Queue +import queue -from kodi_six import xbmc, xbmcgui +import xbmc +import xbmcgui from .objects import Movies, TVShows, MusicVideos, Music from .objects.kodi import Movies as KodiDb @@ -48,13 +49,13 @@ def __init__(self, monitor): self.monitor = monitor self.player = monitor.monitor.player self.server = Jellyfin().get_client() - self.updated_queue = Queue.Queue() - self.userdata_queue = Queue.Queue() - self.removed_queue = Queue.Queue() + self.updated_queue = queue.Queue() + self.userdata_queue = queue.Queue() + self.removed_queue = queue.Queue() self.updated_output = self.__new_queues__() self.userdata_output = self.__new_queues__() self.removed_output = self.__new_queues__() - self.notify_output = Queue.Queue() + self.notify_output = queue.Queue() self.jellyfin_threads = [] self.download_threads = [] @@ -67,16 +68,16 @@ def __init__(self, monitor): def __new_queues__(self): return { - "Movie": Queue.Queue(), - "BoxSet": Queue.Queue(), - "MusicVideo": Queue.Queue(), - "Series": Queue.Queue(), - "Season": Queue.Queue(), - "Episode": Queue.Queue(), - "MusicAlbum": Queue.Queue(), - "MusicArtist": Queue.Queue(), - "AlbumArtist": Queue.Queue(), - "Audio": Queue.Queue(), + "Movie": queue.Queue(), + "BoxSet": queue.Queue(), + "MusicVideo": queue.Queue(), + "Series": queue.Queue(), + "Season": queue.Queue(), + "Episode": queue.Queue(), + "MusicAlbum": queue.Queue(), + "MusicArtist": queue.Queue(), + "AlbumArtist": queue.Queue(), + "Audio": queue.Queue(), } def run(self): @@ -271,13 +272,13 @@ def worker_queue_size(self): def worker_downloads(self): """Get items from jellyfin and place them in the appropriate queues.""" - for queue in ( + for work_queue in ( (self.updated_queue, self.updated_output), (self.userdata_queue, self.userdata_output), ): - if queue[0].qsize() and len(self.download_threads) < DTHREADS: + if work_queue[0].qsize() and len(self.download_threads) < DTHREADS: - new_thread = GetItemWorker(self.server, queue[0], queue[1]) + new_thread = GetItemWorker(self.server, work_queue[0], work_queue[1]) new_thread.start() LOG.info("-->[ q:download/%s ]", id(new_thread)) self.download_threads.append(new_thread) @@ -722,7 +723,7 @@ def run(self): try: item = self.queue.get(timeout=1) - except Queue.Empty: + except queue.Empty: break try: @@ -801,7 +802,7 @@ def run(self): try: item = self.queue.get(timeout=1) - except Queue.Empty: + except queue.Empty: break try: @@ -852,7 +853,7 @@ def run(self): try: item_id = self.queue.get(timeout=1) - except Queue.Empty: + except queue.Empty: break try: @@ -918,7 +919,7 @@ def run(self): try: item = self.queue.get(timeout=1) - except Queue.Empty: + except queue.Empty: break if item["Type"] == "Movie": @@ -970,7 +971,7 @@ def run(self): try: item = self.queue.get(timeout=3) - except Queue.Empty: + except queue.Empty: break time = self.music_time if item[0] == "Audio" else self.video_time diff --git a/jellyfin_kodi/monitor.py b/jellyfin_kodi/monitor.py index 4f02226bb..1123a5c88 100644 --- a/jellyfin_kodi/monitor.py +++ b/jellyfin_kodi/monitor.py @@ -7,7 +7,7 @@ import json import threading -from kodi_six import xbmc +import xbmc from . import connect from . import player diff --git a/jellyfin_kodi/objects/actions.py b/jellyfin_kodi/objects/actions.py index 4711e1e11..7b91038e7 100644 --- a/jellyfin_kodi/objects/actions.py +++ b/jellyfin_kodi/objects/actions.py @@ -8,7 +8,10 @@ import json from datetime import timedelta -from kodi_six import xbmc, xbmcgui, xbmcplugin, xbmcaddon +import xbmc +import xbmcgui +import xbmcplugin +import xbmcaddon from ..helper import translate, playutils, api, window, settings, dialog from ..dialogs import resume diff --git a/jellyfin_kodi/objects/movies.py b/jellyfin_kodi/objects/movies.py index 44927b69c..cc180338b 100644 --- a/jellyfin_kodi/objects/movies.py +++ b/jellyfin_kodi/objects/movies.py @@ -3,8 +3,7 @@ ################################################################################################## -from six.moves.urllib.parse import urlencode -from kodi_six.utils import py2_encode +from urllib.parse import urlencode from .. import downloader as server from ..database import jellyfin_db, queries as QUEM @@ -240,7 +239,7 @@ def get_path_filename(self, obj): else: obj["Path"] = "plugin://plugin.video.jellyfin/%s/" % obj["LibraryId"] params = { - "filename": py2_encode(obj["Filename"], "utf-8"), + "filename": obj["Filename"], "id": obj["Id"], "dbid": obj["MovieId"], "mode": "play", diff --git a/jellyfin_kodi/objects/musicvideos.py b/jellyfin_kodi/objects/musicvideos.py index c2d280e44..22632d3d1 100644 --- a/jellyfin_kodi/objects/musicvideos.py +++ b/jellyfin_kodi/objects/musicvideos.py @@ -5,9 +5,7 @@ import datetime import re - -from six.moves.urllib.parse import urlencode -from kodi_six.utils import py2_encode +from urllib.parse import urlencode from ..database import jellyfin_db, queries as QUEM from ..helper import api, stop, validate, jellyfin_item, values, Local, LazyLogger @@ -210,7 +208,7 @@ def get_path_filename(self, obj): else: obj["Path"] = "plugin://plugin.video.jellyfin/%s/" % obj["LibraryId"] params = { - "filename": py2_encode(obj["Filename"], "utf-8"), + "filename": obj["Filename"], "id": obj["Id"], "dbid": obj["MvideoId"], "mode": "play", diff --git a/jellyfin_kodi/objects/obj.py b/jellyfin_kodi/objects/obj.py index 7c89f3547..958388cd6 100644 --- a/jellyfin_kodi/objects/obj.py +++ b/jellyfin_kodi/objects/obj.py @@ -6,9 +6,7 @@ import json import os -from six import iteritems, ensure_text - -from ..helper import LazyLogger, get_filesystem_encoding +from ..helper import LazyLogger ################################################################################################## @@ -29,7 +27,7 @@ def __init__(self): def mapping(self): """Load objects mapping.""" - file_dir = os.path.dirname(ensure_text(__file__, get_filesystem_encoding())) + file_dir = os.path.dirname(__file__) with open(os.path.join(file_dir, "obj_map.json")) as infile: self.objects = json.load(infile) @@ -54,7 +52,7 @@ def map(self, item, mapping_name): mapping = self.objects[mapping_name] - for key, value in iteritems(mapping): + for key, value in mapping.items(): self.mapped_item[key] = None params = value.split(",") @@ -151,7 +149,7 @@ def __filters__(self, obj, filters): result = False - for key, value in iteritems(filters): + for key, value in filters.items(): inverse = False diff --git a/jellyfin_kodi/objects/tvshows.py b/jellyfin_kodi/objects/tvshows.py index 09485509e..ee6dbd7c3 100644 --- a/jellyfin_kodi/objects/tvshows.py +++ b/jellyfin_kodi/objects/tvshows.py @@ -5,9 +5,7 @@ import sqlite3 from ntpath import dirname - -from six.moves.urllib.parse import urlencode -from kodi_six.utils import py2_encode +from urllib.parse import urlencode from .. import downloader as server from ..database import jellyfin_db, queries as QUEM @@ -535,7 +533,7 @@ def get_episode_path_filename(self, obj): obj["SeriesId"], ) params = { - "filename": py2_encode(obj["Filename"], "utf-8"), + "filename": obj["Filename"], "id": obj["Id"], "dbid": obj["EpisodeId"], "mode": "play", diff --git a/jellyfin_kodi/player.py b/jellyfin_kodi/player.py index ac7092082..a71122bf3 100644 --- a/jellyfin_kodi/player.py +++ b/jellyfin_kodi/player.py @@ -5,7 +5,8 @@ import os -from kodi_six import xbmc, xbmcvfs +import xbmc +import xbmcvfs from .objects.obj import Objects from .helper import translate, api, window, settings, dialog, event, JSONRPC diff --git a/jellyfin_kodi/views.py b/jellyfin_kodi/views.py index 6a72a2b6d..310be87f6 100644 --- a/jellyfin_kodi/views.py +++ b/jellyfin_kodi/views.py @@ -5,9 +5,9 @@ import os import xml.etree.ElementTree as etree +from urllib.parse import urlencode -from six.moves.urllib.parse import urlencode -from kodi_six import xbmcvfs +import xbmcvfs from .database import Database, jellyfin_db, get_sync, save_sync from .helper import translate, api, window, event diff --git a/release.yaml b/release.yaml index d5ba20076..31862dbd4 100644 --- a/release.yaml +++ b/release.yaml @@ -11,10 +11,6 @@ dependencies: version: '2.22.0+matrix.1' - addon: 'script.module.dateutil' version: '2.8.1+matrix.1' - - addon: 'script.module.six' - version: '1.14.0+matrix.2' - - addon: 'script.module.kodi-six' - version: '0.1.3+1' - addon: 'script.module.addon.signals' version: '0.0.5+matrix.1' - addon: 'script.module.websocket' diff --git a/requirements-dev.txt b/requirements-dev.txt index 889770b27..af40f310f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,4 @@ setuptools >= 44.1.1 # Old setuptools causes script.module.addon.signals to fail installing -six >= 1.13 python-dateutil >= 2.8.1 requests >= 2.22 PyYAML >= 6.0 @@ -9,7 +8,6 @@ tzdata; platform_system == "Windows" Kodistubs ~=21.0 -git+https://github.com/romanvm/kodi.six git+https://github.com/ruuk/script.module.addon.signals pre-commit >= 3.7.1 @@ -21,7 +19,6 @@ websocket-client >= 1.6.4 types-requests >= 2.31 types-PyYAML >= 6.0 -types-six >= 1.13 types-python-dateutil >= 2.8.1 types-setuptools >= 44.1.1 diff --git a/service.py b/service.py index c19472d5b..a28e27aa4 100644 --- a/service.py +++ b/service.py @@ -5,7 +5,7 @@ import threading -from kodi_six import xbmc +import xbmc from jellyfin_kodi.entrypoint.service import Service from jellyfin_kodi.helper.utils import settings