mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
Merge pull request #462 from mcarlton00/matrix-stuff
Fixes for Matrix-RC2
This commit is contained in:
commit
33c2926732
5 changed files with 34 additions and 4 deletions
|
@ -99,7 +99,7 @@ class LoginManual(xbmcgui.WindowXMLDialog):
|
|||
def _add_editcontrol(self, x, y, height, width, password=False):
|
||||
|
||||
kwargs = dict(
|
||||
label="User",
|
||||
label="",
|
||||
font="font13",
|
||||
textColor="FF00A4DC",
|
||||
disabledColor="FF888888",
|
||||
|
|
|
@ -98,7 +98,7 @@ class ServerManual(xbmcgui.WindowXMLDialog):
|
|||
def _add_editcontrol(self, x, y, height, width):
|
||||
|
||||
control = xbmcgui.ControlEdit(0, 0, 0, 0,
|
||||
label="User",
|
||||
label="",
|
||||
font="font13",
|
||||
textColor="FF00A4DC",
|
||||
disabledColor="FF888888",
|
||||
|
|
|
@ -5,6 +5,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
|||
|
||||
import threading
|
||||
import sys
|
||||
import json
|
||||
from datetime import timedelta
|
||||
|
||||
from kodi_six import xbmc, xbmcgui, xbmcplugin, xbmcaddon
|
||||
|
@ -13,6 +14,7 @@ import database
|
|||
from helper import translate, playutils, api, window, settings, dialog
|
||||
from dialogs import resume
|
||||
from helper import LazyLogger
|
||||
from jellyfin import Jellyfin
|
||||
|
||||
from .obj import Objects
|
||||
|
||||
|
@ -28,8 +30,26 @@ class Actions(object):
|
|||
def __init__(self, server_id=None, api_client=None):
|
||||
|
||||
self.server_id = server_id or None
|
||||
if not api_client:
|
||||
LOG.debug('No api client provided, attempting to use config file')
|
||||
jellyfin_client = Jellyfin(server_id).get_client()
|
||||
api_client = jellyfin_client.jellyfin
|
||||
addon_data = xbmc.translatePath("special://profile/addon_data/plugin.video.jellyfin/data.json")
|
||||
try:
|
||||
with open(addon_data, 'rb') as infile:
|
||||
data = json.load(infile)
|
||||
|
||||
server_data = data['Servers'][0]
|
||||
api_client.config.data['auth.server'] = server_data.get('address')
|
||||
api_client.config.data['auth.server-name'] = server_data.get('Name')
|
||||
api_client.config.data['auth.user_id'] = server_data.get('UserId')
|
||||
api_client.config.data['auth.token'] = server_data.get('AccessToken')
|
||||
except Exception as e:
|
||||
LOG.warning('Addon appears to not be configured yet: {}'.format(e))
|
||||
|
||||
self.api_client = api_client
|
||||
self.server = self.api_client.config.data['auth.server']
|
||||
|
||||
self.stack = []
|
||||
|
||||
def get_playlist(self, item):
|
||||
|
|
|
@ -88,7 +88,12 @@ class Music(Kodi):
|
|||
self.cursor.execute(QU.update_artist_name, args)
|
||||
|
||||
def update(self, *args):
|
||||
self.cursor.execute(QU.update_artist, args)
|
||||
if self.version_id < 74:
|
||||
self.cursor.execute(QU.update_artist74, args)
|
||||
else:
|
||||
# No field for backdrops in Kodi 19, so we need to omit that here
|
||||
args = args[:3] + args[4:]
|
||||
self.cursor.execute(QU.update_artist82, args)
|
||||
|
||||
def link(self, *args):
|
||||
self.cursor.execute(QU.update_link, args)
|
||||
|
|
|
@ -154,11 +154,16 @@ SET strArtist = ?
|
|||
WHERE idArtist = ?
|
||||
"""
|
||||
update_artist_name_obj = ["{Name}", "{ArtistId}"]
|
||||
update_artist = """
|
||||
update_artist74 = """
|
||||
UPDATE artist
|
||||
SET strGenres = ?, strBiography = ?, strImage = ?, strFanart = ?, lastScraped = ?
|
||||
WHERE idArtist = ?
|
||||
"""
|
||||
update_artist82 = """
|
||||
UPDATE artist
|
||||
SET strGenres = ?, strBiography = ?, strImage = ?, lastScraped = ?
|
||||
WHERE idArtist = ?
|
||||
"""
|
||||
update_link = """
|
||||
INSERT OR REPLACE INTO album_artist(idArtist, idAlbum, strArtist)
|
||||
VALUES (?, ?, ?)
|
||||
|
|
Loading…
Reference in a new issue