Remove some obsolete code for Kodi Krypton
This commit is contained in:
parent
b4a7a9ec41
commit
6fa19e3495
6 changed files with 32 additions and 66 deletions
|
@ -67,8 +67,7 @@ class Connection(object):
|
|||
# Shall we verify SSL certificates? "None" will leave SSL enabled
|
||||
# Ignore this setting for Kodi >= 18 as Kodi 18 is much stricter
|
||||
# with checking SSL certs
|
||||
self.verify_ssl_cert = None if v.KODIVERSION >= 18 or utils.settings('sslverify') == 'true' \
|
||||
else False
|
||||
self.verify_ssl_cert = None
|
||||
# Do we have an ssl certificate for PKC we need to use?
|
||||
self.ssl_cert_path = utils.settings('sslcert') \
|
||||
if utils.settings('sslcert') != 'None' else None
|
||||
|
@ -89,8 +88,7 @@ class Connection(object):
|
|||
self.server_name, self.machine_identifier, self.server)
|
||||
|
||||
def load_entrypoint(self):
|
||||
self.verify_ssl_cert = None if v.KODIVERSION >= 18 or utils.settings('sslverify') == 'true' \
|
||||
else False
|
||||
self.verify_ssl_cert = None
|
||||
self.ssl_cert_path = utils.settings('sslcert') \
|
||||
if utils.settings('sslcert') != 'None' else None
|
||||
self.https = utils.settings('https') == 'true'
|
||||
|
|
|
@ -211,8 +211,7 @@ class InitialSetup(object):
|
|||
not set before
|
||||
"""
|
||||
answer = True
|
||||
chk = PF.check_connection(app.CONN.server,
|
||||
verifySSL=True if v.KODIVERSION >= 18 else False)
|
||||
chk = PF.check_connection(app.CONN.server, verifySSL=True)
|
||||
if chk is False:
|
||||
LOG.warn('Could not reach PMS %s', app.CONN.server)
|
||||
answer = False
|
||||
|
@ -240,18 +239,13 @@ class InitialSetup(object):
|
|||
"""
|
||||
Checks for server's connectivity. Returns check_connection result
|
||||
"""
|
||||
if server['local']:
|
||||
# Deactive SSL verification if the server is local for Kodi 17
|
||||
verifySSL = True if v.KODIVERSION >= 18 else False
|
||||
else:
|
||||
verifySSL = True
|
||||
if not server['token']:
|
||||
# Plex GDM: we only get the token from plex.tv after
|
||||
# Sign-in to plex.tv
|
||||
server['token'] = utils.settings('plexToken') or None
|
||||
return PF.check_connection(server['baseURL'],
|
||||
token=server['token'],
|
||||
verifySSL=verifySSL)
|
||||
verifySSL=True)
|
||||
|
||||
def pick_pms(self, showDialog=False, inform_of_search=False):
|
||||
"""
|
||||
|
@ -550,22 +544,14 @@ class InitialSetup(object):
|
|||
|
||||
# Display a warning if Kodi puts ALL movies into the queue, basically
|
||||
# breaking playback reporting for PKC
|
||||
warn = False
|
||||
settings = js.settings_getsettingvalue('videoplayer.autoplaynextitem')
|
||||
if v.KODIVERSION >= 18:
|
||||
# Answer for videoplayer.autoplaynextitem:
|
||||
# [{u'label': u'Music videos', u'value': 0},
|
||||
# {u'label': u'TV shows', u'value': 1},
|
||||
# {u'label': u'Episodes', u'value': 2},
|
||||
# {u'label': u'Movies', u'value': 3},
|
||||
# {u'label': u'Uncategorized', u'value': 4}]
|
||||
if 1 in settings or 2 in settings or 3 in settings:
|
||||
warn = True
|
||||
else:
|
||||
# Kodi Krypton: answer is boolean
|
||||
if settings:
|
||||
warn = True
|
||||
if warn:
|
||||
# Answer for videoplayer.autoplaynextitem:
|
||||
# [{u'label': u'Music videos', u'value': 0},
|
||||
# {u'label': u'TV shows', u'value': 1},
|
||||
# {u'label': u'Episodes', u'value': 2},
|
||||
# {u'label': u'Movies', u'value': 3},
|
||||
# {u'label': u'Uncategorized', u'value': 4}]
|
||||
if 1 in settings or 2 in settings or 3 in settings:
|
||||
LOG.warn('Kodi setting videoplayer.autoplaynextitem is: %s',
|
||||
settings)
|
||||
if utils.settings('warned_setting_videoplayer.autoplaynextitem') == 'false':
|
||||
|
@ -575,17 +561,13 @@ class InitialSetup(object):
|
|||
# Warning: Kodi setting "Play next video automatically" is
|
||||
# enabled. This could break PKC. Deactivate?
|
||||
if utils.yesno_dialog(utils.lang(29999), utils.lang(30003)):
|
||||
if v.KODIVERSION >= 18:
|
||||
for i in (1, 2, 3):
|
||||
try:
|
||||
settings.remove(i)
|
||||
except ValueError:
|
||||
pass
|
||||
js.settings_setsettingvalue('videoplayer.autoplaynextitem',
|
||||
settings)
|
||||
else:
|
||||
js.settings_setsettingvalue('videoplayer.autoplaynextitem',
|
||||
False)
|
||||
for i in (1, 2, 3):
|
||||
try:
|
||||
settings.remove(i)
|
||||
except ValueError:
|
||||
pass
|
||||
js.settings_setsettingvalue('videoplayer.autoplaynextitem',
|
||||
settings)
|
||||
# Set any video library updates to happen in the background in order to
|
||||
# hide "Compressing database"
|
||||
js.settings_setsettingvalue('videolibrary.backgroundupdate', True)
|
||||
|
|
|
@ -48,17 +48,16 @@ class KodiMusicDB(common.KodiDBBase):
|
|||
strRole)
|
||||
VALUES (?, ?)
|
||||
''', (1, 'Artist'))
|
||||
if v.KODIVERSION >= 18:
|
||||
self.cursor.execute('DELETE FROM versiontagscan')
|
||||
self.cursor.execute('''
|
||||
INSERT INTO versiontagscan(
|
||||
idVersion,
|
||||
iNeedsScan,
|
||||
lastscanned)
|
||||
VALUES (?, ?, ?)
|
||||
''', (v.DB_MUSIC_VERSION,
|
||||
0,
|
||||
timing.kodi_now()))
|
||||
self.cursor.execute('DELETE FROM versiontagscan')
|
||||
self.cursor.execute('''
|
||||
INSERT INTO versiontagscan(
|
||||
idVersion,
|
||||
iNeedsScan,
|
||||
lastscanned)
|
||||
VALUES (?, ?, ?)
|
||||
''', (v.DB_MUSIC_VERSION,
|
||||
0,
|
||||
timing.kodi_now()))
|
||||
|
||||
@db.catch_operationalerrors
|
||||
def update_path(self, path, kodi_pathid):
|
||||
|
@ -487,9 +486,6 @@ class KodiMusicDB(common.KodiDBBase):
|
|||
|
||||
@db.catch_operationalerrors
|
||||
def remove_album(self, kodi_id):
|
||||
if v.KODIVERSION < 18:
|
||||
self.cursor.execute('DELETE FROM albuminfosong WHERE idAlbumInfo = ?',
|
||||
(kodi_id, ))
|
||||
self.cursor.execute('DELETE FROM album_artist WHERE idAlbum = ?',
|
||||
(kodi_id, ))
|
||||
self.cursor.execute('DELETE FROM album WHERE idAlbum = ?', (kodi_id, ))
|
||||
|
|
|
@ -127,12 +127,6 @@ def check_connection(url, token=None, verifySSL=None):
|
|||
header_options = None
|
||||
if token is not None:
|
||||
header_options = {'X-Plex-Token': token}
|
||||
if verifySSL is True:
|
||||
if v.KODIVERSION >= 18:
|
||||
# Always verify with Kodi >= 18
|
||||
verifySSL = True
|
||||
else:
|
||||
verifySSL = True if utils.settings('sslverify') == 'true' else False
|
||||
if 'plex.tv' in url:
|
||||
url = 'https://plex.tv/api/home/users'
|
||||
LOG.debug("Checking connection to server %s with verifySSL=%s",
|
||||
|
@ -432,7 +426,7 @@ def _poke_pms(pms, queue):
|
|||
xml = DU().downloadUrl('%s/identity' % url,
|
||||
authenticate=False,
|
||||
headerOptions={'X-Plex-Token': pms['token']},
|
||||
verifySSL=True if v.KODIVERSION >= 18 else False,
|
||||
verifySSL=True,
|
||||
timeout=(3.0, 5.0))
|
||||
try:
|
||||
xml.attrib['machineIdentifier']
|
||||
|
@ -888,7 +882,7 @@ def GetMachineIdentifier(url):
|
|||
"""
|
||||
xml = DU().downloadUrl('%s/identity' % url,
|
||||
authenticate=False,
|
||||
verifySSL=True if v.KODIVERSION >= 18 else False,
|
||||
verifySSL=True,
|
||||
timeout=10,
|
||||
reraise=True)
|
||||
try:
|
||||
|
@ -1000,7 +994,7 @@ def pms_root(url, token):
|
|||
return DU().downloadUrl(
|
||||
url,
|
||||
authenticate=False,
|
||||
verifySSL=True if v.KODIVERSION >= 18 else False,
|
||||
verifySSL=True,
|
||||
headerOptions={'X-Plex-Token': token} if token else None)
|
||||
|
||||
|
||||
|
@ -1013,7 +1007,7 @@ def get_PMS_settings(url, token):
|
|||
return DU().downloadUrl(
|
||||
'%s/:/prefs' % url,
|
||||
authenticate=False,
|
||||
verifySSL=True if v.KODIVERSION >= 18 else False,
|
||||
verifySSL=True,
|
||||
headerOptions={'X-Plex-Token': token} if token else None)
|
||||
|
||||
|
||||
|
|
|
@ -266,8 +266,6 @@ class Service(object):
|
|||
# Save changes to to file
|
||||
self.setup.save_pms_settings(server['baseURL'], server['token'])
|
||||
self.setup.write_pms_to_settings(server)
|
||||
if not v.KODIVERSION >= 18:
|
||||
utils.settings('sslverify', value='false')
|
||||
# Wipe Kodi and Plex database as well as playlists and video nodes
|
||||
utils.wipe_database()
|
||||
app.CONN.load()
|
||||
|
|
|
@ -165,8 +165,6 @@ class PMS_Websocket(WebSocket):
|
|||
if app.ACCOUNT.pms_token:
|
||||
uri += '?X-Plex-Token=%s' % app.ACCOUNT.pms_token
|
||||
sslopt = {}
|
||||
if v.KODIVERSION == 17 and utils.settings('sslverify') == "false":
|
||||
sslopt["cert_reqs"] = CERT_NONE
|
||||
LOG.debug("%s: Uri: %s, sslopt: %s",
|
||||
self.__class__.__name__, uri, sslopt)
|
||||
return uri, sslopt
|
||||
|
|
Loading…
Reference in a new issue