mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 17:56:11 +00:00
Correct logic errors introduced in 00765c0a
, fix flake8 except F841
This commit is contained in:
parent
49cfb6cb51
commit
d28c9a3ac8
34 changed files with 42 additions and 69 deletions
|
@ -18,7 +18,7 @@ sys.path.insert(0, __base__)
|
|||
|
||||
#################################################################################################
|
||||
|
||||
from entrypoint import Context
|
||||
from entrypoint import Context # noqa: F402
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ sys.path.insert(0, __base__)
|
|||
|
||||
#################################################################################################
|
||||
|
||||
from entrypoint import Context
|
||||
from entrypoint import Context # noqa: F402
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ sys.path.insert(0, __base__)
|
|||
|
||||
#################################################################################################
|
||||
|
||||
from entrypoint import Events
|
||||
from entrypoint import Events # noqa: F402
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
|
|
@ -2,20 +2,17 @@
|
|||
|
||||
##################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
import xbmc
|
||||
import xbmcaddon
|
||||
import xbmcvfs
|
||||
|
||||
import client
|
||||
from database import get_credentials, save_credentials
|
||||
from dialogs import ServerConnect, UsersConnect, LoginManual, ServerManual
|
||||
from helper import _, settings, addon_id, event, api, dialog, window
|
||||
from helper import settings, addon_id, event, api, window
|
||||
from jellyfin import Jellyfin
|
||||
from jellyfin.core.connection_manager import get_server_address, CONNECTION_STATE
|
||||
from jellyfin.core.connection_manager import CONNECTION_STATE
|
||||
from jellyfin.core.exceptions import HTTPException
|
||||
|
||||
##################################################################################################
|
||||
|
|
|
@ -6,7 +6,6 @@ import logging
|
|||
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
import xbmcaddon
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
|
|
@ -10,6 +10,10 @@ import xbmcvfs
|
|||
from helper import loghandler
|
||||
from jellyfin import Jellyfin
|
||||
|
||||
from .default import Events
|
||||
from .service import Service
|
||||
from .context import Context
|
||||
|
||||
#################################################################################################
|
||||
|
||||
Jellyfin.set_loghandler(loghandler.LogHandler, logging.DEBUG)
|
||||
|
@ -18,7 +22,3 @@ loghandler.config()
|
|||
LOG = logging.getLogger('JELLYFIN.entrypoint')
|
||||
|
||||
#################################################################################################
|
||||
|
||||
from default import Events
|
||||
from service import Service
|
||||
from context import Context
|
||||
|
|
|
@ -13,7 +13,6 @@ import database
|
|||
from dialogs import context
|
||||
from helper import _, settings, dialog
|
||||
from downloader import TheVoid
|
||||
from objects import Actions
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import _strptime # Workaround for threads using datetime: _striptime is locked
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
# Workaround for threads using datetime: _striptime is locked
|
||||
import _strptime # noqa:F401
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
|
||||
|
|
|
@ -3,19 +3,15 @@
|
|||
##################################################################################################
|
||||
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
import xbmc
|
||||
import xbmcvfs
|
||||
|
||||
import downloader as server
|
||||
import helper.xmls as xmls
|
||||
from database import Database, get_sync, save_sync, jellyfin_db
|
||||
from helper import _, settings, window, progress, dialog, LibraryException
|
||||
from helper.utils import get_screensaver, set_screensaver
|
||||
from views import Views
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
@ -319,7 +315,7 @@ class FullSync(object):
|
|||
message = show['Name']
|
||||
dialog.update(percent, heading="%s: %s" % (_('addon_name'), library['Name']), message=message)
|
||||
|
||||
if obj.tvshow(show, library=library):
|
||||
if obj.tvshow(show, library=library) is not False:
|
||||
|
||||
for episodes in server.get_episode_by_show(show['Id']):
|
||||
for episode in episodes['Items']:
|
||||
|
|
|
@ -2,22 +2,21 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from uuid import uuid4
|
||||
import collections
|
||||
|
||||
import xbmc
|
||||
import xbmcvfs
|
||||
|
||||
import api
|
||||
import database
|
||||
import client
|
||||
import collections
|
||||
import requests
|
||||
from . import _, settings, window, dialog
|
||||
from downloader import TheVoid
|
||||
|
||||
from . import _, settings, window, dialog
|
||||
|
||||
#################################################################################################
|
||||
|
||||
LOG = logging.getLogger("JELLYFIN." + __name__)
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
##################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
import xbmc
|
||||
import xbmcaddon
|
||||
|
|
|
@ -12,13 +12,14 @@ import urllib
|
|||
from uuid import uuid4
|
||||
from distutils.version import LooseVersion
|
||||
|
||||
from dateutil import tz, parser
|
||||
|
||||
import xbmc
|
||||
import xbmcaddon
|
||||
import xbmcgui
|
||||
import xbmcvfs
|
||||
|
||||
from . import _
|
||||
from dateutil import tz, parser
|
||||
from .translate import _
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -6,8 +6,9 @@ import logging
|
|||
|
||||
import xbmcgui
|
||||
|
||||
from . import _, LibraryException
|
||||
from utils import should_stop
|
||||
from .utils import should_stop
|
||||
from .exceptions import LibraryException
|
||||
from .translate import _
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import xml.etree.ElementTree as etree
|
||||
|
|
|
@ -12,7 +12,7 @@ from distutils.version import LooseVersion
|
|||
import urllib3
|
||||
|
||||
from credentials import Credentials
|
||||
from http import HTTP
|
||||
from http import HTTP # noqa: I201,I100
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
@ -499,7 +499,7 @@ class ConnectionManager(object):
|
|||
|
||||
def _after_connect_validated(self, server, credentials, system_info, connection_mode, verify_authentication, options):
|
||||
|
||||
if not options.get('enableAutoLogin'):
|
||||
if options.get('enableAutoLogin') is False:
|
||||
|
||||
self.config.data['auth.user_id'] = server.pop('UserId', None)
|
||||
self.config.data['auth.token'] = server.pop('AccessToken', None)
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
import json
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
|
||||
import xbmc
|
||||
|
||||
|
|
|
@ -841,7 +841,7 @@ class WebSocketApp(object):
|
|||
close websocket connection.
|
||||
"""
|
||||
self.keep_running = False
|
||||
if self.sock is None:
|
||||
if self.sock is not None:
|
||||
self.sock.close()
|
||||
|
||||
def _send_ping(self, interval):
|
||||
|
@ -887,7 +887,7 @@ class WebSocketApp(object):
|
|||
try:
|
||||
data = self.sock.recv()
|
||||
|
||||
if data is None or not self.keep_running:
|
||||
if data is None or self.keep_running is False:
|
||||
break
|
||||
self._callback(self.on_message, data)
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
import logging
|
||||
import Queue
|
||||
import threading
|
||||
import sys
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import xbmc
|
||||
|
@ -16,7 +15,7 @@ from database import Database, jellyfin_db, get_sync, save_sync
|
|||
from full_sync import FullSync
|
||||
from views import Views
|
||||
from downloader import GetItemWorker
|
||||
from helper import _, api, stop, settings, window, dialog, event, progress, LibraryException
|
||||
from helper import _, api, stop, settings, window, dialog, event, LibraryException
|
||||
from helper.utils import split_list, set_screensaver, get_screensaver
|
||||
from jellyfin import Jellyfin
|
||||
|
||||
|
|
|
@ -6,17 +6,15 @@ import binascii
|
|||
import json
|
||||
import logging
|
||||
import threading
|
||||
import sys
|
||||
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
|
||||
import connect
|
||||
import downloader
|
||||
import player
|
||||
from client import get_device_id
|
||||
from objects import Actions, PlaylistWorker, on_play, on_update, special_listener
|
||||
from helper import _, settings, window, dialog, event, api, JSONRPC
|
||||
from objects import PlaylistWorker, on_play, on_update, special_listener
|
||||
from helper import _, settings, window, dialog, api, JSONRPC
|
||||
from jellyfin import Jellyfin
|
||||
from webservice import WebService
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
version = "171076031"
|
||||
|
||||
from movies import Movies
|
||||
from musicvideos import MusicVideos
|
||||
from tvshows import TVShows
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import threading
|
||||
import sys
|
||||
|
@ -16,7 +15,7 @@ import xbmcaddon
|
|||
import database
|
||||
from downloader import TheVoid
|
||||
from obj import Objects
|
||||
from helper import _, playutils, api, window, settings, dialog, JSONRPC
|
||||
from helper import _, playutils, api, window, settings, dialog
|
||||
from dialogs import resume
|
||||
from utils import get_play_action
|
||||
|
||||
|
@ -443,7 +442,7 @@ class Actions(object):
|
|||
listitem.setProperty('IsPlayable', 'true')
|
||||
listitem.setProperty('IsFolder', 'false')
|
||||
|
||||
if obj['Resume'] and seektime:
|
||||
if obj['Resume'] and seektime is not False:
|
||||
listitem.setProperty('resumetime', str(obj['Resume']))
|
||||
listitem.setProperty('StartPercent', str(((obj['Resume'] / obj['Runtime']) * 100) - 0.40))
|
||||
else:
|
||||
|
|
|
@ -12,7 +12,7 @@ import xbmcvfs
|
|||
|
||||
import queries as QU
|
||||
import queries_texture as QUTEX
|
||||
from helper import window, settings
|
||||
from helper import settings
|
||||
import requests
|
||||
|
||||
##################################################################################################
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
import logging
|
||||
|
||||
import xbmc
|
||||
|
||||
import artwork
|
||||
import queries as QU
|
||||
from helper import values
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
##################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import urllib
|
||||
|
||||
|
@ -10,7 +9,7 @@ import downloader as server
|
|||
from obj import Objects
|
||||
from kodi import Movies as KodiDb, queries as QU
|
||||
from database import jellyfin_db, queries as QUEM
|
||||
from helper import api, catch, stop, validate, jellyfin_item, library_check, values, settings, Local
|
||||
from helper import api, stop, validate, jellyfin_item, library_check, values, settings, Local
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
|
|
@ -2,15 +2,13 @@
|
|||
|
||||
##################################################################################################
|
||||
|
||||
import json
|
||||
import datetime
|
||||
import logging
|
||||
import urllib
|
||||
|
||||
from obj import Objects
|
||||
from kodi import Music as KodiDb, queries_music as QU
|
||||
from database import jellyfin_db, queries as QUEM
|
||||
from helper import api, catch, stop, validate, jellyfin_item, values, library_check, settings, Local
|
||||
from helper import api, stop, validate, jellyfin_item, values, library_check, Local
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import urllib
|
|||
from obj import Objects
|
||||
from kodi import MusicVideos as KodiDb, queries as QU
|
||||
from database import jellyfin_db, queries as QUEM
|
||||
from helper import api, catch, stop, validate, library_check, jellyfin_item, values, Local
|
||||
from helper import api, stop, validate, library_check, jellyfin_item, values, Local
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
##################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import sqlite3
|
||||
import urllib
|
||||
|
@ -12,7 +11,7 @@ from obj import Objects
|
|||
from kodi import TVShows as KodiDb, queries as QU
|
||||
import downloader as server
|
||||
from database import jellyfin_db, queries as QUEM
|
||||
from helper import api, catch, stop, validate, jellyfin_item, library_check, settings, values, Local
|
||||
from helper import api, stop, validate, jellyfin_item, library_check, settings, values, Local
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#################################################################################################
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
|
||||
import logging
|
||||
|
||||
import xbmc
|
||||
|
||||
from helper import _, settings, dialog, JSONRPC, compare_version
|
||||
from helper import _, settings, dialog, JSONRPC
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
|
@ -11,9 +11,7 @@ import xml.etree.ElementTree as etree
|
|||
import xbmc
|
||||
import xbmcvfs
|
||||
|
||||
import downloader as server
|
||||
from database import Database, jellyfin_db, get_sync, save_sync
|
||||
from objects.kodi import kodi
|
||||
from helper import _, api, indent, write_xml, window, event
|
||||
from jellyfin import Jellyfin
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ sys.path.insert(0, __base__)
|
|||
|
||||
#################################################################################################
|
||||
|
||||
from entrypoint import Service
|
||||
from helper import settings
|
||||
from entrypoint import Service # noqa: F402
|
||||
from helper import settings # noqa: F402
|
||||
|
||||
#################################################################################################
|
||||
|
||||
|
|
4
tox.ini
4
tox.ini
|
@ -2,3 +2,7 @@
|
|||
max-line-length = 9999
|
||||
import-order-style = pep8
|
||||
exclude = ./.git,./.vscode,./libraries
|
||||
extend-ignore =
|
||||
I202
|
||||
per-file-ignores =
|
||||
*/__init__.py: F401
|
||||
|
|
Loading…
Reference in a new issue